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! |
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. |
Or you can always modify the crontab file.
|
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 |
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!?! |
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 01:37 AM. |