summaryrefslogtreecommitdiff
path: root/docs/manual/invoking.html
blob: 9299ff9aad60d9a39266325cc86a89eeaed7be2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!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>

On Unix, 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 <A
HREF="mod/core.html#servertype">ServerType</A> directive) but this is
not recommended.

<P>

On Windows, Apache is normally run as a service on Windows NT, or as a
console application on Windows 95. See also <A
HREF="platform/windows.html#run">running Apache for Windows</A>.

<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
<A HREF="mod/core.html#serverroot">ServerRoot</A> variable to
<EM>serverroot</EM>. This can be overridden by the ServerRoot command
in the configuration file. The default is
<CODE>/usr/local/apache</CODE> on Unix, <CODE>/apache</CODE> on
Windows and <CODE>/os2httpd</CODE> on OS/2.

<DT><CODE>-D</CODE> <EM>name</EM>
<DD>Define a name for use in in 
<A HREF="mod/core.html#ifdefine">IfDefine</A> directives.
This option can be used to optionally enable certain functionality in the
configuration file, or to use a common configuration for
several independent hosts, where host specific information is enclosed in
&lt;IfDefine&gt; sections.

<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
path relative to the <A HREF="mod/core.html#serverroot">ServerRoot</A>. The
default is <CODE>conf/httpd.conf</CODE>.

<DT><CODE>-C</CODE> <EM>"directive"</EM>
<DD>Process the given apache "directive" (just as if it had been part of a
configuration file) <STRONG>before</STRONG> actually reading the regular configuration files.

<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>