invoking.html.en revision 25503838e438bb909e3ff880125732c7ed5e64ad
<!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 its build date, and then exit.
<DT><A name="version"><CODE>-V</CODE></A>
<DD>Print the base version of httpd, its sub-version if defined, its
build date, and a list of compile time settings which influence the
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>