• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Max domains in APACHE

littlefrog

Regular Pleskian
Heres a brain tickler for ya... :mad:

I have psa 7.5.1 installed with an unlimited domains lisence.

In PSA if I add more then 500 virtual hosted domains I get errors all accross the board on every domain on the server.

Sometimes it says too many files open

Sometimes it says you do not have permission to view this folder

Sometimes Apache won't load at all and says Cant Open Log Files!

When I say sometimes I mean this.

Once I get the errors in order for the server to work right again I need to delete however many domains it is to get under the 500 mark.. It is actually 495 to be exact. Once I do that server runs fine again. Add another domain and I get one of the three errors. Once I get that error it is the same error until I delete ANY domain. Note that it is ANY domain not limited to the newly created domain. When the error happens it happens to every domain on the server.

One the errors in the error log is
---------
Traceback (most recent call last):
File "/usr/src/build/276269-i386/install/usr/lib/python2.2/site-packages/mod_python/apache.py", line 63, in ?
File "/usr/lib/python2.2/pdb.py", line 13, in ?
import re
File "/usr/lib/python2.2/re.py", line 27, in ?
from sre import *
File "/usr/lib/python2.2/sre.py", line 97, in ?
import sre_compile
File "/usr/lib/python2.2/sre_compile.py", line 15, in ?
from sre_constants import *
ImportError: No module named sre_constants
[Thu Jan 20 10:47:24 2005] [error] make_obcallback: could not import mod_python.apache.!
---------

Of course there is a Python update available from PSA but I can't install it becuase the default installation of PSA is missing a dependant package so I can't use the auto updater and this package is not available for invdividual download.

Talk about a show stopper. :confused:

My server is a Dual Xeon 2.0 Gz with 2 Gig of Ram.

Ev1 Servers is my ISP and they have no clue what the error is and only suggestion for me is to do a system restore... which is not an option cuse it means that all domains would be down .. bla bla bla.. can't go there.

Probably something I have to have the SW-Soft team to look into. I Just got this server less then a month ago and so far not been to happy with the errors I been getting.
 
This might work..

Edit the httpd.conf file.
cd /etc/httpd/conf/
vi httpd.conf

## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 1000
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# perchild MPM
# NumServers: constant number of server processes
# StartThreads: initial number of worker threads in each server process
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# MaxThreadsPerChild: maximum number of worker threads in each server process
# MaxRequestsPerChild: maximum number of connections per server process

Hope this helps.
 
You've probably hit limit of maximum open files at your system. Apache keeps log files constantly open, you should disable logging or tweak the server open file policy.

Good luck.
 
Update

Well ...

After changing the FD Amount and recompiling PHP, IMAP, and APACHE

ADDING in the unlimit value into httpd service
and changing some sysconfig stuff

The server is now running with almost 700 domains.
 
Ive seen as many as 4000 on one box. (Dont be that guy!). Amazing that people are still asking this question. I remember threads on this back in PSA 1.3 :p
 
Ive seen as many as 4000 on one box. (Dont be that guy!). Amazing that people are still asking this question. I remember threads on this back in PSA 1.3 :p

I have almost 3,000 and I remember the 1.3 days and someone kind enough to help us fix it too with our measly 1,000 domains @ the time.

Recomplie apache and your fine.

;)
 
Well those are some of the things i did.

After getting the error
Too Many Files Open error in /etc/httpd/error_logs

I did these steps to fix.

Steps:
1) Recompiled IMAP according to http://faq.sw-soft.com/index.php?ToDo=view&questId=173&catId=40

2) Recompiled PHP according to same doc.

3) Recompiled Apache in similar method to PHP and IMAP
according to http://faq.sw-soft.com/index.php?ToDo=view&questId=134&catId=29

4) Did this according to a suggestion of a user on the boards
a. Run sysctl -w fs.file-max=16384
b. Edit /etc/sysctl.conf. Add a new line with: fs.file-max=16384
c. Edit /usr/sbin/apachectl. Find the line that says ulimit -n 8192 and change it to ulimit -n 16384.
d. Restart apache: /usr/local/psa/admin/sbin/my_apci_rst.

5) Changed MaxClients in /etc/httpd/conf/httpsd.conf to
# prefork MPM
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 100
MaxRequestsPerChild 500
</IfModule>

# worker MPM
<IfModule worker.c>
StartServers 2
MaxClients 100
MinSpareThreads 25
MaxSpareThreads 75
</IfModule>

Now something I am getting once every 24 hrs or so is it appears apache has crashed. I am not able to visit any domain. When I check apache to see if it is running it says that it is. Shows just over 100 pid files too. I restart it and it comes back up. Here is error message in log file /etc/httpd/logs/error_log

[Tue Mar 01 06:33:11 2005] [error] server reached MaxClients setting, consider raising the MaxClients setting

Oddly the setting was originally 50. Anyone have any ideas now?
 
AN ANSWER HAS BEEN PROVIDED!!!

:D EV1 Servers and I have finally resolved this issue.

2 Things and I hope this helps someone else.

I am also going to start a new topic with symptoms and resolution.

For me the Segmentation Fault was being caused by OpenSSL which simply had to have the src package downloaded and rebuilt just like I had to do with apache.

Also had to change around the settings in apache for max clients and such.

Here is what i currently am using.

########################################
# APACHE SERVER/MAXCLIENT SETTINGS
########################################
ServerLimit 600

<IfModule prefork.c>
StartServers 10
MinSpareServers 10
MaxSpareServers 80
MaxClients 1000
MaxRequestsPerChild 40
</IfModule>

<IfModule worker.c>
StartServers 2
MaxClients 600
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 10
# Turned off to use less memory
# HTTPD memory usage went from 29M to 26M per pid
ThreadGuardArea off
</IfModule>

# Research this
#ListenBacklog
########################################

If anyone looks at this and sees that I should make a change please speak up.
 
Back
Top