'Redhat/Centos: Control Apache Startup with Chkconfig'

Copy apachectl (or symlink it) to /etc/init.d/httpd, and add these two lines at the end of the comment section:
chkconfig: 2345 64 36
description: script for starting and stopping httpd
chkconfig –add httpd
These commands will now work:
service httpd start service httpd stop
Additionally, apache will start when the system boots. You can accomplish this by using rc.local too, if you prefer, but I think it’s more convenient to have everything be service based where you can use chkconfig to manage startup / shutdown.
Copy apachectl (or symlink it) to /etc/init.d/httpd, and add these two lines at the end of the comment section:
chkconfig: 2345 64 36
description: script for starting and stopping httpd
chkconfig –add httpd
These commands will now work:
service httpd start service httpd stop
Additionally, apache will start when the system boots. You can accomplish this by using rc.local too, if you prefer, but I think it’s more convenient to have everything be service based where you can use chkconfig to manage startup / shutdown.
Related Posts
'Linux/OSX: find out what network ports are in use'
Using Kickstart to Automate CentOS VM Creation
Need Expert Help with Apache Cassandra?
Get professional consulting for your distributed systems challenges. Performance optimization, architecture design, and troubleshooting.