How to start,restart and stop Apache web server

Here we will list some very simple commands to start, restart and stop the Apache web server. Of course, you should take care about the stop command as your websites will stop working.

For starting Apache use:

root@web [/home/admin]# /sbin/service httpd start
httpd (pid 11858) already running
root@web [/home/admin]#

As you can see, if the Appache (httpd service) is already running the system will let you know.

To restart httpd:

root@web [/home/admin]# /sbin/service httpd restart
root@web [/home/admin]#

To stop Apache server :

root@web [/home/admin]# /sbin/service httpd stop
root@web [/home/admin]#