Fault symptom:
On a server, start the Apache process as a wacos user. After the startup, run the command PS-Ef | grep httpd to check that a process is started. However, an error is reported when you access the Web interface, run the PS-Ef | grep httpd command to find that the process is down.
After inquiring about the operations performed by the on-site engineer, we learned that the Service port was re-bound.
Check the Apache Error Log File error_log and find the following alarms:
[Warn] PID file/opt/wacos/tools/Apache/logs/httpd. PID overwritten -- unclean shutdown of previous Apache run?
Fault description:
On a server, start the Apache process as a wacos user. After the startup, run the command PS-Ef | grep httpd to check that a process is started. However, an error is reported when you access the Web interface, run the PS-Ef | grep httpd command to find that the process is down.
After inquiring about the operations performed by the on-site engineer, we learned that the Service port was re-bound.
Check the Apache Error Log File error_log and find the following alarms:
[Warn] PID file/opt/wacos/tools/Apache/logs/httpd. PID overwritten -- unclean shutdown of previous Apache run?
It is suspected that it is related to the Apache PID record file or configuration file (because the Apache listening port is modified on site ). Therefore, two Logon Windows are opened. One window uses tail-F error_log to monitor the output of error log files, and the other window starts Apache services.
After Apache is started, the following error log files are output:
[Thu Jun 24 21:54:27 2004] [warn] PID file/opt/wacos/tools/Apache/logs/httpd. PID overwritten -- unclean shutdown of previous Apache run?
Fopen: Permission denied
Httpd: cocould not log PID to file/opt/wacos/tools/Apache/logs/httpd. PID
Go to/opt/wacos/tools/Apache/logs and use LS-l httpd. PID to check the properties of the httpd. PID file. The properties of the file are as follows:
-RW-r -- 1 root others 4 Jun 25 14:58 httpd. PID
The owner is root, and the write permission is not granted to other users. When you use wacos to start Apache and Apache tries to rewrite the httpd. PID file, it will certainly fail. This file records the process ID (PID, process ID) after Apache is started, which plays an important role in the HTTPd service, so that the HTTPd process will certainly exit.
Fault analysis:
It is estimated that there are related personnel who use the root user to start Apache during routine maintenance, resulting in httpd. the owner of the PID file becomes root. As a result, Apache will try to write httpd when you start Apache using wacos. PID to record its own PID process number, but because of httpd. the current PID owner is the root user who uses wacos to modify httpd. the PID file will certainly fail.
Troubleshooting:
After the problem is located, the following solution is used.
Go to the/opt/wacos/tools/Apache/logs directory and delete the httpd. PID file. Then restart Apache with the wacos user and start Apache successfully.