An example of Apache fault solution

Source: Internet
Author: User
Tags apache error log
An example of how to solve Apache faults-Linux Enterprise Application-Linux server application information. The following is a detailed description. Fault description: on a server, start the apache process as a wacos user and immediately use the command ps? Ef | grep httpd can see that a process is started, but an error will be reported when you access the web interface later. Then run the command ps? Ef | grep httpd: process 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, and immediately use the command ps? Ef | grep httpd can see that a process is started, but an error will be reported when you access the web interface later. Then run the command ps? Ef | grep httpd: process 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 ). So two login windows are opened, and one window is run with tail? F error_log monitors the output of error log files, and starts apache services in another window.
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 to use ls? L httpd. pid check the properties of the httpd. pid file and find the properties of the file 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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.