invoking.html revision 581d30ba070dbab2ae9db00315908259540f499d
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<HTML>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<HEAD>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<TITLE>Starting Apache</TITLE>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov</HEAD>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<BODY
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov BGCOLOR="#FFFFFF"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov TEXT="#000000"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov LINK="#0000FF"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov VLINK="#000080"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov ALINK="#FF0000"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<!--#include virtual="header.html" -->
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<H1 ALIGN="CENTER">Starting Apache</H1>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<H2>Invoking Apache</H2>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovOn Unix, the <CODE>httpd</CODE> program is usually run as a daemon
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovwhich executes continuously, handling requests. It is possible to
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovinvoke Apache by the Internet daemon <CODE>inetd</CODE> each time a
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovconnection to the HTTP service is made (use the <A
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovHREF="mod/core.html#servertype">ServerType</A> directive) but this is
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovnot recommended.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<P>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovOn Windows, Apache is normally run as a service on Windows NT, or as a
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovconsole application on Windows 95. See also <A
acf7cee13f07b368b0ccae69776309f7f69cbca1Jakub HrozekHREF="platform/windows.html#run">running Apache for Windows</A>.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<H2>Command line options</H2>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovThe following options are recognized on the httpd command line:
09365a02c9ff68f16227b69a348511bb584060bcLukas Slebodnik<DL>
09365a02c9ff68f16227b69a348511bb584060bcLukas Slebodnik<DT><CODE>-d</CODE> <EM>serverroot</EM>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<DD>Set the initial value for the
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<A HREF="mod/core.html#serverroot">ServerRoot</A> variable to
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<EM>serverroot</EM>. This can be overridden by the ServerRoot command
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnikin the configuration file. The default is
6698d40512e55e7c2d03e14c227c51b1edc77ffaPavel Březina<CODE>/usr/local/apache</CODE> on Unix, <CODE>/apache</CODE> on
0700118d8388c38b8cb28279510b206b76a3a411Jakub HrozekWindows and <CODE>/os2httpd</CODE> on OS/2.
0700118d8388c38b8cb28279510b206b76a3a411Jakub Hrozek
0700118d8388c38b8cb28279510b206b76a3a411Jakub Hrozek<DT><CODE>-D</CODE> <EM>name</EM>
0700118d8388c38b8cb28279510b206b76a3a411Jakub Hrozek<DD>Define a name for use in in
0700118d8388c38b8cb28279510b206b76a3a411Jakub Hrozek<A HREF="mod/core.html#ifdefine">IfDefine</A> directives.
0700118d8388c38b8cb28279510b206b76a3a411Jakub HrozekThis option can be used to optionally enable certain functionality in the
0700118d8388c38b8cb28279510b206b76a3a411Jakub Hrozekconfiguration file, or to use a common configuration for
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovseveral independent hosts, where host specific information is enclosed in
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov&lt;IfDefine&gt; sections.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
09365a02c9ff68f16227b69a348511bb584060bcLukas Slebodnik<DT><CODE>-f</CODE> <EM>config</EM>
09365a02c9ff68f16227b69a348511bb584060bcLukas Slebodnik<DD>Execute the commands in the file <EM>config</EM> on startup. If
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnik<EM>config</EM> does not begin with a <CODE>/</CODE>, then it is taken to be a
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnikpath relative to the <A HREF="mod/core.html#serverroot">ServerRoot</A>. The
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnikdefault is <CODE>conf/httpd.conf</CODE>.
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnik
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov<DT><CODE>-C</CODE> <EM>"directive"</EM>
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov<DD>Process the given apache "directive" (just as if it had been part of a
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovconfiguration file) <STRONG>before</STRONG> actually reading the regular configuration files.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
<DT><CODE>-c</CODE> <EM>"directive"</EM>
<DD>Process the given apache "directive" <STRONG>after</STRONG> reading
all the regular configuration files.
<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
build date, and a list of compile time settings which influence the
behavior and performance of the apache server (<EM>e.g.</EM>,
<SAMP>-DUSE_MMAP_FILES</SAMP>),
then exit.
<DT><A NAME="help"><CODE>-L</CODE></A>
<DD>
Give a list of directives together with expected arguments and places
where the directive is valid, then exit. (Apache 1.3.4 and
later. Earlier versions used -l instead).
<DT><CODE>-l</CODE></A>
<DD>
Give a list of all modules compiled into the server, then exit.
(Apache 1.3.4 and later. Earlier versions used -h instead).<br>
Give a list of directives together with expected arguments and places
where the directive is valid, then exit. (Apache 1.2 to 1.3.3. Later
versions use -L instead).
<DT><CODE>-h</CODE>
<DD>
Print a list of the httpd options, then exit. (Apache 1.3.4 and
later. Earlier versions used -? instead).<br>
Give a list of all modules compiled into the server, then exit. (Up to
Apache 1.3.3. Later versions use -l instead).<br>
<DT><CODE>-S</CODE>
<DD>Show the settings as parsed from the config file (currently only
shows a breakdown of the vhost settings) but do not start the
server. (Up to Apache 1.3.3, this option also started the server).
<DT><CODE>-t</CODE>
<DD>Test the configuration file syntax (<EM>i.e.</EM>, read all configuration files
and interpret them) but do not start the server. If the configuration contains
errors, display an error message and exit with a non-zero exit status,
otherwise display "Syntax OK" and terminate with a zero exit status. This
command checks to see if all DocumentRoot entries exist and are directories.
For sites with many vhosts, this is expensive; consider the <CODE>-T</CODE>
command instead.
<DT><CODE>-T</CODE>
<DD>Test the configuration file syntax (<EM>i.e.</EM>, read all configuration files
and interpret them) but do not start the server. If the configuration contains
errors, display an error message and exit with a non-zero exit status,
otherwise display "Syntax OK" and terminate with a zero exit status. This
command does not perform any checking of the DocumentRoot entries.
<DT><CODE>-k</CODE> <EM>option</EM>
<DD>Windows only: signal Apache to restart or shutdown. <EM>option</EM>
is one of "shutdown" or "restart". (Apache 1.3.3 and later).
<DT><CODE>-?</CODE>
<DD>Print a list of the httpd options, and then exit (up to Apache
1.3.3. Later version use -h instead).
</DL>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>