Blame docs/manual/invoking.html.en

Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
Packit 90a5c9
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
Packit 90a5c9
Packit 90a5c9
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Packit 90a5c9
              This file is generated from xml source: DO NOT EDIT
Packit 90a5c9
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Packit 90a5c9
      -->
Packit 90a5c9
<title>Starting Apache - Apache HTTP Server Version 2.4</title>
Packit 90a5c9
<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
Packit 90a5c9
<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
Packit 90a5c9
<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" />
Packit 90a5c9
<script src="./style/scripts/prettify.min.js" type="text/javascript">
Packit 90a5c9
</script>
Packit 90a5c9
Packit 90a5c9
<link href="./images/favicon.ico" rel="shortcut icon" /></head>
Packit 90a5c9
<body id="manual-page">
Packit 90a5c9

Modules | Directives | FAQ | Glossary | Sitemap

Packit 90a5c9

Apache HTTP Server Version 2.4

Packit 90a5c9
Packit 90a5c9
<-
Packit 90a5c9
Packit 90a5c9
Apache > HTTP Server > Documentation > Version 2.4

Starting Apache

Packit 90a5c9
Packit 90a5c9

Available Languages:  de  |

Packit 90a5c9
 en  |
Packit 90a5c9
 es  |
Packit 90a5c9
 fr  |
Packit 90a5c9
 ja  |
Packit 90a5c9
 ko  |
Packit 90a5c9
 tr 

Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
    

On Windows, Apache is normally run as a service.

Packit 90a5c9
    For details, see Running Apache as a Service.
Packit 90a5c9
    

Packit 90a5c9
Packit 90a5c9
    

On Unix, the httpd program

Packit 90a5c9
    is run as a daemon that executes continuously in the
Packit 90a5c9
    background to handle requests.  This document describes how
