nginx 启动

./configure --prefix=/usr/local/webserver/nginx --user=daemon --group=daemon --with-rtsig_module --with-select_module --with-poll_module --with-file-aio --with-http_ssl_module --with-http_realip_module  --with-http_realip_module --with-http_addition_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module  --with-http_flv_module --with-http_random_index_module  --with-http_secure_link_module  --with-http_degradation_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --without-mail_pop3_module  --without-mail_imap_module --without-mail_smtp_module --with-pcre --with-zlib=/tmp/zlib-1.2.7 --with-openssl=/tmp/openssl-0.9.8r


PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DESC="nginx daemon"

NAME=nginx

DAEMON=/usr/local/webserver/nginx/sbin/$NAME

SCRIPTNAME=/etc/init.d/$NAME

# If the daemon file is not found, terminate the script.

test -x $DAEMON || exit 0

d_start() {

    $DAEMON || echo -n " already running"

}

d_stop() {

    $DAEMON -s quit || echo -n " not running"

}

d_reload() {

    $DAEMON -s reload || echo -n " could not reload"

}

case "$1" in

    start)

        echo -n "Starting $DESC: $NAME"

        d_start

        echo "."

        ;;

    stop)

        echo -n "Stopping $DESC: $NAME"

        d_stop

        echo "."

        ;;

    reload)

        echo -n "Reloading $DESC configuration..."

        d_reload

        echo "reloaded."

        ;;

    restart)

        echo -n "Restarting $DESC: $NAME"

        d_stop

        # Sleep for two seconds before starting again, this should give the

        # Nginx daemon some time to perform a graceful stop.

        sleep 2

        d_start

        echo "."

        ;;

    *)

        echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2

        exit 3

        ;;

esac

exit 0

猜你喜欢

转载自xiaolaogong.iteye.com/blog/1698070
今日推荐