简体   繁体   中英

Unable to start Apache HTTPD after server reboot

unable to start Apache HTTPD after server reboot. We have /etc/httpd/conf/ owned by func. user/group. Hence we use scripts to start httpd.conf and every time server reboots, we are unable to start HTTPD. We found that /var/run/httpd is getting changed to apache/root after reboot. Hence script fails to start the HTTPD which is under func. user/group.

Please help me !!!

Use the DefaultRuntimeDir directive to override the default "/run/httpd" directory. This goes in httpd.conf. For example:

DefaultRuntimeDir  "/my/local/rundir"

This will cause apache to create "/my/local/rundir/authdigest_shm.1234"

For some reason this doesn't also override the default pid file directory, so set it with the PidFile directive, eg:

PidFile "/my/local/rundir/httpd.pid"

Use /my/local/rundir/ location to your location which contains user/group permission.If you dont want to change location then you can use below configuration in /usr/lib/tmpfiles.d/httpd.conf

d /var/run/httpd   700 myuser mygroup
d /var/run/httpd/htcacheclean   700 myuser mygroup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM