-   Linux - Software (
-   -   Apache Autostart (

gsoft 04-14-2005 11:50 PM

Apache Autostart
I have apache 2.0.53 installed successfully and can start it manually. However I wish to have it to auto start.

However when i copy the apachectl file to /etc/rc.d/init.d and then chkconfig --add httpd i get the error


service httpd does not support chkconfig
Is there a way I can get it to work? So far after searching other users have had problems with auto starting yet no solution posted worked in this situation, and very few post a solution at all just stating that it works.

Boby 04-15-2005 04:15 AM

When I compiled my Apache server, I've edited and added this line to the /etc/rc.d/rc.local file

# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/local/apache2/bin/apachectl start

Sure you need to change the apache folder to the one that coresponds your system.


fuzzyash 04-15-2005 06:52 AM

apachectl is not meant to work with chkconfig. It is a bash script that takes care of starting /usr/sbin/httpd & must be ran from the command line or the system startup scripts. What Boby says will work but if you want to use chkconfig, which I would recommend, then you'll have to make a file that chkconfig knows how to read, which is very easy. chkconfig scripts in /etc/rc.d/init.d don't work unless they start with the correct info that chkconfig is looking for. Check out man chkconfig for how they work.
Personally I like to start everything with chkconfig at boot time because it tells you what is going on during the boot process, you can also choose what to run in what runlevel, which is very handy.
If you get stuck I can post my /etc/rc.d/init.d/httpd file if you would like to copy it. It uses /usr/sbin/apachectl to do the actual starting of httpd but does a lot of checking & configuring so things get setup just right.

gsoft 04-15-2005 09:23 PM

Yea i wanted to use the chkconfig script. I did a search on google and found a chkconfig for httpd and modified it to work with my setup.

Thank you very much for the help. :)

All times are GMT -5. The time now is 08:28 AM.