invoking.html revision 455a5f75c9935108a7ac1d50996f404e0553ac17
0N/A<!--%hypertext -->
2362N/A<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
0N/A<HTML>
0N/A<HEAD>
0N/A<TITLE>Starting Apache</TITLE>
0N/A</HEAD>
2362N/A
0N/A<BODY>
2362N/A<!--/%hypertext -->
0N/A
0N/A<h1>Starting Apache</h1>
0N/A<h2>Invoking Apache</h2>
0N/AThe <code>httpd</code> program is either invoked by the Internet
0N/Adaemon <code>inetd</code> each time a connection to the HTTP service is made,
0N/Aor alternatively it may run as a daemon which executes continuously, handling
0N/Arequests. Whatever method is chosen, the
0N/A<A HREF="core.html#servertype">ServerType</A> directive must be set
0N/Ato tell the server how it is to run.
0N/A
0N/A<h2>Command line options</h2>
2362N/AThe following options are recognised on the httpd command line:
2362N/A<dl>
2362N/A<dt><code>-d</code> <em>serverroot</em>
0N/A<dd>Set the initial value for the
0N/A<A HREF="core.html#serverroot">ServerRoot</A> variable to
0N/A<em>serverroot</em>. This can be overridden by the ServerRoot command in the
0N/Aconfiguration file. The default is <code>/usr/local/etc/httpd</code>.
0N/A
0N/A<dt><code>-f</code> <em>config</em>
0N/A<dd>Execute the commands in the file <em>config</em> on startup. If
0N/A<em>config</em> does not begin with a <code>/</code>, then it is taken to be a
0N/Apath relative to the <A HREF="core.html#serverroot">ServerRoot</A>. The
0N/Adefault is <code>conf/httpd.conf</code>.
0N/A
0N/A<dt><code>-X</code>
0N/A<dd>Run in single-process mode, for internal debugging purposes only; the
0N/Adaemon does not detach from the terminal or fork any children. Do <em>NOT</em>
0N/Ause this mode to provide ordinary web service.
0N/A
0N/A<dt><code>-v</code>
0N/A<dd>Print the version of httpd, and then exit.
0N/A
0N/A<dt><code>-?</code>
0N/A<dd>Print a list of the httpd options, and then exit.
0N/A</dl>
0N/A
0N/A<h2>Configuration files</h2>
0N/AThe server will read three files for configuration directives. Any directive
0N/Amay appear in any of these files. The the names of these files are taken
0N/Ato be relative to the server root; this is set by the
0N/A<A HREF="core.html#serverroot">ServerRoot</A> directive, or the
0N/A<code>-d</code> command line flag.
0N/A
0N/AConventionally, the files are:
0N/A<dl>
0N/A<dt><code>conf/httpd.conf</code>
0N/A<dd>Contains directives that control the operation of the server daemon.
0N/AThe filename may be overridden with the <code>-f</code> command line flag.
0N/A
0N/A<dt><code>conf/srm.conf</code>
0N/A<dd>Contains directives that control the specification of documents that
0N/Athe server can provide to clients. The filename may be overridden with
0N/Athe <A HREF="core.html#resourceconfig">ResourceConfig</A> directive.
0N/A
0N/A<dt><code>conf/acces.conf</code>
0N/A<dd>Contains directives that control access to documents.
0N/AThe filename may be overridden with the
0N/A<A HREF="core.html#accessconfig">AccessConfig</A> directive.
0N/A</dl>
0N/AHowever, these conventions need not be adhered to.
0N/A<p>
0N/AThe server also reads a file containing mime document types; the filename
0N/Ais set by the <A HREF="mod_mime.html#typesconfig">TypesConfig</A> directive,
0N/Aand is <code>conf/mime.types</code> by default.
0N/A
0N/A<h2>Log files</h2>
0N/A<h3>pid file</h3>
0N/AOn daemon startup, it saves the process id of the parent httpd process to
0N/Athe file <code>logs/httpd.pid</code>. This filename can be changed with the
0N/A<A HREF="core.html#pidfile">PidFile</A> directive. The process-id is for
0N/Ause by the administrator in restarting and terminating the daemon;
0N/AA HUP signal causes the daemon to re-read its configuration files and
0N/Aa TERM signal causes it to die gracefully.
0N/A<p>
0N/AIf the process dies (or is killed) abnormally, then it will be necessary to
0N/Akill the children httpd processes.
0N/A
0N/A<h3>Error log</h3>
0N/AThe server will log error messages to a log file, <code>logs/error_log</code>
0N/Aby default. The filename can be set using the
0N/A<A HREF="core.html#errorlog">ErrorLog</A> directive; different error logs can
0N/Abe set for different <A HREF="core.html#virtualhost">virtual hosts</A>.
0N/A
0N/A<h3>Transfer log</h3>
0N/AThe server will typically log each request to a transfer file,
0N/A<code>logs/access_log</code> by default. The filename can be set using a
0N/A<A HREF="mod_log_common.html#transferlog">TransferLog</A> directive; different
0N/Atransfer logs can be set for different <A HREF="core.html#virtualhost">virtual
0N/Ahosts</A>.
0N/A
0N/A<!--%hypertext -->
0N/A<hr>
0N/A<A HREF="../"><IMG SRC="/images/apache_home.gif" ALT="Home"></A>
0N/A<A HREF="./"><IMG SRC="/images/apache_index.gif" ALT="Index"></A>
0N/A
0N/A</BODY>
0N/A</HTML>
0N/A<!--/%hypertext -->
0N/A