| <!DOCTYPE html SYSTEM "about:legacy-compat"> | |
| <html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <meta content="width=device-width, initial-scale=1" name="viewport"> | |
| <!-- | |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
| This file is generated from xml source: DO NOT EDIT | |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
| --> | |
| <title>apachectl - Apache HTTP Server Control Interface - Apache HTTP Server Version 2.4</title> | |
| <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet"> | |
| <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size"> | |
| <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"> | |
| <script src="../style/scripts/prettify.min.js"> | |
| </script> | |
| <link href="../images/favicon.png" rel="shortcut icon"></head> | |
| <body id="manual-page"><div id="page-header"> | |
| <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p> | |
| <p class="apache">Apache HTTP Server Version 2.4</p> | |
| <img alt="" src="../images/feather.png"></div> | |
| <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif"></a></div> | |
| <div id="path"> | |
| <a href="https://www.apache.org/">Apache</a> > <a href="https://httpd.apache.org/">HTTP Server</a> > <a href="https://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> | |
| <button aria-label="Toggle language list" class="lang-toggle"><svg xmlns="http://www.w3.org/2000/svg" stroke-width="2" stroke="currentColor" fill="none" viewBox="0 0 24 24" height="16" width="16"><circle r="10" cy="12" cx="12"/><line y2="12" x2="22" y1="12" x1="2"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg></button> | |
| <div class="toplang"> | |
| <p><span>Available Languages: </span><a href="../en/programs/apachectl.html" title="English"> en </a> | | |
| <a href="../fr/programs/apachectl.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | | |
| <a href="../ko/programs/apachectl.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | | |
| <a href="../tr/programs/apachectl.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> | |
| </div> | |
| <p><code class="program"><a href="../programs/apachectl.html">apachectl</a></code> is a front end to the Apache HyperText | |
| Transfer Protocol (HTTP) server. It is designed to help the | |
| administrator control the functioning of the Apache | |
| <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon.</p> | |
| <p>The <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> script can operate in two modes. | |
| First, it can act as a simple front-end to the <code class="program"><a href="../programs/httpd.html">httpd</a></code> | |
| command that simply sets any necessary environment variables and | |
| then invokes <code class="program"><a href="../programs/httpd.html">httpd</a></code>, passing through any command line | |
| arguments. Second, <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> can act as a SysV init | |
| script, taking simple one-word arguments like <code>start</code>, | |
| <code>restart</code>, and <code>stop</code>, and translating them | |
| into appropriate signals to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p> | |
| <p>If your Apache installation uses non-standard paths, you will | |
| need to edit the <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> script to set the | |
| appropriate paths to the <code class="program"><a href="../programs/httpd.html">httpd</a></code> binary. You can also | |
| specify any necessary <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line arguments. | |
| See the comments in the script for details.</p> | |
| <p>The <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> script returns a 0 exit value on | |
| success, and >0 if an error occurs. For more details, view | |
| the comments in the script.</p> | |
| </div> | |
| <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif"> <a href="#synopsis">Synopsis</a></li> | |
| <li><img alt="" src="../images/down.gif"> <a href="#options">Options</a></li> | |
| <li><img alt="" src="../images/down.gif"> <a href="#files">Files</a></li> | |
| </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></div> | |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div> | |
| <div class="section"> | |
| <h2 id="synopsis">Synopsis <a title="Permanent link" href="#synopsis" class="permalink">¶</a></h2> | |
| <p>When acting in pass-through mode, <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> can take | |
| all the arguments available for the <code class="program"><a href="../programs/httpd.html">httpd</a></code> | |
| binary.</p> | |
| <p><code><strong>apachectl</strong> [ <var>httpd-argument</var> ]</code></p> | |
| <p>When acting in SysV init mode, <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> takes simple, | |
| one-word commands, defined below.</p> | |
| <p><code><strong>apachectl</strong> <var>command</var></code></p> | |
| </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div> | |
| <div class="section"> | |
| <h2 id="options">Options <a title="Permanent link" href="#options" class="permalink">¶</a></h2> | |
| <p>Only the SysV init-style options are defined here. Other arguments | |
| are defined on the <code class="program"><a href="../programs/httpd.html">httpd</a></code> manual page.</p> | |
| <dl> | |
| <dt><code>start</code></dt> | |
| <dd>Start the Apache <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon. Gives an error if it | |
| is already running. This is equivalent to <code>apachectl -k | |
| start</code>.</dd> | |
| <dt><code>stop</code></dt> | |
| <dd>Stops the Apache <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon. This is equivalent to | |
| <code>apachectl -k stop</code>.</dd> | |
| <dt><code>restart</code></dt> | |
| <dd>Restarts the Apache <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon. If the daemon is | |
| not running, it is started. This command automatically checks the | |
| configuration files as in <code>configtest</code> before initiating | |
| the restart to make sure the daemon doesn't die. This is equivalent | |
| to <code>apachectl -k restart</code>.</dd> | |
| <dt><code>fullstatus</code></dt> | |
| <dd>Displays a full status report from <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>. | |
| For this to work, you need to have <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> enabled | |
| on your server and a text-based browser such as <code>lynx</code> | |
| available on your system. The URL used to access the status report | |
| can be set by editing the <code>STATUSURL</code> variable in the | |
| script.</dd> | |
| <dt><code>status</code></dt> | |
| <dd>Displays a brief status report. Similar to the | |
| <code>fullstatus</code> option, except that the list of requests | |
| currently being served is omitted.</dd> | |
| <dt><code>graceful</code></dt> | |
| <dd>Gracefully restarts the Apache <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon. If the | |
| daemon is not running, it is started. This differs from a normal | |
| restart in that currently open connections are not aborted. A side | |
| effect is that old log files will not be closed immediately. This | |
| means that if used in a log rotation script, a substantial delay may | |
| be necessary to ensure that the old log files are closed before | |
| processing them. This command automatically checks the configuration | |
| files as in <code>configtest</code> before initiating the | |
| restart to make sure Apache doesn't die. This is equivalent to | |
| <code>apachectl -k graceful</code>.</dd> | |
| <dt><code>graceful-stop</code></dt> | |
| <dd>Gracefully stops the Apache <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon. | |
| This differs from a normal stop in that currently open connections are not | |
| aborted. A side effect is that old log files will not be closed immediately. | |
| This is equivalent to <code>apachectl -k graceful-stop</code>.</dd> | |
| <dt><code>configtest</code></dt> | |
| <dd>Run a configuration file syntax test. It parses the configuration | |
| files and either reports <code>Syntax Ok</code> | |
| or detailed information about the particular syntax error. This is | |
| equivalent to <code>apachectl -t</code>.</dd> | |
| </dl> | |
| <p>The following option was available in earlier versions but has been removed.</p> | |
| <dl> | |
| <dt><code>startssl</code></dt> | |
| <dd>To start <code class="program"><a href="../programs/httpd.html">httpd</a></code> with SSL support, you should edit | |
| your configuration file to include the relevant directives and then | |
| use the normal <code>apachectl start</code>.</dd> | |
| </dl> | |
| </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif"></a></div> | |
| <div class="section"> | |
| <h2 id="files">Files <a title="Permanent link" href="#files" class="permalink">¶</a></h2> | |
| <p>The default paths listed below may be changed at compile time. | |
| Consult your local installation for the actual locations.</p> | |
| <dl> | |
| <dt><code>/usr/local/apache2/bin/envvars</code></dt> | |
| <dd>Environment variable settings sourced at startup.</dd> | |
| <dt><code>/usr/local/apache2/bin/httpd</code></dt> | |
| <dd>The httpd binary invoked by apachectl.</dd> | |
| </dl> | |
| </div></div> | |
| <div class="bottomlang"> | |
| <p><span>Available Languages: </span><a href="../en/programs/apachectl.html" title="English"> en </a> | | |
| <a href="../fr/programs/apachectl.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | | |
| <a href="../ko/programs/apachectl.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | | |
| <a href="../tr/programs/apachectl.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> | |
| </div><div id="footer"> | |
| <p class="apache">Copyright 2026 The Apache Software Foundation.<br>Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> | |
| <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p></div><script><!--//--><![CDATA[//><!-- | |
| if (typeof(prettyPrint) !== 'undefined') { | |
| prettyPrint(); | |
| } | |
| var langToggle = document.querySelector('.lang-toggle'); | |
| var topLang = document.querySelector('.toplang'); | |
| if (langToggle && topLang) { | |
| langToggle.addEventListener('click', function() { topLang.classList.toggle('open'); }); | |
| } | |
| var qv = document.getElementById('quickview'); | |
| if (qv) { | |
| document.body.appendChild(qv); | |
| var qvBtn = document.createElement('button'); | |
| qvBtn.className = 'qv-toggle'; | |
| qvBtn.setAttribute('aria-label', 'Toggle page navigation'); | |
| qvBtn.innerHTML = '☰'; | |
| document.body.appendChild(qvBtn); | |
| qvBtn.addEventListener('click', function() { | |
| var isOpen = qv.classList.toggle('open'); | |
| if (isOpen) { | |
| qv.style.top = window.scrollY + 10 + 'px'; | |
| } | |
| }); | |
| window.addEventListener('scroll', function() { qv.classList.remove('open'); }); | |
| } | |
| //--><!]]></script> | |
| </body></html> |