LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Script for Apache on Boot (https://www.linuxquestions.org/questions/linux-newbie-8/script-for-apache-on-boot-23421/)

boyinfrance 06-14-2002 12:50 PM

Script for Apache on Boot
 
I know this is a stupid question but I am a :newbie: and don't know how.

Ok.

How would I create a script to start apache on boot?
I installed it from source to

/usr/local/apache2

Help!

sewer_monkey 06-14-2002 03:03 PM

Why from source? If you installed from RPM (you're using Mandrake, right?), you wouldn't have to write a script... To find RPMs, go here.

In your current situation, you can try (as root) the command "apachectl start". If you want this to happen at boottime, add the command to /etc/rc.local, somewhere at the bottom of that file.

pk21 06-15-2002 03:40 AM

Or you can always modify the crontab file.

neo77777 06-15-2002 11:07 PM

you need a symlink in /etc/rc?.d
? - is for runlevel you are booting into
the symlink is
ln -s /usr/local/apache2/bin/apachectl /etc/rc?.d/S15httpd
and another similar link in /etc/rc6.d to shutdown apache properly on system reboot
ln -s /usr/local/apache2/bin/apachectl /etc/rc6.d/K15httpd
here 15 is a sequence number, see in /etc/rc?.d/ directory if it is not taken by anything else if it is taken pick the one which is not yet taken. The same in rcd.0 on system shutdown

boyinfrance 06-16-2002 06:19 AM

All I want is a one liner to start apache. The problem is I want to go into su and start apache with just one line and I can't figure out how.
Help!?!

acid_kewpie 06-16-2002 06:25 AM

neo7777 has the CORRECT way to do it, but if you really want to do it your way, i.e. the WRONG way, you'd just put a line in /etc/rc.local, which is run with root permissions on boot.


All times are GMT -5. The time now is 05:07 AM.