Automatically starting Apache with chkconfig
Posted by Max Dunn Tue, 20 Mar 2007 15:44:00 GMT
It is interesting that Apache 2.2 doesn’t include a startup script that is compatible with the Linux ‘chkconfig’ command. Here is how you fix this:
First, add this information to the top of /usr/local/apache2/bin/apachectl:
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. \
# It is used to serve HTML files and CGI.Then change to /etc/init.d and do:
sudo ln -s /usr/local/apache2/bin/apachectl httpd
sudo /sbin/chkconfig --add httpd
sudo /sbin/chkconfig --level 2345 httpd onThat’s it! Now Apache will start when the computer starts up.
Thank you.
Useful hint.
Fabulous! Thanks. jstromgren
Thank you
works with Apache 2.2 kubutu 8.01
here are the first 3 lines of my apachectl
#!/bin/sh #chkconfig: -85 15 #description: WWW Server
then in the /etc/init.d
$ sudo ln -s /usr/local/apache2/bin /apache2 $ sudo chkconfig—add apache2 sudo chkconfig—level 2345 apache2 on