github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/manual/invoking.html.en (about) 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 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> 5 <!-- 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 This file is generated from xml source: DO NOT EDIT 8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 9 --> 10 <title>Starting Apache - Apache HTTP Server Version 2.2</title> 11 <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 12 <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 13 <link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" /> 14 <script src="./style/scripts/prettify.min.js" type="text/javascript"> 15 </script> 16 17 <link href="./images/favicon.ico" rel="shortcut icon" /><link href="http://httpd.apache.org/docs/current/invoking.html" rel="canonical" /></head> 18 <body id="manual-page"><div id="page-header"> 19 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p> 20 <p class="apache">Apache HTTP Server Version 2.2</p> 21 <img alt="" src="./images/feather.gif" /></div> 22 <div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif" /></a></div> 23 <div id="path"> 24 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.2</a></div><div id="page-content"><div class="retired"><h4>Please note</h4> 25 <p> This document refers to a legacy release (<strong>2.2</strong>) of Apache httpd. The active release (<strong>2.4</strong>) is documented <a href="http://httpd.apache.org/docs/current">here</a>. If you have not already upgraded, please follow <a href="http://httpd.apache.org/docs/current/upgrading.html">this link</a> for more information.</p> 26 <p>You may follow <a href="http://httpd.apache.org/docs/current/invoking.html">this link</a> to go to the current version of this document.</p></div><div id="preamble"><h1>Starting Apache</h1> 27 <div class="toplang"> 28 <p><span>Available Languages: </span><a href="./de/invoking.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> | 29 <a href="./en/invoking.html" title="English"> en </a> | 30 <a href="./es/invoking.html" hreflang="es" rel="alternate" title="Español"> es </a> | 31 <a href="./fr/invoking.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | 32 <a href="./ja/invoking.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 33 <a href="./ko/invoking.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 34 <a href="./ru/invoking.html" hreflang="ru" rel="alternate" title="Russian"> ru </a> | 35 <a href="./tr/invoking.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 36 </div> 37 38 <p>On Windows, Apache is normally run as a service on Windows 39 NT, 2000 and XP, or as a console application on Windows 9x and 40 ME. For details, see <a href="platform/windows.html#winsvc">Running Apache as a Service</a> 41 and <a href="platform/windows.html#wincons">Running Apache as a 42 Console Application</a>.</p> 43 44 <p>On Unix, the <code class="program"><a href="./programs/httpd.html">httpd</a></code> program 45 is run as a daemon that executes continuously in the 46 background to handle requests. This document describes how 47 to invoke <code class="program"><a href="./programs/httpd.html">httpd</a></code>.</p> 48 </div> 49 <div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#startup">How Apache Starts</a></li> 50 <li><img alt="" src="./images/down.gif" /> <a href="#errors">Errors During Start-up</a></li> 51 <li><img alt="" src="./images/down.gif" /> <a href="#boot">Starting at Boot-Time</a></li> 52 <li><img alt="" src="./images/down.gif" /> <a href="#info">Additional Information</a></li> 53 </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><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 54 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> 55 <div class="section"> 56 <h2><a name="startup" id="startup">How Apache Starts</a></h2> 57 58 <p>If the <code class="directive"><a href="./mod/mpm_common.html#listen">Listen</a></code> 59 specified in the configuration file is default of 80 (or any other 60 port below 1024), then it is necessary to have root privileges in 61 order to start apache, so that it can bind to this privileged 62 port. Once the server has started and performed a few preliminary 63 activities such as opening its log files, it will launch several 64 <em>child</em> processes which do the work of listening for and 65 answering requests from clients. The main <code>httpd</code> 66 process continues to run as the root user, but the child processes 67 run as a less privileged user. This is controlled by the selected 68 <a href="mpm.html">Multi-Processing Module</a>.</p> 69 70 <p>The recommended method of invoking the <code class="program"><a href="./programs/httpd.html">httpd</a></code> 71 executable is to use the <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> control script. This 72 script sets certain environment variables that are necessary for 73 <code class="program"><a href="./programs/httpd.html">httpd</a></code> to function correctly under some operating 74 systems, and then invokes the <code class="program"><a href="./programs/httpd.html">httpd</a></code> binary. 75 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> will pass through any command line 76 arguments, so any <code class="program"><a href="./programs/httpd.html">httpd</a></code> options may also be used with 77 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code>. You may also directly edit the 78 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> script by changing the <code>HTTPD</code> 79 variable near the top to specify the correct location of the 80 <code class="program"><a href="./programs/httpd.html">httpd</a></code> binary and any command-line arguments that you 81 wish to be <em>always</em> present.</p> 82 83 <p>The first thing that <code class="program"><a href="./programs/httpd.html">httpd</a></code> does when it is 84 invoked is to locate and read the <a href="configuring.html">configuration file</a> 85 <code>httpd.conf</code>. The location of this file is set at 86 compile-time, but it is possible to specify its location at run 87 time using the <code>-f</code> command-line option as in</p> 88 89 <div class="example"><p><code>/usr/local/apache2/bin/apachectl -f 90 /usr/local/apache2/conf/httpd.conf</code></p></div> 91 92 <p>If all goes well during startup, the server will detach from 93 the terminal and the command prompt will return almost 94 immediately. This indicates that the server is up and running. 95 You can then use your browser to connect to the server and view 96 the test page in the <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> directory.</p> 97 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> 98 <div class="section"> 99 <h2><a name="errors" id="errors">Errors During Start-up</a></h2> 100 101 <p>If Apache suffers a fatal problem during startup, it will 102 write a message describing the problem either to the console or 103 to the <code class="directive"><a href="./mod/core.html#errorlog">ErrorLog</a></code> before 104 exiting. One of the most common error messages is "<code>Unable 105 to bind to Port ...</code>". This message is usually caused by 106 either:</p> 107 108 <ul> 109 <li>Trying to start the server on a privileged port when not 110 logged in as the root user; or</li> 111 112 <li>Trying to start the server when there is another instance 113 of Apache or some other web server already bound to the same 114 Port.</li> 115 </ul> 116 117 <p>For further trouble-shooting instructions, consult the 118 Apache <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a>.</p> 119 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> 120 <div class="section"> 121 <h2><a name="boot" id="boot">Starting at Boot-Time</a></h2> 122 123 <p>If you want your server to continue running after a system 124 reboot, you should add a call to <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> to your 125 system startup files (typically <code>rc.local</code> or a file in 126 an <code>rc.N</code> directory). This will start Apache as 127 root. Before doing this ensure that your server is properly 128 configured for security and access restrictions.</p> 129 130 <p>The <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> script is designed to act like a 131 standard SysV init script; it can take the arguments 132 <code>start</code>, <code>restart</code>, and <code>stop</code> 133 and translate them into the appropriate signals to 134 <code class="program"><a href="./programs/httpd.html">httpd</a></code>. So you can often simply link 135 <code class="program"><a href="./programs/apachectl.html">apachectl</a></code> into the appropriate init directory. But be 136 sure to check the exact requirements of your system.</p> 137 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div> 138 <div class="section"> 139 <h2><a name="info" id="info">Additional Information</a></h2> 140 141 <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 142 programs included with the server is available on the 143 <a href="programs/">Server and Supporting Programs</a> page. 144 There is also documentation on all the <a href="mod/">modules</a> included with the Apache distribution 145 and the <a href="mod/directives.html">directives</a> that they 146 provide.</p> 147 </div></div> 148 <div class="bottomlang"> 149 <p><span>Available Languages: </span><a href="./de/invoking.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> | 150 <a href="./en/invoking.html" title="English"> en </a> | 151 <a href="./es/invoking.html" hreflang="es" rel="alternate" title="Español"> es </a> | 152 <a href="./fr/invoking.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | 153 <a href="./ja/invoking.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 154 <a href="./ko/invoking.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 155 <a href="./ru/invoking.html" hreflang="ru" rel="alternate" title="Russian"> ru </a> | 156 <a href="./tr/invoking.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 157 </div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 158 <script type="text/javascript"><!--//--><![CDATA[//><!-- 159 var comments_shortname = 'httpd'; 160 var comments_identifier = 'http://httpd.apache.org/docs/2.2/invoking.html'; 161 (function(w, d) { 162 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 163 d.write('<div id="comments_thread"><\/div>'); 164 var s = d.createElement('script'); 165 s.type = 'text/javascript'; 166 s.async = true; 167 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 168 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 169 } 170 else { 171 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 172 } 173 })(window, document); 174 //--><!]]></script></div><div id="footer"> 175 <p class="apache">Copyright 2017 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> 176 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 177 if (typeof(prettyPrint) !== 'undefined') { 178 prettyPrint(); 179 } 180 //--><!]]></script> 181 </body></html>