Submitted by gregv on Wed, 11/17/2010 - 13:52
Virtualmin System Information page shows Apache Server down when it is not.
httpd.pid file is there, httpd processes are running. Did a restart of the server via /etc/init.d/httpd. Did a killall httpd and a restart of apache. Also did a killall and then restarted apache via the virtualmin green triangle interface.
No recent changes other than a couple of server certificates a few weeks back, and enabling SSL on some hosts.
No huge rush on this, but it is a little bit annoying. ;-) At least it's running.
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Wed, 11/17/2010 - 14:08 Comment #1
If you go to Webmin -> Servers -> Apache Webserver, is it shown as running? If the "apply configuration" link appears, then Webmin thinks it is up.
If not, the "start apache" link will appear. In this case, the PID file path might be wrong - this could happen if Apache was upgraded or the PID location changed. You can adjust this by clicking on the Module Config link on the Apache Webserver page.
Submitted by gregv on Wed, 11/17/2010 - 14:44 Comment #2
Hi Jamie,
Thanks for the quick reply.
Yes, webmin thinks apache is down. It shows the start apache link. I have already adjusted the PID location on the Module Config link to point to 'Default' and also to '/etc/httpd/run'. In both cases I could restart apache (using killall httpd and then starting, both from webmin and from the init script), but then webmin still thinks apache is down. That's where I am now.
I've also tried stopping and starting webmin just in case. No luck so far.
One other change though, and there was an update in Centos that brought in a new initscripts package. That shouldn't change the apache scripts... but....
Submitted by JamieCameron on Wed, 11/17/2010 - 14:55 Comment #3
For the PID file location, did you enter the full path to the file? It should be something like
/var/run/httpd.pid
, not just the directory.Submitted by gregv on Wed, 11/17/2010 - 23:29 Comment #4
Yep, that fixed it. Somehow the path was something like etc/httpd/run when I first looked at it. I thought that was strange.
However, I would think that choosing 'Default' might have fixed it.
Everything is back to normal. Thanks!
Submitted by JamieCameron on Wed, 11/17/2010 - 23:35 Comment #5
Great!
Submitted by gregv on Sun, 11/21/2010 - 09:54 Comment #6
The Virtualmin status page is showing that Apache is down again. It's not. The pid file is defined correctly, but it is not there. Any suggestions?
Submitted by Locutus on Sun, 11/21/2010 - 10:12 Comment #7
The PID file is not there? Maybe it was created elsewhere, was deleted, or not created at all...
Submitted by gregv on Sun, 11/21/2010 - 10:23 Comment #8
Thanks for the quick reply!
The strange thing is that this server has been running fine for a couple of years, and now has suddenly picked up this problem. Well, actually Apache is still running, so it's more annoying than anything else. But I hadn't changed anything.
Anyways, I went into the Apache httpd.conf file and saw that the PidFile directive was empty. This was after I'd changed it as documented above via the webmin interface.
I then did a killall httpd and then started apache up and it looks okay now.
Is there a chance that webmin has a bad setting somewhere that's overwriting what is in the config files?
Submitted by Locutus on Sun, 11/21/2010 - 11:28 Comment #9
Not really sure about that, but there are two places in Webmin's Apache module that are PID file related. In the Module Config -> System configuration you set where it should look for the file, and in Global Configuration -> Misc you set where Apache should create it (which should be the setting that goes into the httpd.conf).
Submitted by JamieCameron on Sun, 11/21/2010 - 12:08 Comment #10
Normally apache will use a default PID file location if none is set in httpd.conf , but it seems that that is different to what Webmin expects. Was apache perhaps upgraded recently?
Anyway, if you set the PidFile directive, both apache and Webmin will use that setting.
Submitted by gregv on Sun, 11/21/2010 - 12:41 Comment #11
I don't think I upgraded apache in the past couple of weeks. I pretty much just leave it to the CentOS repository.
I reset the PidFile, as mentioned earlier in the case, via the webmin settings and that worked for a few days. Hopefully changing the config file will fix things.
Still, I've got to wonder, if I changed it via the webmin settings, why wasn't it defined in httpd.conf?
Submitted by JamieCameron on Sun, 11/21/2010 - 13:23 Comment #12
Webmin is by default configured to use the compiled-in default pid file location for your system. This is set on the Module Config page, but changing that doesn't change where Apache will write the PID - instead it just sets where Webmin looks.
Submitted by gregv on Sun, 11/21/2010 - 13:40 Comment #13
Okay, that's good to know. Anyways, so far it looks okay.
Thanks!
Submitted by Issues on Sun, 12/05/2010 - 14:04 Comment #14
Automatically closed -- issue fixed for 2 weeks with no activity.
Submitted by gregv on Sun, 12/05/2010 - 14:30 Comment #15
As a matter of fact, I had another occurrence of this problem early this morning. Interestingly, it happened about the same time as the logwatch got mailed off to me.
It might be due to some of the SSL enabling I did recently. If you stumble onto a solution somewhere else, let me know. Otherwise, don't spend too much time on this if it's not bothering other folks on Centos.
Cheers! Greg
Submitted by gregv on Sun, 01/02/2011 - 03:44 Comment #16
Okay, I found the problem.
In the log rotation part of webmin, most of my virtual servers were set to run /usr/sbin/apachectl graceful after the log rotation. However, the three newest virtual servers were configured to run /etc/init.d/apache restart. This would lead to the log rotation of the new virtual servers stomping over those of the earlier servers.
I've changed things so that the command is always to do a graceful restart. I hadn't changed this, so someplace /etc/init.d/apache restart is getting inserted.
I suppose the way to really do this is to move all of the logs for the virtual servers, and then do one single restart to the apache process(es).
Cheers!
Submitted by JamieCameron on Sun, 01/02/2011 - 13:48 Comment #17
You can set the command that will be run after a rotation at Webmin -> Servers -> Apache Webserver -> Module Config -> Command to apply configuration. This should be set to use "apachectl graceful" by default though ..
Submitted by gregv on Sun, 01/02/2011 - 13:57 Comment #18
I'm pretty sure that I didn't do any changes to the config. But, you never know. Anyways, this should make it go away.
Thanks for your help! :D