A case of Apache fault resolution

Source: Internet
Author: User
Tags apache error log interface log
apache| Resolve the Symptom:
On a single server, start the Apache process with the Wacos user, and use the command immediately after startup Ps–ef | The grep httpd can see that a process is started, but a later access to the Web interface will make an error, and then use the command Ps–ef | grep httpd, the discovery process has been down.
After you ask the onsite engineer what you have done, you know that the service port has been rebind before.
Check 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 single server, start the Apache process with the Wacos user, and use the command immediately after startup Ps–ef | The grep httpd can see that a process is started, but a later access to the Web interface will make an error, and then use the command Ps–ef | grep httpd, the discovery process has been down.
After you ask the onsite engineer what you have done, you know that the service port has been rebind before.
Check 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?

Suspected to be related to Apache's PID record file or configuration file (since the site changed Apache's listening port). Then open two login windows, one window with tail–f error_log monitor error log file output, another window to start Apache service.
After starting Apache, the error log file is found to output the following:
[Thu June 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:could not log pid to File/opt/wacos/tools/apache/logs/httpd.pid

Go to/opt/wacos/tools/apache/logs use the Ls–l httpd.pid to check the properties of the Httpd.pid file, and find the properties of the file as follows:
-rw-r--r--1 Root Others 4 June 14:58 Httpd.pid
The owner is root and does not release write permission to other users, and the Wacos user initiates the Apache,apache attempt to overwrite httpd.pid file, it will surely fail. This file records the Apache-initiated process identifier (pid,process ID), which has an important effect on the HTTPD service, so the httpd process will certainly quit.

Failure Analysis:
It is estimated that there are related personnel in the day-to-day maintenance, using the root user to start Apache, Causes the owner of the Httpd.pid file to become root, causing the Wacos user to start Apache later, Apache will attempt to write httpd.pid to record its own PID process number, but because Httpd.pid current owner is root uses Wacos user to modify HTTPD.P The ID file will definitely fail.

Fault handling:
After locating the problem, 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.

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.