Configuring Nginx for system service (centos6.4)

Source: Internet
Author: User

Vi/etc/init.d/nginx

Content additions:

1#! /bin/bash
2
3# Chkconfig: * - the
4# Description:nginx is an HTTP (s) server, HTTP (s) reverse
5
6Set-e
7Path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
8Desc="nginx Daemon"
9Name=nginx
Tendaemon=/usr/local/nginx/$NAME
OneScriptname=/etc/init.d/$NAME
A
-Test-x $DAEMON | | Exit0
-
theD_start () {
-$DAEMON | |Echo-N"already running"
-}
-
+D_stop () {
-$DAEMON-S Quit | |Echo-N"Not running"
+}
A
atD_reload () {
-$DAEMON-S Reload | |Echo-N"counld not reload"
-}
-
- Case" $"inch
-Start
in Echo-N"starting $DESC: $NAME"
-D_start
toEcho"."
+;;
-Stop
the Echo-N"stopping $DESC: $NAME"
*D_stop
$Echo"."
Panax Notoginseng;;
-Reload
theEcho-N"Reloading $DESC Configuration ..."
+D_reload
AEcho"Reloaded."
the;;
+Restart
-Echo-N"restarting $DESC: $NAME"
$D_stop
$Sleep2
-D_start
-Echo"."
the;;
-*)
WuyiEcho"Usage: $SCRIPTNAME {start|stop|restart|reload}">&2
theExit3
-;;
WuEsac
-
AboutExit0

Modify the address of the 10th Nginx execution.

Start Nginx:service nginx Start

Stop Nginx:service Nginx Stop

Configuring Nginx for system service (centos6.4)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.