3 # apache Apache Web Server
6 # description: Apache is a World Wide Web server. It is used to serve \
9 # pidfile: /var/run/apache.pid
10 # config: /etc/apache/apache.conf
13 # Source function library
14 . /etc/rc.d/init.d/functions
17 . /etc/sysconfig/network
20 [ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25 msg_network_down "Apache 1.3 Web Server"
32 if is_no "${IPV6_NETWORKING}"; then
33 HTTPD_OPTS="$HTTPD_OPTS -4"
37 /usr/sbin/apache -t > /dev/null 2>&1
42 # Check if the service is already running?
43 if [ -x /usr/lib/apache1/lingerd ]; then
44 if [ ! -f /var/lock/subsys/lingerd ]; then
45 msg_starting "Apache Lingerd"
46 SERVICE_UMASK=002 daemon --user http /usr/lib/apache1/lingerd
48 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lingerd
50 msg_already_running "Apache Lingerd"
53 if [ ! -f /var/lock/subsys/apache ]; then
54 msg_starting "Apache 1.3 Web Server"
55 daemon /usr/sbin/apache $HTTPD_OPTS
57 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/apache
59 msg_already_running "Apache 1.3 Web Server"
65 if [ -f /var/lock/subsys/apache ]; then
66 msg_stopping "Apache 1.3 Web Server"
67 killproc --pidfile /var/run/apache.pid apache
68 rm -f /var/lock/subsys/apache /var/run/apache.pid /var/run/apache.loc* >/dev/null 2>&1
70 msg_not_running "Apache 1.3 Web Server"
72 if [ -x /usr/lib/apache1/lingerd ]; then
73 if [ -f /var/lock/subsys/lingerd ]; then
74 msg_stopping "Apache Lingerd"
75 /usr/lib/apache1/lingerd -k && ok || fail
76 rm -f /var/lock/subsys/lingerd >/dev/null 2>&1
78 msg_not_running "Apache Lingerd"
85 if [ $RETVAL -eq 0 ]; then
90 echo >&2 "Configuration file syntax test failed. Run $0 configtest to see errors."
97 if [ -f /var/lock/subsys/apache ]; then
98 msg_reloading "Apache 1.3 Web Server"
101 if [ $RETVAL -eq 0 ]; then
102 killproc --pidfile /var/run/apache.pid apache -$sig
106 echo >&2 "Configuration file syntax test failed. Run $0 configtest to see errors."
109 msg_not_running "Apache 1.3 Web Server"
115 # See how we were called.
127 if [ -f /var/lock/subsys/apache ]; then
130 msg_not_running "Apache 1.3 Web Server"
151 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|graceful|configtest|status}"