Virtualmin System Information page shows Apache Server down when it is not.

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

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.

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....

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.

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!

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?

The PID file is not there? Maybe it was created elsewhere, was deleted, or not created at all...

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?

Is there a chance that webmin has a bad setting somewhere that's overwriting what is in the config files?

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).

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.

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?

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.

Okay, that's good to know. Anyways, so far it looks okay.

Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

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

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!

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 ..

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