Y I
asked on
Apache server suddenly stopped. Which logs we should check?
Apache server suddenly stopped. Although we tried to reboot, it stuck. To find the root cause, which logs we should check?
[root@servername ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/h ttpd.servi ce; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8)
[root@servername ~]# systemctl stop httpd
[root@servername ~]# systemctl start httpd
its stuck
It's appreciate your advices.
[root@servername ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/h
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8)
[root@servername ~]# systemctl stop httpd
[root@servername ~]# systemctl start httpd
its stuck
It's appreciate your advices.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for the information. httpd could restart by using httpd start instead of systemctl.
Maybe the systemd Apache control files are somehow munged on your machine.
Look in /var/log/messages or /var/log/sysctl or wherever your logs are generated for systemd logging.
If you're unsure, you can determine log files in use by installing the inotify-tools package, then...
When systemd runs to start httpd, you'll see every log file touched in your first window's inotifywait output.
Look in /var/log/messages or /var/log/sysctl or wherever your logs are generated for systemd logging.
If you're unsure, you can determine log files in use by installing the inotify-tools package, then...
# in one window run...
inotifywait -mrq /var/log
# in another window run...
service httpd restart
When systemd runs to start httpd, you'll see every log file touched in your first window's inotifywait output.
If you've installed Distro packages, you'll normally find /var/log/httpd or /var/log/apache2 contains a file named error.log or something similar.
If you're running in some sort of shared hosting environment then, as Dr. Klahn mentioned, likely you'll have an error_log file somewhere.
Once you find your error log file, attach the entire file to this question. Also, if your system does file rotation also post the error.log.1 file, which will be the previous day's logs.