Commit acde8540 authored by Joshua Slive's avatar Joshua Slive
Browse files

Eliminate duplicate info and add references to logs.html.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90068 13f79535-47bb-0310-9956-ffa450edef68
parent 50d0d2d7
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
<li><a href="#modules">Modules</a></li>
<li><a href="#scope">Scope of Directives</a></li>
<li><a href="#htaccess">.htaccess Files</a></li>
<li><a href="#logs">Log Files</a></li>
</ul>

<hr>
@@ -196,53 +195,6 @@ configuring the <A
HREF="mod/core.html#allowoverride"><CODE>AllowOverride</CODE></A>
directive in the main configuration files.

<hr>

<H2><a name="logs">Log files</a></H2>
<!-- XXX: This section should be moved to its own file -->
<H3>security warning</H3>
Anyone who can write to the directory where Apache is writing a
log file can almost certainly gain access to the uid that the server is
started as, which is normally root.  Do <EM>NOT</EM> give people write
access to the directory the logs are stored in without being aware of
the consequences; see the <A HREF="misc/security_tips.html">security tips</A>
document for details.

<H3>pid file</H3>

<P>On startup, Apache saves the process id of the parent httpd process to
the file <CODE>logs/httpd.pid</CODE>. This filename can be changed
with the <A HREF="mod/core.html#pidfile">PidFile</A> directive. The
process-id is for use by the administrator in restarting and
terminating the daemon: on Unix, a HUP or USR1 signal causes the
daemon to re-read its configuration files and a TERM signal causes it
to die gracefully; on Windows, use the -k command line option instead.
For more information see the <A HREF="stopping.html">Stopping and
Restarting</A> page.

<P>
If the process dies (or is killed) abnormally, then it will be necessary to
kill the children httpd processes.

<H3>Error log</H3>

<P>The server will log error messages to a log file, by default
<CODE>logs/error_log</CODE> on Unix or <CODE>logs/error.log</CODE> on
Windows and OS/2. The filename can be set using the <A
HREF="mod/core.html#errorlog">ErrorLog</A> directive; different error
logs can be set for different <A
HREF="mod/core.html#virtualhost">virtual hosts</A>.

<H3>Transfer log</H3>

<P>The server will typically log each request to a transfer file, by
default <CODE>logs/access_log</CODE> on Unix or
<CODE>logs/access.log</CODE> on Windows and OS/2. The filename can be
set using a <A HREF="mod/mod_log_config.html#customlog">CustomLog</A>
directive; different transfer logs can be set for different <A
HREF="mod/core.html#virtualhost">virtual hosts</A>.


<!--#include virtual="footer.html" -->
</BODY>
</HTML>
+2 −1
Original line number Diff line number Diff line
@@ -747,7 +747,8 @@ document for details on why your security could be compromised if
the directory where logfiles are stored is writable by anyone other
than the user that starts the server.

<P><STRONG>See also:</STRONG> <A HREF="#loglevel">LogLevel</A>
<P><STRONG>See also:</STRONG> <A HREF="#loglevel">LogLevel</A> and
<a href="../logs.html">Apache Log Files</a>
<P><HR>

<H2><A NAME="files">&lt;Files&gt; directive</A></H2>
+3 −93
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ be used multiple times in each server to cause each request to be
logged to multiple files.
</P>

<p>See also: <a href="../logs.html">Apache Log Files</a>.</p>

<H2>Directives</H2>

<UL>
@@ -62,57 +64,7 @@ logged to multiple files.
<LI><A HREF="#transferlog">TransferLog</A></LI>
</UL>

<H2>Log File Formats</H2>

<p>Unless told otherwise with <TT>LogFormat</TT>, the log files
created by <TT>TransferLog</TT> will be in standard "Common Log
Format" (CLF). The contents of each line in a CLF file are explained
below. Alternatively, the log file can be customized (and if multiple
log files are used, each can have a different format). Custom formats
are set with <CODE>LogFormat</CODE> and <CODE>CustomLog</CODE>.</p>

<H3>Common Log Format</H3>

<p>The Common Log Format (CLF) file contains a separate line for each
request. A line is composed of several tokens separated by spaces:</p>

<BLOCKQUOTE>
host ident authuser date request status bytes
</BLOCKQUOTE>
If a token does not have a value then it is represented by a hyphen (-).
The meanings and values of these tokens are as follows:
<DL>
<DT>host
<DD>The fully-qualified domain name of the client, or its IP number if the
name is not available.
<DT>ident
<DD>If <A HREF="core.html#identitycheck">IdentityCheck</A> is enabled and the
client machine runs identd, then this is the identity information reported
by the client.
<DT>authuser
<DD>If the request was for an password protected document, then this is
the userid used in the request.
<DT>date
<DD>The date and time of the request, in the following format:
<DL><DD><BLOCKQUOTE><CODE> date = [day/month/year:hour:minute:second zone] <BR>
day = 2*digit<BR>
month = 3*letter<BR>
year = 4*digit<BR>
hour = 2*digit<BR>
minute = 2*digit<BR>
second = 2*digit<BR>
zone = (`+' | `-') 4*digit</CODE></BLOCKQUOTE></DL>
<DT>request
<DD>The request line from the client, enclosed in double quotes
(<CODE>&quot;</CODE>).
<DT>status
<DD>The three digit status code returned to the client.
<DT>bytes
<DD>The number of bytes in the object returned to the client, not including
any headers.
</DL>

<H3><A NAME="formats">Custom Log Formats</A></H3>
<H2><A NAME="formats">Custom Log Formats</A></H2>

<p>The format argument to the <CODE>LogFormat</CODE> and
<CODE>CustomLog</CODE> directives is a string. This string is logged
@@ -210,24 +162,6 @@ otherwise log analysis programs would have to duplicate the entire
vhost matching algorithm in order to decide what host really served
the request.</p>

<H2>Using Multiple Log Files</H2>

<p>The <CODE>TransferLog</CODE> and <CODE>CustomLog</CODE> directives can
be given more than once to log requests to multiple log files. Unless
the conditional form of <code>CustomLog</code> is used, each
request will be logged to all the log files defined by either of these
directives.</p>

<H3>Use with Virtual Hosts</H3>

<p>If a &lt;VirtualHost&gt; section does not contain any
<TT>TransferLog</TT> or <TT>CustomLog</TT> directives, the
logs defined for the main server will be used. If it does
contain one or more of these directives, requests serviced by
this virtual host will only be logged in the log files defined
within its definition, not in any of the main server's log files.
See the examples below.</p>

<H2>Security Considerations</H2>

<p>See the <A HREF="../misc/security_tips.html#serverroot">security tips</A>
@@ -235,30 +169,6 @@ document for details on why your security could be compromised if the
directory where logfiles are stored is writable by anyone other than
the user that starts the server.</p>

<h2>Resetting the Log Files</h2>

<p>The access log file typically grows 1MB or more for each 10,000
requests.  It will probably be necessary to move or delete the log
file on a regular basis.  This cannot be done while the server is
still running, because Apache will continue writing to the old log
file.  Instead, the server must be <a
href="../stopping.html">restarted</a> after the log file is moved or
deleted so that it will open a new log.</p>

<p>A typical scenario is:</p>

<pre>
   mv access_log access_log.old
   apachectl graceful
   # wait for all requests to the old server to complete
   # before doing anything with access_log.old
</pre>

<p>Alternatively, log files can be <a
href="../misc/FAQ.html#rotate">rotated automatically</a> be writing
them through a pipe to a program designed for that purpose such
as <a href="../programs/rotatelogs.html">rotatelogs</a>.</p>

<HR>