日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

Nginx基本命令

發布時間:2024/1/1 Nginx 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Nginx基本命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、Nginx幫助命令

nginx -h

[root@VM_0_2_centos sbin]# ./nginx -h#nginx版本號 nginx version: nginx/1.15.12#使用方法 Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]#參數說明 Options:-?,-h : this help #幫助指令-v : show version and exit #查看版本后退出-V : show version and configure options then exit #查看版本和環境參數然后退出-t : test configuration and exit #測試配置參數是否正確-T : test configuration, dump it and exit #測試配置參數并且打印到終端-q : suppress non-error messages during configuration testing #在檢測配置文件期間只顯示錯誤信息-s signal : send signal to a master process: stop, quit, reopen, reload #使用信號控制Nginx進程停止、放棄、重啟、重新讀取配置-p prefix : set prefix path (default: /data/software/nginx/) #設備Nginx的存放路徑-c filename : set configuration file (default: conf/nginx.conf) #讀取配置參數路徑-g directives : set global directives out of configuration file #指定附加配置的路徑

2、Nginx啟動命令

nginx

[root@VM_0_2_centos sbin]# ./nginx [root@VM_0_2_centos sbin]# ps -ef | grep nginx root 20731 1 0 10:50 ? 00:00:00 nginx: master process ./nginx nobody 20732 20731 0 10:50 ? 00:00:00 nginx: worker process

3、Nginx停止命令

nginx -s stop

[root@VM_0_2_centos sbin]# ./nginx -s stop [root@VM_0_2_centos sbin]# ps -ef | grep nginx root 20917 16297 0 10:51 pts/1 00:00:00 grep --color=auto nginx

4、Nginx重啟

nginx -s reopen # Nginx進程之前必須存在 該過master進程和work進程不變

[root@VM_0_2_centos sbin]# ./nginx -s reopen [root@VM_0_2_centos sbin]# ps -ef | grep nginx root 21218 1 0 10:53 ? 00:00:00 nginx: master process ./nginx nobody 21219 21218 0 10:53 ? 00:00:00 nginx: worker process

5、重新加載配置文件

nginx -s reload # Nginx進程之前必須存在,該過程master進程不變,但是work進程會重啟

[root@VM_0_2_centos sbin]# ./nginx -s reload [root@VM_0_2_centos sbin]# ps -ef | grep nginx root 21218 1 0 10:53 ? 00:00:00 nginx: master process ./nginx nobody 25522 21218 0 11:16 ? 00:00:00 nginx: worker process

6、指定配置文件

nginx -c /conf/nginx.conf

[root@VM_0_2_centos sbin]# ./nginx -c /data/software/nginx/conf/nginx.conf [root@VM_0_2_centos sbin]# ps -ef | grep nginx root 28787 1 0 11:33 ? 00:00:00 nginx: master process ./nginx -c /data/software/nginx/conf/nginx.conf nobody 28788 28787 0 11:33 ? 00:00:00 nginx: worker process root 28801 16297 0 11:33 pts/1 00:00:00 grep --color=auto nginx

7、測試配置文件正確性

nginx -t

[root@VM_0_2_centos sbin]# ./nginx -t #表示配置文件ok,如果錯誤會輸入文件哪一行錯誤 nginx: the configuration file /data/software/nginx/conf/nginx.conf syntax is ok nginx: configuration file /data/software/nginx/conf/nginx.conf test is successful

總結

以上是生活随笔為你收集整理的Nginx基本命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。