Nginx Restart command Method (Linux,centos,ubuntu) Summary

Source: Internet
Author: User

Original: http://www.111cn.net/sys/nginx/62915.htm

Smooth restart

If the server is running Nginx to upgrade, add or remove modules, we need to stop the server and make corresponding changes, so that the server will stop the service for a period of time, Nginx can be in the case of non-stop operation of the various upgrade actions without affecting the server run

Smooth Restart command:
Kill-hup live in title or process number file path
or use

/usr/nginx/sbin/nginx-s Reload

Note that after modifying the configuration file, it is best to check the correct configuration file, so as not to restart after the Nginx error affecting the stable operation of the server. Determine if the Nginx configuration is the correct command as follows:
Nginx-t-c/usr/nginx/conf/nginx.conf
Or

/usr/nginx/sbin/nginx-t

Nginx Reload Restart

Perform

#/usr/local/nginx/sbin/nginx-s Reload
Nginx has been restarted successfully

Restart with root permission

#killall Nginx

#nginx

Linux restart

Sudo/etc/init.d/nginx Usage:
/etc/init.d/nginx {Start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}


(Nginx Windows Edition)

@echo off
Effects of REM Current bat

Echo ==================begin========================

Cls
SET Nginx_path=d:
SET nginx_dir=d:\nginx\
Color 0a
TITLE Nginx Management Program Www.111cn.net Control Panel

Cls

ECHO.
ECHO. * Nginx Management Program *
ECHO. * Created 2013-10-15 *
ECHO.

: MENU

ECHO. * Nginx Process List *
tasklist|findstr/i "Nginx.exe"

ECHO.
ECHO. [1] Start Nginx
ECHO. [2] Close Nginx
ECHO. [3] Restart Nginx
ECHO. [4] Exit
ECHO.

ECHO. Please enter the serial number of the selected item:
set/p id=
IF "%id%" = = "1" GOTO start
IF "%id%" = = "2" GOTO stop
IF "%id%" = = "3" GOTO restart
IF "%id%" = = "4" EXIT
PAUSE

: Start
Call:startnginx
GOTO MENU

: Stop
Call:shutdownnginx
GOTO MENU

: Restart
Call:shutdownnginx
Call:startnginx
GOTO MENU

: Shutdownnginx
ECHO.
ECHO. Close Nginx ...
taskkill/f/im nginx.exe > nul
ECHO. OK, close all nginx processes
Goto:eof

: Startnginx
ECHO.
ECHO. Start Nginx ...
IF not EXIST "%nginx_dir%nginx.exe" ECHO "%nginx_dir%nginx.exe" does not exist

%nginx_path%

CD "%nginx_dir%"

IF EXIST "%nginx_dir%nginx.exe" (
echo "Start" ' Nginx.exe '
Start "" Nginx.exe
)
ECHO. Ok
Goto:eof

Centos Nginx reboot

Re-start Nginx

Service Nginx Restart
/etc/init.d/nginx stop
/etc/init.d/nginx start

Ubuntu Nginx

$sudo Service Nginx Start
$sudo Service Nginx Stop

Okay, all right? Summarize the method of using Nginx system restart in almost all systems, each system will be a little bit different. Oh, interested friends can enter the reference bar.

Nginx Restart command Method (Linux,centos,ubuntu) Summary

Related Article

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.