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