invoking.html.en revision 6da353b1fd3b5e77b8c7b5cbffd8beb61e68e917
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Starting Apache</TITLE>
</HEAD>
<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
<BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#000080"
ALINK="#FF0000"
>
<!--#include virtual="header.html" -->
<h1 ALIGN="CENTER">Starting Apache</h1>
<h2>Invoking Apache</h2>
The <code>httpd</code> program is usually run as a daemon which executes
continuously, handling requests. It is possible to invoke Apache by
the Internet daemon <code>inetd</code> each time a connection to the HTTP
service is made (use the
but this is not recommended.
<h2>Command line options</h2>
The following options are recognized on the httpd command line:
<dl>
<dt><code>-d</code> <em>serverroot</em>
<dd>Set the initial value for the
<em>serverroot</em>. This can be overridden by the ServerRoot command in the
<dt><code>-f</code> <em>config</em>
<dd>Execute the commands in the file <em>config</em> on startup. If
<em>config</em> does not begin with a <code>/</code>, then it is taken to be a
<dt><code>-X</code>
<dd>Run in single-process mode, for internal debugging purposes only; the
daemon does not detach from the terminal or fork any children. Do <em>NOT</em>
use this mode to provide ordinary web service.
<dt><code>-v</code>
<dd>Print the version of httpd, and then exit.
<dt><a name="help"><code>-h</code></a>
<dd>Give a list of directives together with expected arguments and
places where the directive is valid. (New in Apache 1.2)
<dt><code>-l</code>
<dd>Give a list of all modules compiled into the server.
<dt><code>-?</code>
<dd>Print a list of the httpd options, and then exit.
</dl>
<h2>Configuration files</h2>
The server will read three files for configuration directives. Any directive
may appear in any of these files. The the names of these files are taken
to be relative to the server root; this is set by the
<code>-d</code> command line flag.
Conventionally, the files are:
<dl>
<dd>Contains directives that control the operation of the server daemon.
The filename may be overridden with the <code>-f</code> command line flag.
<dd>Contains directives that control the specification of documents that
the server can provide to clients. The filename may be overridden with
<dd>Contains directives that control access to documents.
The filename may be overridden with the
</dl>
However, these conventions need not be adhered to.
<p>
The server also reads a file containing mime document types; the filename
<h2>Log files</h2>
<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
document for details.
<h3>pid file</h3>
On daemon startup, it saves the process id of the parent httpd process to
use by the administrator in restarting and terminating the daemon;
A HUP or USR1 signal causes the daemon to re-read its configuration files and
a TERM signal causes it to die gracefully. For more information
<p>
If the process dies (or is killed) abnormally, then it will be necessary to
kill the children httpd processes.
<h3>Error log</h3>
by default. The filename can be set using the
<h3>Transfer log</h3>
The server will typically log each request to a transfer file,
hosts</A>.
<!--#include virtual="footer.html" -->
</BODY>
</HTML>