'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.

If you found this post helpful, please consider sharing to your network. I'm also available to help you be successful with your distributed systems! Please reach out if you're interested in working with me, and I'll be happy to schedule a free one-hour consultation.