Link to home
Start Free TrialLog in
Avatar of Y I
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/httpd.service; 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.
ASKER CERTIFIED SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Which logs you check will vary in name, based on your Distro + if you're using your Distro's actual Apache package or you've done a source build.

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.
Avatar of Y I
Y I

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

# in one window run...
inotifywait -mrq /var/log

# in another window run...
service httpd restart

Open in new window


When systemd runs to start httpd, you'll see every log file touched in your first window's inotifywait output.