- Linux
 - 
                        
2012-03-16                                                                     
#!/bin/sh
# httpd: /usr/local/apache2
. /etc/rc.d/init.d/functions
[ -f /usr/local/apache2/bin/apachectl ] || exit 0
case "$1" in
	start)
		# Start daemons.
		/usr/local/apache2/bin/apachectl start
		if [ $? = 0 ] ; then
			echo "httpd starting:" `echo_success`
		else
			echo "httpd starting:" `echo_failure`
		fi
		;;
	stop)
		# Stop daemons.
		/usr/local/apache2/bin/apachectl stop
		if [ $? = 0 ] ; then
			echo "stopping httpd:" `echo_success`
		else
			echo "stopping httpd:" `echo_failure`
		fi
		;;
	restart)
		$0 stop
		$0 start
		;;
	configtest)
		#httpd.conf test
		/usr/local/apache2/bin/apachectl configtest
		;;
	*)
		echo "Usage: `basename $0` {start|stop|restart}" >&2
		exit 64
		;;
esac
exit 0
                    
                    
                    
                
                        3,042 views 
                                                                    
                    
                



