Help - Search - Members - Calendar
Full Version: How do I start "/usr/local/apache2/bin/apachectl start&
The Planet Forums > Operating Systems > Red Hat Linux
mynameisboring
How do I start "/usr/local/apache2/bin/apachectl start" at boot time. Yes I know its done in /etc/rc.d but I need some help after running the following command without success

chkconfig --add /usr/local/apache2/bin/apachectl

Can someone please tell me what to do icon_cry.gif

I'm running RH Ent 3, without cPanel.
tekprio
Have you tried putting "/usr/local/apache2/bin/apachectl start" in /etc/rc.local ?

That should do what you want.
djc
The proper way to start services at boot time is with the chkconfig tool. It will add the proper start and kill scripts for you in the /etc/rc.d/rc.X directories.

When you installed apache, it should have come with an init script (if you built from source, it's in $HTTP_SOURCE/build/rpm/httpd.init. If you used an RPM it should be at /etc/init.d/httpd already ). If the script is in /etc/init.d/ you should be able to run:

CODE
/sbin/chkconfig --add httpd


and that will add the httpd service to the default runlevel (3) so when your machine starts up, apache does too. It will also shut down apache properly if the machine needs to come down.

HTH

Dan


QUOTE (tekprio)
Have you tried putting "/usr/local/apache2/bin/apachectl start" in /etc/rc.local ?

That should do what you want.
tekprio
The above poster is correct of course. I had assumed that you specifically want to run apachectl for some reasons and not simply want to start apache the usual way.

In any case, /etc/rc.local is where you put commands to run at start up time, after all services had been started.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.