sudo ./apachectl restart
Any suggestions would be very appreciated. Thanks!
/etc/init.d
and then linked to the appropriate /etc/rcN.d
or /etc/rc.d/rcN.d
directory. Local initialization is done in the file /etc/rc.local
. Scripts in the rcN.d
directories that begin with the letter S
are run when the system enters run level N
to start services, and those that begin with the letter K
are run to kill services. Most Unix servers will be running in run level 3 or run level 5. httpd
; this is located in /etc/init.d
. Then in /etc/rc3.d
, /etc/rc4.d
and /etc/rc5.d
there are symbolic links pointing back to this that start apache. Each of these is called S87httpd
(the number just controls the order in which the scripts are run).apachectl
script to /etc/init.d
, e.g., # cp apachectl /etc/init.d/apacheand then make symbolic links in the appropriate rc directories, e.g.,
# cd /etc/rc3.d; ln -s ../init.d/apache ./S99apache(on some systems, it may be necessary to change the above to
# cd ../rc4.d; ln -s ../init.d/apache ./S99apache
# cd ../rc5.d; ln -s ../init.d/apache ./S99apache
cd /etc/rc.d/rc3.d
and the link command to ln -s ../../init.d/apache ./S99apache
). I arbitrarily picked S99 so that apache would then start at the end of the process./etc/rc.local
by adding a line at the end of that file to start it, e.g., /path/to/apachectl start
.Now set up things so that Apache starts automatically at boot up.
# cd /etc/init.d # cp boot.local boot.local.bak1 # kwrite boot.localand add the line
/usr/local/apache2/bin/apachectl startto the end of the file. Then save the file and quit.