Starting Apache
On Windows, Apache is normally run as a service. For details, see Running Apache as a Service.
program is run as a daemon that executes continuously in the background to handle requests. This document describes how to invoke httpd
specified in the configuration file is default of 80 (or any other port below 1024), then it is necessary to have root privileges in order to start apache, so that it can bind to this privileged port. Once the server has started and performed a few preliminary activities such as opening its log files, it will launch several Listenchild processes which do the work of listening for and answering requests from clients. The main httpd
process continues to run as the root user, but the child processes run as a less privileged user. This is controlled by the selected Multi-Processing Module.
The recommended method of invoking the
control script. This script sets certain environment variables that are necessary for apache2ctl
to function correctly under some operating systems, and then invokes the httpd
will pass through any command line arguments, so any apache2ctl
options may also be used with httpd
. You may also directly edit the apache2ctl
script by changing the apache2ctlHTTPD
variable near the top to specify the correct location of the
binary and any command-line arguments that you wish to be httpdalways present.
The first thing that
does when it is invoked is to locate and read the httpdconfiguration file apache2.conf
. The location of this file is set at compile-time, but it is possible to specify its location at run time using the -f
If all goes well during startup, the server will detach from the terminal and the command prompt will return almost immediately. This indicates that the server is up and running. You can then use your browser to connect to the server and view the test page in the
For further trouble-shooting instructions, consult the Apache FAQ.
directory). This will start Apache as root. Before doing this ensure that your server is properly configured for security and access restrictions.
script is designed to act like a standard SysV init script; it can take the arguments apache2ctlstart
and translate them into the appropriate signals to
. So you can often simply link httpd
into the appropriate init directory. But be sure to check the exact requirements of your system.apache2ctl
as well as other support programs included with the server is available on the apache2ctlServer and Supporting Programs page. There is also documentation on all the modules included with the Apache distribution and the directives that they provide.
Modules | Directives | FAQ | Glossary | Sitemap
Apache HTTP Server Version 2.4
Starting Apache
Available Languages: de | en | es | fr | ja | ko | tr
How Apache Starts
If the Listen specified in the configuration file is default of 80 (or any other port below 1024), then it is necessary to have root privileges in order to start apache, so that it can bind to this privileged port. Once the server has started and performed a few preliminary activities such as openin
Errors During Start-up
If Apache suffers a fatal problem during startup, it will write a message describing the problem either to the console or to the ErrorLog before exiting. One of the most common error messages is "Unable to bind to Port ...". This message is usually caused by either:
Starting at Boot-Time
If you want your server to continue running after a system reboot, you should add a call to apache2ctl to your system startup files (typically rc.local or a file in an rc.N directory). This will start Apache as root. Before doing this ensure that your server is properly configured for security and a
Additional Information
Additional information about the command-line options of httpd and apache2ctl as well as other support programs included with the server is available on the Server and Supporting Programs page. There is also documentation on all the modules included with the Apache distribution and the directives th