home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Complet / Apache / apache_2.0.52-win32-x86-no_ssl.msi / Data.Cab / F277701_invoking.xml < prev    next >
Extensible Markup Language  |  2004-04-17  |  7KB  |  146 lines

  1. <?xml version='1.0' encoding='UTF-8' ?>
  2. <!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
  3. <?xml-stylesheet type="text/xsl" href="./style/manual.en.xsl"?>
  4. <!-- $Revision: 1.2.2.9 $ -->
  5.  
  6. <!--
  7.  Copyright 2002-2004 The Apache Software Foundation
  8.  
  9.  Licensed under the Apache License, Version 2.0 (the "License");
  10.  you may not use this file except in compliance with the License.
  11.  You may obtain a copy of the License at
  12.  
  13.      http://www.apache.org/licenses/LICENSE-2.0
  14.  
  15.  Unless required by applicable law or agreed to in writing, software
  16.  distributed under the License is distributed on an "AS IS" BASIS,
  17.  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18.  See the License for the specific language governing permissions and
  19.  limitations under the License.
  20. -->
  21.  
  22. <manualpage metafile="invoking.xml.meta">
  23.  
  24.   <title>Starting Apache</title>
  25.  
  26. <summary>
  27.     <p>On Windows, Apache is normally run as a service on Windows
  28.     NT, 2000 and XP, or as a console application on Windows 9x and
  29.     ME. For details, see <a
  30.     href="platform/windows.html#winsvc">Running Apache as a Service</a>
  31.     and <a href="platform/windows.html#wincons">Running Apache as a
  32.     Console Application</a>.</p>
  33.  
  34.     <p>On Unix, the <a href="programs/httpd.html">httpd</a> program
  35.     is run as a daemon that executes continuously in the
  36.     background to handle requests.  This document describes how
  37.     to invoke <code>httpd</code>.</p>
  38. </summary>
  39.  
  40. <seealso><a href="stopping.html">Stopping and Restarting</a></seealso>
  41. <seealso><a href="programs/httpd.html">httpd</a></seealso>
  42. <seealso><a href="programs/apachectl.html">apachectl</a></seealso>
  43.  
  44. <section id="startup"><title>How Apache Starts</title>
  45.  
  46.     <p>If the <directive module="mpm_common">Listen</directive>
  47.     specified in the configuration file is default of 80 (or any other
  48.     port below 1024), then it is necessary to have root privileges in
  49.     order to start apache, so that it can bind to this privileged
  50.     port. Once the server has started and performed a few preliminary
  51.     activities such as opening its log files, it will launch several
  52.     <em>child</em> processes which do the work of listening for and
  53.     answering requests from clients. The main <code>httpd</code>
  54.     process continues to run as the root user, but the child processes
  55.     run as a less privileged user. This is controlled by the selected
  56.     <a href="mpm.html">Multi-Processing Module</a>.</p>
  57.  
  58.     <p>The recommended method of invoking the <code>httpd</code>
  59.     executable is to use the <a
  60.     href="programs/apachectl.html">apachectl</a> control script.  This
  61.     script sets certain environment variables that are necessary for
  62.     <code>httpd</code> to function correctly under some operating
  63.     systems, and then invokes the <code>httpd</code> binary.
  64.     <code>apachectl</code> will pass through any command line
  65.     arguments, so any <code>httpd</code> options may also be used with
  66.     <code>apachectl</code>.  You may also directly edit the
  67.     <code>apachectl</code> script by changing the <code>HTTPD</code>
  68.     variable near the top to specify the correct location of the
  69.     <code>httpd</code> binary and any command-line arguments that you
  70.     wish to be <em>always</em> present.</p>
  71.  
  72.     <p>The first thing that <code>httpd</code> does when it is
  73.     invoked is to locate and read the <a
  74.     href="configuring.html">configuration file</a>
  75.     <code>httpd.conf</code>. The location of this file is set at
  76.     compile-time, but it is possible to specify its location at run
  77.     time using the <code>-f</code> command-line option as in</p>
  78.  
  79. <example>/usr/local/apache2/bin/apachectl -f
  80.       /usr/local/apache2/conf/httpd.conf</example>
  81.  
  82.     <p>If all goes well during startup, the server will detach from
  83.     the terminal and the command prompt will return almost
  84.     immediately. This indicates that the server is up and running.
  85.     You can then use your browser to connect to the server and view
  86.     the test page in the <directive
  87.     module="core">DocumentRoot</directive> directory
  88.     and the local copy of the documentation linked from that
  89.     page.</p>
  90. </section>
  91.  
  92. <section id="errors"><title>Errors During Start-up</title>
  93.  
  94.     <p>If Apache suffers a fatal problem during startup, it will
  95.     write a message describing the problem either to the console or
  96.     to the <directive module="core">ErrorLog</directive> before
  97.     exiting. One of the most common error messages is "<code>Unable
  98.     to bind to Port ...</code>". This message is usually caused by
  99.     either:</p>
  100.  
  101.     <ul>
  102.       <li>Trying to start the server on a privileged port when not
  103.       logged in as the root user; or</li>
  104.  
  105.       <li>Trying to start the server when there is another instance
  106.       of Apache or some other web server already bound to the same
  107.       Port.</li>
  108.     </ul>
  109.  
  110.     <p>For further trouble-shooting instructions, consult the
  111.     Apache <a href="faq/">FAQ</a>.</p>
  112. </section>
  113.  
  114. <section id="boot"><title>Starting at Boot-Time</title>
  115.  
  116.     <p>If you want your server to continue running after a system
  117.     reboot, you should add a call to <code>apachectl</code> to your
  118.     system startup files (typically <code>rc.local</code> or a file in
  119.     an <code>rc.N</code> directory). This will start Apache as
  120.     root. Before doing this ensure that your server is properly
  121.     configured for security and access restrictions.</p>
  122.  
  123.     <p>The <code>apachectl</code> script is designed to act like a
  124.     standard SysV init script; it can take the arguments
  125.     <code>start</code>, <code>restart</code>, and <code>stop</code>
  126.     and translate them into the appropriate signals to
  127.     <code>httpd</code>.  So you can often simply link
  128.     <code>apachectl</code> into the appropriate init directory. But be
  129.     sure to check the exact requirements of your system.</p>
  130. </section>
  131.  
  132. <section id="info"><title>Additional Information</title>
  133.  
  134.     <p>Additional information about the command-line options of <a
  135.     href="programs/httpd.html">httpd</a> and <a
  136.     href="programs/apachectl.html">apachectl</a> as well as other
  137.     support programs included with the server is available on the
  138.     <a href="programs/">Server and Supporting Programs</a> page.
  139.     There is also documentation on all the <a
  140.     href="mod/">modules</a> included with the Apache distribution
  141.     and the <a href="mod/directives.html">directives</a> that they
  142.     provide.</p>
  143. </section>
  144.  
  145. </manualpage>
  146.