Packit 90a5c9
    to invoke httpd.

Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
  • Errors During Start-up
  • Packit 90a5c9
  • Starting at Boot-Time
  • Packit 90a5c9
  • Additional Information
  • Packit 90a5c9

    See also

    Packit 90a5c9
    top
    Packit 90a5c9
    Packit 90a5c9

    How Apache Starts

    Packit 90a5c9
    Packit 90a5c9
        

    If the Listen

    Packit 90a5c9
        specified in the configuration file is default of 80 (or any other
    Packit 90a5c9
        port below 1024), then it is necessary to have root privileges in
    Packit 90a5c9
        order to start apache, so that it can bind to this privileged
    Packit 90a5c9
        port. Once the server has started and performed a few preliminary
    Packit 90a5c9
        activities such as opening its log files, it will launch several
    Packit 90a5c9
        child processes which do the work of listening for and
    Packit 90a5c9
        answering requests from clients. The main httpd
    Packit 90a5c9
        process continues to run as the root user, but the child processes
    Packit 90a5c9
        run as a less privileged user. This is controlled by the selected
    Packit 90a5c9
        Multi-Processing Module.

    Packit 90a5c9
    Packit 90a5c9
        

    The recommended method of invoking the httpd

    Packit 90a5c9
        executable is to use the apachectl control script. This
    Packit 90a5c9
        script sets certain environment variables that are necessary for
    Packit 90a5c9
        httpd to function correctly under some operating
    Packit 90a5c9
        systems, and then invokes the httpd binary.
    Packit 90a5c9
        apachectl will pass through any command line
    Packit 90a5c9
        arguments, so any httpd options may also be used with
    Packit 90a5c9
        apachectl.  You may also directly edit the
    Packit 90a5c9
        apachectl script by changing the HTTPD
    Packit 90a5c9
        variable near the top to specify the correct location of the
    Packit 90a5c9
        httpd binary and any command-line arguments that you
    Packit 90a5c9
        wish to be always present.

    Packit 90a5c9
    Packit 90a5c9
        

    The first thing that httpd does when it is

    Packit 90a5c9
        invoked is to locate and read the configuration file
    Packit 90a5c9
        httpd.conf. The location of this file is set at
    Packit 90a5c9
        compile-time, but it is possible to specify its location at run
    Packit 90a5c9
        time using the -f command-line option as in

    Packit 90a5c9
    Packit 90a5c9

    /usr/local/apache2/bin/apachectl -f

    Packit 90a5c9
          /usr/local/apache2/conf/httpd.conf

    Packit 90a5c9
    Packit 90a5c9
        

    If all goes well during startup, the server will detach from

    Packit 90a5c9
        the terminal and the command prompt will return almost
    Packit 90a5c9
        immediately. This indicates that the server is up and running.
    Packit 90a5c9
        You can then use your browser to connect to the server and view
    Packit 90a5c9
        the test page in the DocumentRoot directory.

    Packit 90a5c9
    top
    Packit 90a5c9
    Packit 90a5c9

    Errors During Start-up

    Packit 90a5c9
    Packit 90a5c9
        

    If Apache suffers a fatal problem during startup, it will

    Packit 90a5c9
        write a message describing the problem either to the console or
    Packit 90a5c9
        to the ErrorLog before
    Packit 90a5c9
        exiting. One of the most common error messages is "Unable
    Packit 90a5c9
        to bind to Port ...". This message is usually caused by
    Packit 90a5c9
        either:

    Packit 90a5c9
    Packit 90a5c9
        
      Packit 90a5c9
            
    • Trying to start the server on a privileged port when not
    • Packit 90a5c9
            logged in as the root user; or
      Packit 90a5c9
      Packit 90a5c9
            
    • Trying to start the server when there is another instance
    • Packit 90a5c9
            of Apache or some other web server already bound to the same
      Packit 90a5c9
            Port.
      Packit 90a5c9
          
      Packit 90a5c9
      Packit 90a5c9
          

      For further trouble-shooting instructions, consult the

      Packit 90a5c9
          Apache FAQ.

      Packit 90a5c9
      top
      Packit 90a5c9
      Packit 90a5c9

      Starting at Boot-Time

      Packit 90a5c9
      Packit 90a5c9
          

      If you want your server to continue running after a system

      Packit 90a5c9
          reboot, you should add a call to apachectl to your
      Packit 90a5c9
          system startup files (typically rc.local or a file in
      Packit 90a5c9
          an rc.N directory). This will start Apache as
      Packit 90a5c9
          root. Before doing this ensure that your server is properly
      Packit 90a5c9
          configured for security and access restrictions.

      Packit 90a5c9
      Packit 90a5c9
          

      The apachectl script is designed to act like a

      Packit 90a5c9
          standard SysV init script; it can take the arguments
      Packit 90a5c9
          start, restart, and stop
      Packit 90a5c9
          and translate them into the appropriate signals to
      Packit 90a5c9
          httpd.  So you can often simply link
      Packit 90a5c9
          apachectl into the appropriate init directory. But be
      Packit 90a5c9
          sure to check the exact requirements of your system.

      Packit 90a5c9
      top
      Packit 90a5c9
      Packit 90a5c9

      Additional Information

      Packit 90a5c9
      Packit 90a5c9
          

      Additional information about the command-line options of httpd and apachectl as well as other support

      Packit 90a5c9
          programs included with the server is available on the
      Packit 90a5c9
          Server and Supporting Programs page.
      Packit 90a5c9
          There is also documentation on all the modules included with the Apache distribution
      Packit 90a5c9
          and the directives that they
      Packit 90a5c9
          provide.

      Packit 90a5c9
      Packit 90a5c9
      Packit 90a5c9

      Available Languages:  de  |

      Packit 90a5c9
       en  |
      Packit 90a5c9
       es  |
      Packit 90a5c9
       fr  |
      Packit 90a5c9
       ja  |
      Packit 90a5c9
       ko  |
      Packit 90a5c9
       tr 

      Packit 90a5c9
      top

      Comments

      Notice:
      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 mailing lists.
      Packit 90a5c9
      <script type="text/javascript">
      Packit 90a5c9
      var comments_shortname = 'httpd';
      Packit 90a5c9
      var comments_identifier = 'http://httpd.apache.org/docs/2.4/invoking.html';
      Packit 90a5c9
      (function(w, d) {
      Packit 90a5c9
          if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
      Packit 90a5c9
              d.write('
      <\/div>');
      Packit 90a5c9
              var s = d.createElement('script');
      Packit 90a5c9
              s.type = 'text/javascript';
      Packit 90a5c9
              s.async = true;
      Packit 90a5c9
              s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
      Packit 90a5c9
              (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
      Packit 90a5c9
          }
      Packit 90a5c9
          else { 
      Packit 90a5c9
              d.write('
      Comments are disabled for this page at the moment.<\/div>');
      Packit 90a5c9
          }
      Packit 90a5c9
      })(window, document);
      Packit 90a5c9
      //--></script>
      Packit 90a5c9

      Copyright 2018 The Apache Software Foundation.
      Licensed under the Apache License, Version 2.0.

      Packit 90a5c9

      Modules | Directives | FAQ | Glossary | Sitemap

      <script type="text/javascript">
      Packit 90a5c9
      if (typeof(prettyPrint) !== 'undefined') {
      Packit 90a5c9
          prettyPrint();
      Packit 90a5c9
      }
      Packit 90a5c9
      //--></script>
      Packit 90a5c9
      </body></html>