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 on

That’s it! Now Apache will start when the computer starts up.

Posted in  | 1 comment

Comments

  1. spadefinger said 295 days later:

    Thank you.

(leave url/email »)

   Comment Markup Help Preview comment