3 # apache Apache Web Server
6 # description: Apache is a World Wide Web server. It is used to serve \
9 # pidfile: /var/run/httpd.pid
10 # config: /etc/httpd/conf/access.conf
11 # config: /etc/httpd/conf/httpd.conf
12 # config: /etc/httpd/conf/srm.conf
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
22 [ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
24 # Check that networking is up.
25 if is_yes "${NETWORKING}"; then
26 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
27 # nls "ERROR: Networking is down. %s can't be run." <service>
28 msg_network_down httpd
35 [ -z "$HTTPD_MPM" ] && HTTPD_MPM="prefork"
38 # See how we were called.
41 # Check if the service is already running?
42 if [ ! -f /var/lock/subsys/httpd ]; then
43 msg_starting httpd.${HTTPD_MPM}
44 daemon httpd.${HTTPD_MPM} -f /etc/httpd/httpd.conf $HTTPD_OPTS
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/httpd
48 msg_already_running httpd.${HTTPD_MPM}
53 if [ -f /var/lock/subsys/httpd ]; then
54 msg_stopping httpd.${HTTPD_MPM}
55 daemon httpd.${HTTPD_MPM} -f /etc/httpd/httpd.conf -k stop
56 rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* >/dev/null 2>&1
58 msg_not_running httpd.${HTTPD_MPM}
62 status httpd.${HTTPD_MPM}
64 /usr/sbin/httpd.${HTTPD_MPM} -f /etc/httpd/httpd.conf -S
70 reload|force-reload|graceful)
71 if [ -f /var/lock/subsys/httpd ]; then
72 msg_reloading httpd.${HTTPD_MPM}
73 daemon httpd.${HTTPD_MPM} -f /etc/httpd/httpd.conf -k graceful
76 msg_not_running httpd.${HTTPD_MPM} >&2
81 msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"