カテゴリー
SugiBlog Webデザイナー・プログラマーのためのお役立ちTips

apache 起動スクリプト

この記事は最終更新日から1年以上経過しています。
#!/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
この記事がお役に立ちましたらシェアお願いします
2,734 views

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です