#!/bin/sh # # # chkconfig: 35 99 01 # # description: Apache HTTP Server # processname: /home/$USER/apache2/bin/apachectl # ####サービスユーザ名を記入#### USER=hogehoge PID="/home/$USER/apache2/logs/httpd.pid" ############################## case "$1" in start) /home/$USER/apache2/bin/apachectl start ;; graceful) /home/$USER/apache2/bin/apachectl graceful ;; stop) /home/$USER/apache2/bin/apachectl stop ;; restart) /home/$USER/apache2/bin/apachectl restart ;; status) /home/$USER/apache2/bin/apachectl status ;; configtest) /home/$USER/apache2/bin/apachectl configtest ;; reload) HTTPD=`cat $PID` kill -HUP $HTTPD ;; *) echo "Usage: `basename $0` {start|graceful|stop|restart|status|configtest|reload}" >&2 ;; esac exit 0 TIPS: あとは各apacheをインストールしたbinディレクトリ配下にあるapachectlをcase文で引数を与える。 |