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 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 This file is generated from xml source: DO NOT EDIT 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 --> 8<title>apachectl - Apache HTTP Server Control Interface - Apache HTTP Server</title> 9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 11<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" /> 12<script src="/style/scripts/prettify.min.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body id="manual-page"><div id="page-header"> 17<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> 18<p class="apache">Apache HTTP Server Version 2.4</p> 19<img alt="" src="/images/feather.gif" /></div> 20<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 21<div id="path"> 22<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.4</a> > <a href="./">Programs</a></div><div id="page-content"><div id="preamble"><h1>apachectl - Apache HTTP Server Control Interface</h1> 23<div class="toplang"> 24<p><span>Available Languages: </span><a href="/en/programs/apachectl.html" title="English"> en </a> | 25<a href="/fr/programs/apachectl.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 26<a href="/ko/programs/apachectl.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 27<a href="/tr/programs/apachectl.html" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a></p> 28</div> 29 30 <p><code>apachectl</code> is a front end to the Apache HyperText 31 Transfer Protocol (HTTP) server. It is designed to help the 32 administrator control the functioning of the Apache 33 <code class="program"><a href="/programs/httpd.html">httpd</a></code> daemon.</p> 34 35 <p>The <code>apachectl</code> script can operate in two modes. 36 First, it can act as a simple front-end to the <code class="program"><a href="/programs/httpd.html">httpd</a></code> 37 command that simply sets any necessary environment variables and 38 then invokes <code class="program"><a href="/programs/httpd.html">httpd</a></code>, passing through any command line 39 arguments. Second, <code>apachectl</code> can act as a SysV init 40 script, taking simple one-word arguments like <code>start</code>, 41 <code>restart</code>, and <code>stop</code>, and translating them 42 into appropriate signals to <code class="program"><a href="/programs/httpd.html">httpd</a></code>.</p> 43 44 <p>If your Apache installation uses non-standard paths, you will 45 need to edit the <code>apachectl</code> script to set the 46 appropriate paths to the <code class="program"><a href="/programs/httpd.html">httpd</a></code> binary. You can also 47 specify any necessary <code class="program"><a href="/programs/httpd.html">httpd</a></code> command line arguments. 48 See the comments in the script for details.</p> 49 50 <p>The <code>apachectl</code> script returns a 0 exit value on 51 success, and >0 if an error occurs. For more details, view 52 the comments in the script.</p> 53</div> 54<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#synopsis">Synopsis</a></li> 55<li><img alt="" src="/images/down.gif" /> <a href="#options">Options</a></li> 56</ul><h3>See also</h3><ul class="seealso"><li><a href="/invoking.html">Starting Apache</a></li><li><a href="/stopping.html">Stopping Apache</a></li><li><a href="/configuring.html">Configuration Files</a></li><li><a href="/platform/">Platform Docs</a></li><li><code class="program"><a href="/programs/httpd.html">httpd</a></code></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 57<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 58<div class="section"> 59<h2><a name="synopsis" id="synopsis">Synopsis</a></h2> 60 61<p>When acting in pass-through mode, <code>apachectl</code> can take 62all the arguments available for the <code class="program"><a href="/programs/httpd.html">httpd</a></code> 63binary.</p> 64 65<p><code><strong>apachectl</strong> [ <var>httpd-argument</var> ]</code></p> 66 67<p>When acting in SysV init mode, <code>apachectl</code> takes simple, 68one-word commands, defined below.</p> 69 70<p><code><strong>apachectl</strong> <var>command</var></code></p> 71 72</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 73<div class="section"> 74<h2><a name="options" id="options">Options</a></h2> 75 76<p>Only the SysV init-style options are defined here. Other arguments 77are defined on the <code class="program"><a href="/programs/httpd.html">httpd</a></code> manual page.</p> 78 79<dl> 80 81<dt><code>start</code></dt> 82 83<dd>Start the Apache <code class="program"><a href="/programs/httpd.html">httpd</a></code> daemon. Gives an error if it 84is already running. This is equivalent to <code>apachectl -k 85start</code>.</dd> 86 87<dt><code>stop</code></dt> 88 89<dd>Stops the Apache <code class="program"><a href="/programs/httpd.html">httpd</a></code> daemon. This is equivalent to 90<code>apachectl -k stop</code>.</dd> 91 92<dt><code>restart</code></dt> 93 94<dd>Restarts the Apache <code class="program"><a href="/programs/httpd.html">httpd</a></code> daemon. If the daemon is 95not running, it is started. This command automatically checks the 96configuration files as in <code>configtest</code> before initiating 97the restart to make sure the daemon doesn't die. This is equivalent 98to <code>apachectl -k restart</code>.</dd> 99 100<dt><code>fullstatus</code></dt> 101 102<dd>Displays a full status report from <code class="module"><a href="/mod/mod_status.html">mod_status</a></code>. 103For this to work, you need to have <code class="module"><a href="/mod/mod_status.html">mod_status</a></code> enabled 104on your server and a text-based browser such as <code>lynx</code> 105available on your system. The URL used to access the status report 106can be set by editing the <code>STATUSURL</code> variable in the 107script.</dd> 108 109<dt><code>status</code></dt> 110 111<dd>Displays a brief status report. Similar to the 112<code>fullstatus</code> option, except that the list of requests 113currently being served is omitted.</dd> 114 115<dt><code>graceful</code></dt> 116 117<dd>Gracefully restarts the Apache <code class="program"><a href="/programs/httpd.html">httpd</a></code> daemon. If the 118daemon is not running, it is started. This differs from a normal 119restart in that currently open connections are not aborted. A side 120effect is that old log files will not be closed immediately. This 121means that if used in a log rotation script, a substantial delay may 122be necessary to ensure that the old log files are closed before 123processing them. This command automatically checks the configuration 124files as in <code>configtest</code> before initiating the 125restart to make sure Apache doesn't die. This is equivalent to 126<code>apachectl -k graceful</code>.</dd> 127 128<dt><code>graceful-stop</code></dt> 129 130<dd>Gracefully stops the Apache <code class="program"><a href="/programs/httpd.html">httpd</a></code> daemon. 131This differs from a normal stop in that currently open connections are not 132aborted. A side effect is that old log files will not be closed immediately. 133This is equivalent to <code>apachectl -k graceful-stop</code>.</dd> 134 135<dt><code>configtest</code></dt> 136 137<dd>Run a configuration file syntax test. It parses the configuration 138files and either reports <code>Syntax Ok</code> 139or detailed information about the particular syntax error. This is 140equivalent to <code>apachectl -t</code>.</dd> 141 142</dl> 143 144<p>The following option was available in earlier versions but has been removed.</p> 145 146<dl> 147 148<dt><code>startssl</code></dt> 149 150<dd>To start <code class="program"><a href="/programs/httpd.html">httpd</a></code> with SSL support, you should edit 151your configuration file to include the relevant directives and then 152use the normal <code>apachectl start</code>.</dd> 153 154</dl> 155 156</div></div> 157<div class="bottomlang"> 158<p><span>Available Languages: </span><a href="/en/programs/apachectl.html" title="English"> en </a> | 159<a href="/fr/programs/apachectl.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 160<a href="/ko/programs/apachectl.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 161<a href="/tr/programs/apachectl.html" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a></p> 162</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> 163<script type="text/javascript"><!--//--><![CDATA[//><!-- 164var comments_shortname = 'httpd'; 165var comments_identifier = 'http://httpd.apache.org/docs/2.4/programs/apachectl.html'; 166(function(w, d) { 167 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 168 d.write('<div id="comments_thread"><\/div>'); 169 var s = d.createElement('script'); 170 s.type = 'text/javascript'; 171 s.async = true; 172 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 173 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 174 } 175 else { 176 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 177 } 178})(window, document); 179//--><!]]></script></div><div id="footer"> 180<p class="apache">Copyright 2014 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> 181<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[//><!-- 182if (typeof(prettyPrint) !== 'undefined') { 183 prettyPrint(); 184} 185//--><!]]></script> 186</body></html>