switch to a 60 bit hash
[httpd-crcsyncproxy.git] / docs / manual / invoking.html.en
blob559bbbcc12fe6f730312f832c1212d0894b845b5
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7 -->
8 <title>Starting Apache - Apache HTTP Server</title>
9 <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="./images/favicon.ico" rel="shortcut icon" /></head>
13 <body id="manual-page"><div id="page-header">
14 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="./faq/">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p>
15 <p class="apache">Apache HTTP Server Version 2.3</p>
16 <img alt="" src="./images/feather.gif" /></div>
17 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
18 <div id="path">
19 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.3</a></div><div id="page-content"><div id="preamble"><h1>Starting Apache</h1>
20 <div class="toplang">
21 <p><span>Available Languages: </span><a href="./de/invoking.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
22 <a href="./en/invoking.html" title="English">&nbsp;en&nbsp;</a> |
23 <a href="./es/invoking.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
24 <a href="./fr/invoking.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
25 <a href="./ja/invoking.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
26 <a href="./ko/invoking.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
27 <a href="./tr/invoking.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
28 </div>
30 <p>On Windows, Apache is normally run as a service on Windows
31 NT, 2000 and XP, or as a console application on Windows 9x and
32 ME. For details, see <a href="platform/windows.html#winsvc">Running Apache as a Service</a>
33 and <a href="platform/windows.html#wincons">Running Apache as a
34 Console Application</a>.</p>
36 <p>On Unix, the <code class="program"><a href="./programs/httpd.html">httpd</a></code> program
37 is run as a daemon that executes continuously in the
38 background to handle requests. This document describes how
39 to invoke <code class="program"><a href="./programs/httpd.html">httpd</a></code>.</p>
40 </div>
41 <div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#startup">How Apache Starts</a></li>
42 <li><img alt="" src="./images/down.gif" /> <a href="#errors">Errors During Start-up</a></li>
43 <li><img alt="" src="./images/down.gif" /> <a href="#boot">Starting at Boot-Time</a></li>
44 <li><img alt="" src="./images/down.gif" /> <a href="#info">Additional Information</a></li>
45 </ul><h3>See also</h3><ul class="seealso"><li><a href="stopping.html">Stopping and Restarting</a></li><li><code class="program"><a href="./programs/httpd.html">httpd</a></code></li><li><code class="program"><a href="./programs/apachectl.html">apachectl</a></code></li></ul></div>
46 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
47 <div class="section">
48 <h2><a name="startup" id="startup">How Apache Starts</a></h2>
50 <p>If the <code class="directive"><a href="./mod/mpm_common.html#listen">Listen</a></code>
51 specified in the configuration file is default of 80 (or any other
52 port below 1024), then it is necessary to have root privileges in
53 order to start apache, so that it can bind to this privileged
54 port. Once the server has started and performed a few preliminary
55 activities such as opening its log files, it will launch several
56 <em>child</em> processes which do the work of listening for and
57 answering requests from clients. The main <code>httpd</code>
58 process continues to run as the root user, but the child processes
59 run as a less privileged user. This is controlled by the selected
60 <a href="mpm.html">Multi-Processing Module</a>.</p>
62 <p>The recommended method of invoking the <code class="program"><a href="./programs/httpd.html">httpd</a></code>
63 executable is to use the <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> control script. This
64 script sets certain environment variables that are necessary for
65 <code class="program"><a href="./programs/httpd.html">httpd</a></code> to function correctly under some operating
66 systems, and then invokes the <code class="program"><a href="./programs/httpd.html">httpd</a></code> binary.
67 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> will pass through any command line
68 arguments, so any <code class="program"><a href="./programs/httpd.html">httpd</a></code> options may also be used with
69 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code>. You may also directly edit the
70 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> script by changing the <code>HTTPD</code>
71 variable near the top to specify the correct location of the
72 <code class="program"><a href="./programs/httpd.html">httpd</a></code> binary and any command-line arguments that you
73 wish to be <em>always</em> present.</p>
75 <p>The first thing that <code class="program"><a href="./programs/httpd.html">httpd</a></code> does when it is
76 invoked is to locate and read the <a href="configuring.html">configuration file</a>
77 <code>httpd.conf</code>. The location of this file is set at
78 compile-time, but it is possible to specify its location at run
79 time using the <code>-f</code> command-line option as in</p>
81 <div class="example"><p><code>/usr/local/apache2/bin/apachectl -f
82 /usr/local/apache2/conf/httpd.conf</code></p></div>
84 <p>If all goes well during startup, the server will detach from
85 the terminal and the command prompt will return almost
86 immediately. This indicates that the server is up and running.
87 You can then use your browser to connect to the server and view
88 the test page in the <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> directory.</p>
89 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
90 <div class="section">
91 <h2><a name="errors" id="errors">Errors During Start-up</a></h2>
93 <p>If Apache suffers a fatal problem during startup, it will
94 write a message describing the problem either to the console or
95 to the <code class="directive"><a href="./mod/core.html#errorlog">ErrorLog</a></code> before
96 exiting. One of the most common error messages is "<code>Unable
97 to bind to Port ...</code>". This message is usually caused by
98 either:</p>
100 <ul>
101 <li>Trying to start the server on a privileged port when not
102 logged in as the root user; or</li>
104 <li>Trying to start the server when there is another instance
105 of Apache or some other web server already bound to the same
106 Port.</li>
107 </ul>
109 <p>For further trouble-shooting instructions, consult the
110 Apache <a href="faq/">FAQ</a>.</p>
111 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
112 <div class="section">
113 <h2><a name="boot" id="boot">Starting at Boot-Time</a></h2>
115 <p>If you want your server to continue running after a system
116 reboot, you should add a call to <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> to your
117 system startup files (typically <code>rc.local</code> or a file in
118 an <code>rc.N</code> directory). This will start Apache as
119 root. Before doing this ensure that your server is properly
120 configured for security and access restrictions.</p>
122 <p>The <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> script is designed to act like a
123 standard SysV init script; it can take the arguments
124 <code>start</code>, <code>restart</code>, and <code>stop</code>
125 and translate them into the appropriate signals to
126 <code class="program"><a href="./programs/httpd.html">httpd</a></code>. So you can often simply link
127 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> into the appropriate init directory. But be
128 sure to check the exact requirements of your system.</p>
129 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
130 <div class="section">
131 <h2><a name="info" id="info">Additional Information</a></h2>
133 <p>Additional information about the command-line options of <code class="program"><a href="./programs/httpd.html">httpd</a></code> and <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> as well as other support
134 programs included with the server is available on the
135 <a href="programs/">Server and Supporting Programs</a> page.
136 There is also documentation on all the <a href="mod/">modules</a> included with the Apache distribution
137 and the <a href="mod/directives.html">directives</a> that they
138 provide.</p>
139 </div></div>
140 <div class="bottomlang">
141 <p><span>Available Languages: </span><a href="./de/invoking.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
142 <a href="./en/invoking.html" title="English">&nbsp;en&nbsp;</a> |
143 <a href="./es/invoking.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
144 <a href="./fr/invoking.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
145 <a href="./ja/invoking.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
146 <a href="./ko/invoking.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
147 <a href="./tr/invoking.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
148 </div><div id="footer">
149 <p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
150 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="./faq/">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div>
151 </body></html>