Apache Log Files

Apache includes two log files by default. The access_log file is used to track client requests. The error_log is used to record important events, such as errors or server restarts. These files don't exist until you start Apache for the first time. The files are named access.log and error.log in Windows platforms.

access_log

When a client requests a file from the server, Apache records several parameters associated with the request, including the IP address of the client, the document requested, the HTTP status code, and the current time. Listing 2.5 shows sample log file entries. Hour 17, "Logging and Monitoring Server Activity," will show you how to modify which parameters are logged.

Listing 2.5 Sample access_log Entries
   1: 127.0.0.1 - - [01/Sep/2002:09:43:37 -0700] "GET / HTTP/1.1" 200 1494   2: 127.0.0.1 - - [01/Sep/2002:09:43:40 -0700] "GET /manual/ HTTP/1.1" 200 10383 

error_log

This file includes error messages, startup messages, and any other significant events in the life cycle of the server. This is the first place to look when you have a problem with Apache. Listing 2.6 shows sample error_log entries.

Listing 2.6 Sample error_log Entries
   1: [Sun Sep 01 09:42:59 2002] [notice] Parent: Created child process -2245   2: [Sun Sep 01 09:42:59 2002] [notice] Child -2242: Child process is running   3: [Sun Sep 01 09:42:59 2002] [notice] Child -2242: Acquired the start mutex.   4: [Sun Sep 01 09:42:59 2002] [notice] Child -2242: Starting 250 worker threads. 

Additional Files

The httpd.pid file contains the process ID of the running Apache server. You can use this number to send signals to Apache manually, as described in the next section.

The scoreboard file, present on Linux/Unix Apache, is used by the process-based MPMs to communicate with their children.

In general, you do not need to worry about these files.



Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
ISBN: 067232489X
EAN: 2147483647
Year: 2005
Pages: 263

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net