#!/bin/sh # # apache Apache Web Server # # chkconfig: 345 85 15 # description: Apache is a World Wide Web server. It is used to serve \ # HTML files and CGI. # processname: httpd # pidfile: /var/run/httpd.pid # config: /etc/httpd/conf/access.conf # config: /etc/httpd/conf/httpd.conf # config: /etc/httpd/conf/srm.conf # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Get service config [ -f /etc/sysconfig/apache ] && . /etc/sysconfig/apache # Check that networking is up. if [ "${NETWORKING}" = "no" ]; then echo "WARNING: Networking is down. Apache can't be runed." exit 1 fi # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/httpd ]; then show Starting httpd daemon httpd else echo "httpd already is running" fi touch /var/lock/subsys/httpd ;; stop) show Shutting down httpd killproc httpd rm -f /var/lock/subsys/httpd /var/run/httpd.pid /var/run/httpd.loc* ;; status) status httpd ;; restart|reload) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac exit 0