【啓動】
啓動代碼格式:nginx安裝目錄地址 -c nginx配置文件地址
例如:html
[root@LinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.confnginx
【中止】
nginx的中止有三種方式:vim
從容中止
一、查看進程號
[root@LinuxServer ~]# ps -ef|grep nginx
二、殺死進程
[root@LinuxServer ~]# kill -QUIT 2072服務器
快速中止
一、查看進程號
[root@LinuxServer ~]# ps -ef|grep nginx
二、殺死進程
[root@LinuxServer ~]# kill -TERM 2132
或 [root@LinuxServer ~]# kill -INT 2132app
強制中止
[root@LinuxServer ~]# pkill -9 nginxtcp
【重啓】
一、驗證nginx配置文件是否正確
方法一:進入nginx安裝目錄sbin下,輸入命令./nginx -tspa
看到以下顯示nginx.conf syntax is okrest
nginx.conf test is successfulhtm
說明配置文件正確!blog
方法二:在啓動命令-c前加-t
二、重啓Nginx服務
方法一:進入nginx可執行目錄sbin下,輸入命令./nginx -s reload 便可
方法二:查找當前nginx進程號,而後輸入命令:kill -HUP 進程號 實現重啓nginx服務 (kill -HUP 主進稱號或進程號文件路徑 )
http://www.cnblogs.com/codingcloud/p/5095066.html
nginx配置新的局域網對外項目:service iptables status 查看服務器內網端口占用狀況service iptables 查看操做命令service iptables statsvim /etc/sysconfig/iptables 編輯或新增防火牆端口,例如新增:-A INPUT -p tcp -m state --state NEW -m tcp --dport 8006 -j ACCEPTservice iptables restart 重啓防火牆cd /Data/apps/nginx/llcd conf/llcd vhost.d/llcp 8005.dev.orayun.com.conf 8006.confvim 8006.conf 而後修改端口和項目路徑