Forum Moderators: phranque

Message Too Old, No Replies

Apache Hangs UP - Large Number of Subdomains

         

contactwin

4:10 am on Mar 18, 2006 (gmt 0)

10+ Year Member



Hello,
I have a question i don't really know how to ask.
I have purchased a dedicated unmanaged server and have been doing great so far.

Am not familiar with Apache and don't know most of the commands to run it and stuff.

Well i used to face this problem right from the beginning actually, apache used to hang up on me even when i had 500 or so sub-domains on my server.

I asked this question in the DirectAdmin forums and i was helped with this
Change the lines
---------------------------------------------------------- CustomLog /var/log/httpd/domains/¦DOMAIN¦.¦SUB¦.bytes bytes
CustomLog /var/log/httpd/domains/¦DOMAIN¦.¦SUB¦.log combined
ErrorLog /var/log/httpd/domains/¦DOMAIN¦.¦SUB¦.error.log
----------------------------------------------------

To
code:------------------------------------------------------
CustomLog /var/log/httpd/domains/¦DOMAIN¦.bytes bytes
CustomLog /var/log/httpd/domains/¦DOMAIN¦.log combined
ErrorLog /var/log/httpd/domains/¦DOMAIN¦.error.log
-----------------------------------------------------------

Now this served as a temporary solution and it helped me add sub-domains without any problems.
Now I'm using DirectAdmin for my control panel and have around 30 websites hosted on my server, but the problem is that I have over 3500 sub-domains on my server.

So if i add a few sub-domains, apache hangs up on me, i can still access my direct-admin control panel from port 2222
and access the server through ssh using putty.

I re-asked this question in the same forums, someone suggested me this url.
[help.directadmin.com...]

But that's totally rough work and am not sure if that's the perfect guide as it's not detailed enough for a novice like me to do that.

Pls Help! If you can stress out the exact code on how to do this, i'll be able to get through this.

Best Regards
Rj

lammert

1:49 am on Mar 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



contactwin, First of all Welcome to WebmasterWorld!

It is my understanding that you count every domain as one website. In that case you have opened 3 * 30 = 90 log files. This is not a problem for Apache to handle so you are probably not running out of file descriptors.

With the information you gave it is not possible to do a detailed analysis. Some things you have to investigate:

  • Do any of the apache error log files contain strange errors?
  • Does apache stop working when there is a high amount of users or at random moments?
  • Do you run out of swap space?
  • How do you restart the apache processes? Is apachectl sufficient, or do you need to restart the services or even worse, restart the server?
  • Is the server equipped with sufficient RAM?

contactwin

7:21 am on Mar 20, 2006 (gmt 0)

10+ Year Member



Hi,
Well no restarting doesn't help!
I have to delete those sub-domains for the server to start responding properly.

I have 1GB ram

What happens is, the websites are down port 80, if you try visiting any of the domains hosted, let's say www.a.com it will try try try and then go as a cannot find server page.

I don't know much about how to check apache errors and stuff, If you can detail out some stuff, i'd be able to do something

Best Regards

lammert

3:10 am on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If the Apache server refuses to start when the number of virtual domains in the config file increases, looks like a log file filedescriptor problem, although I calculated in a previous post based on your number of domains that the number of used filedescriptors is fairly low. You can however test this:
  • Increase the number of sub domains until Apache refuses to start
  • Comment out one of the CustomLog lines in your config file and try to restart Apache
  • If Apache runs with a log file commented out, you ran out of filedescriptors and have to increase the available number or decrease the number of opened files, otherwise your problem is somewhere else.

contactwin

3:52 am on Mar 23, 2006 (gmt 0)

10+ Year Member



Hi lammert,
sorry for being a duh!
but can u detail out how i could do the same?

Ofcourse i know how to comment a log file, but can u give me an example and which file name should i try doing this with?

Thanks
Best Regards
Contactwin