invoking.html.en revision a01a25d738ef02bac5955f731e88bd05b0d59314
7238b345c345cb79d81cf01fedc311bff001444ctrawick<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
d8ed1028025480c672d9dc7266b54ac853bbb999trawick XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
d8ed1028025480c672d9dc7266b54ac853bbb999trawick This file is generated from xml source: DO NOT EDIT
1b92a71f5cbda8da4aa13af1034aab30b85bcd99minfrin XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
c8d61b81105661b9ba169482e418929fcf0cfec4trawick<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
87a87c1e1afc7eb004bc10594a9de98411866a20jerenkrantz<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb<link href="/images/favicon.ico" rel="shortcut icon" /></head>
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb<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>
4b34d6a5b70303010612df6c87da3ee91ae86078rbb<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
4b34d6a5b70303010612df6c87da3ee91ae86078rbb<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="./">Version 2.1</a></div><div id="page-content"><div id="preamble"><h1>Starting Apache</h1>
1b92a71f5cbda8da4aa13af1034aab30b85bcd99minfrin <p>On Windows, Apache is normally run as a service on Windows
1b92a71f5cbda8da4aa13af1034aab30b85bcd99minfrin NT, 2000 and XP, or as a console application on Windows 9x and
1b92a71f5cbda8da4aa13af1034aab30b85bcd99minfrin ME. For details, see <a href="platform/windows.html#winsvc">Running Apache as a Service</a>
1b92a71f5cbda8da4aa13af1034aab30b85bcd99minfrin and <a href="platform/windows.xml#wincons">Running Apache as a
1b92a71f5cbda8da4aa13af1034aab30b85bcd99minfrin <p>On Unix, the <a href="programs/httpd.html">httpd</a> program
d66260b801a953237f71d6a4b26d8fd9ea419e3brbb is run as a daemon that executes continuously in the
4b34d6a5b70303010612df6c87da3ee91ae86078rbb background to handle requests. This document describes how
d66260b801a953237f71d6a4b26d8fd9ea419e3brbb<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#startup">How Apache Starts</a></li>
d472f67198d6b15dd1270136f180cca9c9263243trawick<li><img alt="" src="/images/down.gif" /> <a href="#errors">Errors During Start-up</a></li>
4b34d6a5b70303010612df6c87da3ee91ae86078rbb<li><img alt="" src="/images/down.gif" /> <a href="#boot">Starting at Boot-Time</a></li>
4b34d6a5b70303010612df6c87da3ee91ae86078rbb<li><img alt="" src="/images/down.gif" /> <a href="#info">Additional Information</a></li>
4b34d6a5b70303010612df6c87da3ee91ae86078rbb</ul><h3>See also</h3><ul class="seealso"><li><a href="stopping.html">Stopping and Restarting</a></li><li><a href="programs/httpd.html">httpd</a></li><li><a href="programs/apachectl.html">apachectl</a></li></ul></div>
d472f67198d6b15dd1270136f180cca9c9263243trawick<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
7aae0c3ef8e7f18f57e2712815c7b48358e5ff68rbb<h2><a name="startup" id="startup">How Apache Starts</a></h2>
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb <p>If the <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>
37be7bf671bdb30d0689796a1a15cc47666e5b78sf specified in the configuration file is default of 80 (or any other
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb port below 1024), then it is necessary to have root privileges in
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb order to start apache, so that it can bind to this privileged
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb port. Once the server has started and performed a few preliminary
8a3a703eae0e35f674b189181609545c6fc77a09rbb activities such as opening its log files, it will launch several
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb <em>child</em> processes which do the work of listening for and
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb answering requests from clients. The main <code>httpd</code>
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb process continues to run as the root user, but the child processes
8a3a703eae0e35f674b189181609545c6fc77a09rbb run as a less privileged user. This is controlled by the selected
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb <p>The recommended method of invoking the <code>httpd</code>
8a3a703eae0e35f674b189181609545c6fc77a09rbb executable is to use the <a href="programs/apachectl.html">apachectl</a> control script. This
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb script sets certain environment variables that are necessary for
7e27b1d417fa94db6e8c798a36c68de3a22f3937ianh <code>httpd</code> to function correctly under some operating
7e27b1d417fa94db6e8c798a36c68de3a22f3937ianh systems, and then invokes the <code>httpd</code> binary.
37be7bf671bdb30d0689796a1a15cc47666e5b78sf <code>apachectl</code> will pass through any command line
7e27b1d417fa94db6e8c798a36c68de3a22f3937ianh arguments, so any <code>httpd</code> options may also be used with
cd04c96e193a6bd4624d92382fd83bda52c8b170rjung <code>apachectl</code> script by changing the <code>HTTPD</code>
05b7ad99e5d197b06c761fef0e06a44e353cbc54rbb variable near the top to specify the correct location of the
164141857c02667118df04b14fe536d1756f0ef4jorton <code>httpd</code> binary and any command-line arguments that you
cee52fb06eb61191ce5d495abda58a75a9bb1c4fcoar <p>The first thing that <code>httpd</code> does when it is
cee52fb06eb61191ce5d495abda58a75a9bb1c4fcoar invoked is to locate and read the <a href="configuring.html">configuration file</a>
cee52fb06eb61191ce5d495abda58a75a9bb1c4fcoar <code>httpd.conf</code>. The location of this file is set at
bb7f455a6c49400b3dfcb3dfb84f9c3a32947a08rbb compile-time, but it is possible to specify its location at run
bb7f455a6c49400b3dfcb3dfb84f9c3a32947a08rbb time using the <code>-f</code> command-line option as in</p>
bb7f455a6c49400b3dfcb3dfb84f9c3a32947a08rbb<div class="example"><p><code>/usr/local/apache2/bin/apachectl -f
9fe74ffcdea85800f04a7222f716f78ae60cce51jerenkrantz /usr/local/apache/conf/httpd.conf</code></p></div>
9fe74ffcdea85800f04a7222f716f78ae60cce51jerenkrantz <p>If all goes well during startup, the server will detach from
e62b34b26eb8e82bf6f06ff99a08e304b48792ecpquerna the terminal and the command prompt will return almost
e62b34b26eb8e82bf6f06ff99a08e304b48792ecpquerna immediately. This indicates that the server is up and running.
e62b34b26eb8e82bf6f06ff99a08e304b48792ecpquerna You can then use your browser to connect to the server and view
e62b34b26eb8e82bf6f06ff99a08e304b48792ecpquerna the test page in the <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code> directory
e62b34b26eb8e82bf6f06ff99a08e304b48792ecpquerna and the local copy of the documentation linked from that
05aeb72ad4d3487297de9b6a27e9d61cbd7672a8rooneg</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin<h2><a name="errors" id="errors">Errors During Start-up</a></h2>
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin <p>If Apache suffers a fatal problem during startup, it will
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin write a message describing the problem either to the console or
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin to the <code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code> before
<p>Additional information about the command-line options of <a href="programs/httpd.html">httpd</a> and <a href="programs/apachectl.html">apachectl</a> as well as other
There is also documentation on all the <a href="mod/">modules</a> included with the Apache distribution
<p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
<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>