Apache restarts too often!

PRB

Verified User
Joined
Oct 18, 2008
Messages
162
Hi,

I am having this problem all of my (7) servers, Apache restarts multiple times a day and every restart it takes around 10 seconds for Apache to restart and today it even took like 3 minuten one time.

It is very annoying to see Apache be offline for a couple of seconds and then get back online. My Apache logs @ the moments Apache restarts:

[Sun May 17 11:43:03 2009] [notice] caught SIGTERM, shutting down
[Sun May 17 11:43:08 2009] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

[Sun May 17 11:44:01 2009] [notice] caught SIGTERM, shutting down
[Sun May 17 11:44:03 2009] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

[Sun May 17 11:45:01 2009] [notice] caught SIGTERM, shutting down
[Sun May 17 11:45:04 2009] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

[Sun May 17 12:49:07 2009] [notice] caught SIGTERM, shutting down
[Sun May 17 12:51:02 2009] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

[Sun May 17 13:00:01 2009] [notice] caught SIGTERM, shutting down
[Sun May 17 13:00:11 2009] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

Why does this happen? There are no errors or anything (except the standard "File does not exist" errors)

I try to offer 99,9% uptime, but this way its not going to be 99,9%...
 
Every time a domain is added or deleted apache restarts.
 
to go a step further, anytime anything is modified by directadmin that affects one of the httpd.conf or included files, DA does a service httpd restart. You might also have cron jobs (such as logrotate, statistics programs and/or a backup program) that also stop/restart services like apache.
 
Hello,

We tried using reloads early on, but very quickly found that anytime you add or remove a VirtualHost that contains any sort of SSL related entry, you must do a full restart of apache. This essentially covers all changes to the httpd.conf files, adding domains, users, domains, removing them, etc.. so full restarts are required.

Note, that a graceful restart is still qualified as a full restart, it's just done slightly different. We have a guide here if you want to try it, however, it's not overly tested, so we're not sure what side effects may arise from it's use. It should offer lower downtime at the cost of a more complicated restart.
http://help.directadmin.com/item.php?id=181

John
 
Hello,

We tried using reloads early on, but very quickly found that anytime you add or remove a VirtualHost that contains any sort of SSL related entry, you must do a full restart of apache. This essentially covers all changes to the httpd.conf files, adding domains, users, domains, removing them, etc.. so full restarts are required.

Note, that a graceful restart is still qualified as a full restart, it's just done slightly different. We have a guide here if you want to try it, however, it's not overly tested, so we're not sure what side effects may arise from it's use. It should offer lower downtime at the cost of a more complicated restart.
http://help.directadmin.com/item.php?id=181

John

Hi John,

It is a production server with around 600 domains hosted on it, so I am kind of scared of following those steps when they have not been tested much.

I hope someone else can test this if they have a free server they are not using anyways.

Thanks for your reply, so every other webhosting company that offers DirectAdmin has this problem with apache restarting pretty often?
 
Everyone restarts apache.

3 minutes, however, is extremly slow.
Try restarting apache from from ssh to see how long it takes.. that's far higher than normal, perhaps the disk I/O is quite high so the httpd process isn't getting all of it's httpd.conf files quick enough.

John
 
I have 62 virtuals (no SSL however) and httpd 2.2.11 takes less than 10 seconds to restart, in most cases less than 5. I don't have a lot of churn though so the only time httpd restarts is at logrotate time.
 
This is getting unacceptable:

[Tue May 19 21:00:01 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:00:04 2009]
[Tue May 19 21:02:02 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:02:12 2009]
[Tue May 19 21:03:02 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:03:04 2009]
[Tue May 19 21:05:01 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:05:04 2009]
[Tue May 19 21:08:04 2009] [warn] child process 16433 still did not exit, sending a SIGTERM
[Tue May 19 21:08:04 2009] [warn] child process 16435 still did not exit, sending a SIGTERM
[Tue May 19 21:08:13 2009] [warn]
[Tue May 19 21:11:02 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:11:04 2009]
[Tue May 19 21:15:01 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:15:04 2009]
[Tue May 19 21:17:02 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:17:04 2009]

in 17 minutes, 8 httpd restarts? are you sure this is because of DirectAdmin? it is a xeon quadcore server with 2 GB ram and 650 domains with around 300 users

edit:
[Tue May 19 21:22:01 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:22:04 2009]
[Tue May 19 21:25:01 2009] [notice] caught SIGTERM, shutting down
[Tue May 19 21:25:03 2009]

if this is because of DirectAdmin and it restarts httpd every time a user adds a domain or anything, does this mean DirectAdmin isnt meant for 'big' companies and just for small servers? cause i have fallen in love but its things like this that are slowly pushing me away
 
Last edited:
All shared hosting control panels I know of restart apache whenever a site is added, or removed, or a change is otherwise made to the apache configuration.

Are you really doing one of these every time your server is restarting?

I'm not sure it's because of DirectAdmin (note, I'm NOT John :)); and others aren't having the problem; perhaps you should have an experienced administrator look at your system.

Jeff
 
Problem solved by removing SSL from all reseller accounts first through DirectAdmin,

then running the SSH command to turn off SSL for everybody.

Then edited httpd.conf and set log level to crit

And also run http://www.directadmin.com/help/item.php?id=9, these commands:
Code:
cd /usr/local/directadmin/data/templates
cp virtual_host*.conf custom
cd custom
perl -pi -e 's/Error/#Error/' virtual_host*.conf
perl -pi -e 's/CustomLog/#CustomLog/' virtual_host*.conf
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

This sever has around 50 reseller accounts, and 600 users. So thats why HTTPD needs to restart itself so often. Restarts now take 2 seconds and no one ever notices. I do get this often though:
[Fri May 22 16:25:35 2009] [notice] child pid 32364 exit signal Segmentation fault (11)
[Fri May 22 16:25:40 2009] [notice] child pid 32496 exit signal Segmentation fault (11)
[Fri May 22 16:25:59 2009] [notice] child pid 32495 exit signal Segmentation fault (11)
[Fri May 22 16:27:23 2009] [notice] child pid 32533 exit signal Segmentation fault (11)
[Fri May 22 16:32:58 2009] [notice] child pid 1637 exit signal Segmentation fault (11)
[Fri May 22 16:49:53 2009] [notice] child pid 6375 exit signal Segmentation fault (11)

but at least the server is running nice.
 
I have the same problem with apache restarting every couple hours. I'm a small company so it's not that I'm adding or removing domains. It's a fast restart and isn't a problem for most customers. But I do have one using shoutcast via cast-control and whenever it restarts, her shoutcast server goes offline. This is a problem. But it is a problem I never had when I had cpanel, even when adding or removing domains.
 
Back
Top