invoking.html.en revision f9d0a44040161ca12e6d1bfb1c32b00747f02749
32N/A<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
32N/A<HTML>
493N/A<HEAD>
32N/A<TITLE>Starting Apache</TITLE>
32N/A</HEAD>
32N/A
32N/A<BODY>
32N/A<!--#include virtual="header.html" -->
32N/A<h1>Starting Apache</h1>
32N/A
32N/A<h2>Invoking Apache</h2>
32N/AThe <code>httpd</code> program is usually run as a daemon which executes
32N/Acontinuously, handling requests. It is possible to invoke Apache by
32N/Athe Internet daemon <code>inetd</code> each time a connection to the HTTP
32N/Aservice is made (use the
32N/A<A HREF="mod/core.html#servertype">ServerType</A> directive)
32N/Abut this is not recommended.
32N/A
32N/A<h2>Command line options</h2>
32N/AThe following options are recognised on the httpd command line:
32N/A<dl>
32N/A<dt><code>-d</code> <em>serverroot</em>
32N/A<dd>Set the initial value for the
32N/A<A HREF="mod/core.html#serverroot">ServerRoot</A> variable to
32N/A<em>serverroot</em>. This can be overridden by the ServerRoot command in the
32N/Aconfiguration file. The default is <code>/usr/local/etc/httpd</code>.
32N/A
32N/A<dt><code>-f</code> <em>config</em>
32N/A<dd>Execute the commands in the file <em>config</em> on startup. If
32N/A<em>config</em> does not begin with a <code>/</code>, then it is taken to be a
493N/Apath relative to the <A HREF="mod/core.html#serverroot">ServerRoot</A>. The
32N/Adefault is <code>conf/httpd.conf</code>.
32N/A
32N/A<dt><code>-X</code>
493N/A<dd>Run in single-process mode, for internal debugging purposes only; the
32N/Adaemon does not detach from the terminal or fork any children. Do <em>NOT</em>
32N/Ause this mode to provide ordinary web service.
493N/A
32N/A<dt><code>-v</code>
32N/A<dd>Print the version of httpd, and then exit.
32N/A
32N/A<dt><a name="help"><code>-h</code></a>
32N/A<dd>Give a list of directives together with expected arguments and
32N/Aplaces where the directive is valid
<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
<A HREF="mod/core.html#serverroot">ServerRoot</A> directive, or the
<code>-d</code> command line flag.
Conventionally, the files are:
<dl>
<dt><code>conf/httpd.conf</code>
<dd>Contains directives that control the operation of the server daemon.
The filename may be overridden with the <code>-f</code> command line flag.
<dt><code>conf/srm.conf</code>
<dd>Contains directives that control the specification of documents that
the server can provide to clients. The filename may be overridden with
the <A HREF="mod/core.html#resourceconfig">ResourceConfig</A> directive.
<dt><code>conf/acces.conf</code>
<dd>Contains directives that control access to documents.
The filename may be overridden with the
<A HREF="mod/core.html#accessconfig">AccessConfig</A> directive.
</dl>
However, these conventions need not be adhered to.
<p>
The server also reads a file containing mime document types; the filename
is set by the <A HREF="mod_mime.html#typesconfig">TypesConfig</A> directive,
and is <code>conf/mime.types</code> by default.
<h2>Log files</h2>
<h3>pid file</h3>
On daemon startup, it 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;
A HUP signal causes the daemon to re-read its configuration files and
a TERM signal causes it to die gracefully.
<p>
If the process dies (or is killed) abnormally, then it will be necessary to
kill the children httpd processes.
<h3>Error log</h3>
The server will log error messages to a log file, <code>logs/error_log</code>
by default. 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>
The server will typically log each request to a transfer file,
<code>logs/access_log</code> by default. The filename can be set using a
<A HREF="mod/mod_log_common.html#transferlog">TransferLog</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>