Maximum number of domains?

groefie

Verified User
Joined
Apr 1, 2005
Messages
32
Ok guys, here's the problem:

this morning I added a new account on one of our servers. Everything went fine, apache restarted without a problem but after that all of the sites on the server were down.

So I deleted that new account again, restarted apache and all sites were back up.

Now it seems I can't add a new account on the box anymore unless I delete another account, so there must be a limit somewhere. Even adding a subdomain goes wrong, which means that when one of our customers adds a subdomain all sites will go down after apache restarts.

To prevent this I've deleted some inactive accounts on the server. But of course that's only a temp. solution.

So my question now is: can I change the maximum number of accounts/sites/domains somewhere? I've looked in httpd.conf but couldn't find anything related to that. :confused:

These are the current # of domains on that box:

# of Users 390
# of Domains 585
# of SubDomains 420


Thanks in advance.
 
Limits are OS distribution dependent, and should probably be taken up with a support group for the OS you use.

But first perhaps you should do some homework.

Count the lines in /etc/passwd; that's the number of users you've got.

Check the error log for apache in realtime (use the tail command; for instructions see "man tail") while you restart your httpd daemon (how to do this depends on the OS distribution, but you can do it from the directadmin control panel if you're not sure how to do it from the command line).

Jeff
 
Hi,

this is the output of the error log when apache restarts:

[Sat Aug 27 18:23:58 2005] [notice] caught SIGTERM, shutting down
[Sat Aug 27 18:24:03 2005] [notice] Apache configured -- resuming normal operations
[Sat Aug 27 18:24:03 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Aug 27 18:24:03 2005] [notice] Accept mutex: sysvsem (Default: sysvsem)

even when I add a 'domain too much'. Nothing wrong there. Apache just starts up but the sites aren't reachable unless I delete a domain or subdomain on the box again. All other services work well.

According to /etc/passwd, there are 423 users on the box.

The OS is fedora 2
 
Last edited:
That does not sound as if it's too many users.

You should check your httpd logs to see what happens when you attempt to access a website.

And what do you mean by unreachable? Do you get an error, or a timeout, or what?

Jeff
 
Are you getting "NOT FOUND" from the webserver or from your browser (the only real way to tell is to use some other browser besides IE; IE doesn't differentiate too well)?

If from the browser, then it appears to be a DNS error. If from the webserver, then the server is working and the error is somewhere in the logs.

Jeff
 
Hi,

Firefox says 'connection not allowed'.

I don't think it's a dns issue because http://www.myserver.com:2222 works, but http://www.myserver.com doesn't (unless I delete the last added domain again. When I delete 3 domains, I can add 3 new ones, but when the 4th is added it goes wrong again). So it must be apache related I suppose.
 
I suppose it has something to do with the (maximum) number of virtualhosts the server can handle. Anyone an idea what to do to solve this? :confused: It's a P4 3Ghz with 1 gig DDR ram.
 
Last edited:
Qs

I found the most likely answer here.

Unfortunately it's not an easy fix. I'll bring this thread to the attention of DA support; maybe they can figure out how to patch apache.

(Another workaround, more complex, would be only use one apache log file for all domains, and break them out every night during overnight processing, before running Webmin or any other logging service; this is how the old Cobalt Raqs did it.)

Jeff
 
Hello,

We do have a solution which should work:
http://help.directadmin.com/item.php?id=9

The only drawbacks are:

1) Users can no longer see their own error logs.
2) Your main /var/log/httpd/error_log gets big, fairly quickly

What you can also do, is remove the errors logs from all virtual_host file *except* the virtual_host.conf file. So the majority of the domains will still have their error logs, and only subdomains, and https domains/subdomains will be the only thing without error logs.

John
 
Just poking around in proc and found the setting for file handles... it would be interesting to see the output of
Code:
cat /proc/sys/fs/file-nr
This should tell you the number of current file handles, the number of file handles in use and the maximum number of file handles possible.

This should be configurable in sysctl.conf, .i.e.
Code:
echo "fs.file-max=103062" >> /etc/sysctl.conf
and modifiable by
Code:
echo "103062" > /proc/sys/fs/file-max
It would also be interesting to see the apache user's ulimit to see if you're hitting the hard or the soft limit for descriptors... It's also possible that apache itself can only use so many descriptors, regardless of the ulimit or the kernel limit.
 
ballyn said:
It's also possible that apache itself can only use so many descriptors, regardless of the ulimit or the kernel limit.
It's possible. But then I'd think that the Apache Organization would write that in their responses and documentation, instead of that it's dependent on ulimit.

Jeff
 
Yes, but I think ulimit relates to the apache user itself, while if there's a per-process limit, the parent apache process could hit that before it hits the ulimit for the user.
 
Back
Top