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