Apache 2.4.25 crashes at midnight

I see the startup script was changed for Linux but not FreeBSD. Maybe that's part of the problem.
 
FreeBSD Startup hasn't been changed since 2011.
http://files.directadmin.com/services/custombuild/httpd_2_freebsd

Linux version updated February 20th.
http://files.directadmin.com/services/custombuild/httpd_2-2.6

A STOPTIMEOUT variable was added along with some other code.

Note this:

# When stopping httpd, a delay (of default 10 second) is required
# before SIGKILLing the httpd parent; this gives enough time for the
# httpd parent to SIGKILL any errant children.

Which might be why in my logs it says that it fails to removed the POD file.

Things ain't working right. Rather frustrating. Wasting a week on this now. Still not resolved no matter what I do. I'm trying all types of configurations.
 
Thanks. I will look into the codes and see if converting the new one to work for FreeBSD will resolve anything...
 
No. They are not much different at all. That's not the source of our issue (or at least I can't find it there).
 
Go to your /etc/newsyslog.conf

Change the line for the rotation of error_log which will have the /var/run/httpd.pid and add "30" to the end so that it gets a proper signal.

Example of my own code:

Code:
/var/log/httpd/error_log        apache:apache   600     4       *       @T00    -       /var/run/httpd.pid 30

Fixes the log rotation.

You can test results before and after by manually running the command:
newsyslog -v -F
 
If you look at the errors more closely:

Code:
[lbmethod_heartbeat:notice] [pid 38405] AH02282: No slotmem from mod_heartmonitor
[core:emerg] [pid 38405] (17)File exists: AH00023: Couldn't create the watchdog-callback mutex (file /var/logs/watchdog-callback-_proxy_hcheck_.38405)

You'll notice that your lbmethod_heartbeat_module is misconfigured, and proxy_hcheck_module is probably causing the crash.

Are you actually using lbmethod_heartbeat and proxy_hcheck_module? If not, just disable them in httpd.conf:

Code:
#LoadModule lbmethod_heartbeat_module libexec/apache24/mod_lbmethod_heartbeat.so
#LoadModule proxy_hcheck_module libexec/apache24/mod_proxy_hcheck.so

The rule of thumb is - only enable modules in Apache that you actually use. Don't go blindly enabling stuff because it "sounds useful".
 
These modules are not loaded in shared memory. They are part of the build. I think they are dependencies for mod_proxy actually. There is no LoadModule for these. I wish I knew how to disable them or at least configure them correctly to remove the errors.
 
As far as I know, they cannot be disabled for Apache 2.4.25 - it won't compile without them. Plus the mentioned warnings are just a notice that the heartbeat service is not running - it's not a problem which should cause Apache to crash on graceful restart.

labrocca - I am happy that the mentioned fix your problem - it did not work for me.
 
Any idea how to run a cron job in 00:00:15 (15 seconds after midnight)? Currently I am forced to make it 00:01 and it makes like 52 seconds downtime. The newsyslog finishes it's job in 00:00:08... I wish to give myself a safe timeframe of few seconds and restart httpd...

Maybe an SH script with a sleep in it?
 
I'd start the cron at midnight with a 30 second sleep and see how that does. Take 5 seconds off each night to test. You could probably do 20 seconds comfortably.
 
Sorry for the late responce, but yeah, that did it:

crontab:

Code:
00 00 * * * root /mytools/httpd-delayed-restart.sh

httpd-delayed-restart.sh:

Code:
#!/bin/sh
sleep 10
/usr/local/etc/rc.d/httpd restart
 
Back
Top