Network Administration: Starting and Stopping Apache

In most cases, Apache is installed and configured automatically when you install Linux. The Apache daemon httpd must be started on your Linux server for the service to begin operating. From a command shell, use this command:

service httpd start

Whenever you make a configuration change, you should stop and restart the service with this command:

service httpd restart

If you prefer, you can stop and start the service with separate commands:

service httpd stop
service httpd start

If you’re not sure if Apache is running, enter this command:

service httpd status

You get a message indicating whether the httpd daemon is running.

To configure Apache to start automatically when you start Linux, use this command:

chkconfig --level 35 httpd on

To make sure that the chkconfig command worked right, enter this command:

chkconfig --list httpd

You should see output similar to the following:

httpd    0:off  1:off  2:off  3:on   4:off  5:on   6:off