Click to See Complete Forum and Search --> : Apache 2.0 No Init.d creation?!


airedalez
03-04-2004, 12:08 AM
I just installed Apache 2.0 and was amazed to find no documentation on creating an init.d startup script or including one with it...

Can someone point me in the correct direction for setting this up?

j79zlr
03-04-2004, 12:24 AM
what distro? Should create one during installation.

airedalez
03-04-2004, 01:06 AM
It actually is being compiled from source... so I doubt it matters, but I am on Fedora 1

j79zlr
03-04-2004, 02:29 AM
Well here is mine for FreeBSD, should be similar, it is in /usr/local/etc/rc.d, I would bet that linux puts it in /etc/rc.d

Modify the prefix as necessary, and make sure it is executable.

#!/bin/sh
PREFIX=/usr/local

case "$1" in
start)
[ "ssl" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt" ] && SSL=ssl
[ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start${SSL} > /dev/null && echo -n ' apache2'
;;
stop)
[ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > /dev/null && echo -n ' apache2'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac

exit 0

airedalez
03-04-2004, 10:25 AM
I appreciate that greatly.

Is there some site or resource that has documentation on this stuff that I can read up on?

Also what language are these startup scripts being written in?

mdwatts
03-04-2004, 01:40 PM
Originally posted by airedalez

Is there some site or resource that has documentation on this stuff that I can read up on?


Just search Google for Linux for anything you like just as I did for 'fedora apache startup script. (http://www.linux-sxs.org/internet_serving/apache2.html). You will see that Fedora should already include a rpm package of Apache 2.0.47 that has the proper startup script.

mdwatts
03-04-2004, 02:28 PM
https://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/s1-apache-startstop.html may be of some help.