25.3. Starting and Stopping httpd
After installing the
httpdpackage, review the Apache HTTP Server's documentation available online at http://httpd.apache.org/docs/2.2/.
httpdRPM installs the
/etc/init.d/httpdscript, which can be accessed using the
apachectlcontrol script sets the environmental variables in
httpd. You can also set the environment variables using the init script.
To start the server using the
apachectlcontrol script as root type:
You can also start
/sbin/service httpd start. This starts
httpdbut does not set the environment variables. If you are using the default
httpd.conf, which is port 80, you will need to have root privileges to start the apache server.
To stop the server, as root type:
You can also stop
/sbin/service httpd stop. The
restartoption is a shorthand way of stopping and then starting the Apache HTTP Server.
You can restart the server as root by typing:
service httpd restart
Apache will display a message on the console or in the
ErrorLogif it encounters an error while starting.
By default, the
httpdservice does not start automatically at boot time. If you would wish to have Apache startup at boot time, you will need to add a call to
apachectlin your startup files within the
rc.Ndirectory. A typical file used is
rc.local. As this starts Apache as root, it is recommended to properly configure your security and authentication before adding this call.
You can also configure the
httpdservice to start up at boot time, using an initscript utility, such as
/sbin/chkconfig, /usr/sbin/ntsysv, or the Services Configuration Tool program.
You can also display the status of your httpd server by typing:
The status module
mod_statushowever needs to be enabled in your
httpd.confconfiguration file for this to work. For more details on
mod_statuscan be found on http://httpd.apache.org/docs/2.2/mod/mod_status.html.
If running the Apache HTTP Server as a secure server, the secure server's password is required after the machine boots when using an encrypted private SSL key.
You can find more information on http://httpd.apache.org/docs/2.2/ssl