Start a Script with Root Permission on Startup?

kainjow

Registered
I run a Subversion server, and need to start the Apache program on startup, but it needs root permission (sudo) to launch properly. Is there a way to do this, by storing the root password or something, so it is automatic?

I just need to run this at login/startup:
Code:
sudo /usr/local/apache/bin/apachectl start
Thanks.
 

donkeytonk

Registered
Here's what I did to have Apache 2 start automatically at boot. Substitute Apache2 for whatever version you've installed:
1. Edit /etc/hostconfig - Add Apache2 to list of hosts (with =-YES-)
2. /System/Library/StartupItems/ - Copy Apache folder to Apache2
3. Edit file details to new Apache2 details (e.g. /usr/local/apache2/conf/httpd.conf,
/usr/local/apache2/bin/apachectl, etc.).
-- I simplified this file (I didn't need the various conditional statements)

--Dylan
 
Top