Nginx常用指令

WBOY
發布: 2016-08-08 09:23:55
原創
846 人瀏覽過
1. 啟動Nginx         sudo ./sbin/nginx -s quit
-s都是採用向Nginx 發送訊號的方式。
3. Nginx 重載設定
poechant@ubuntu:sudo ./sbin/nginx -s reload
上述是採用向Nginx 發送訊號的方式,或使用:
poechant@ubuntu:service nginx reload
4. 指定檔案
4. poechant@ubuntu:sudo ./sbin/nginx -c /usr/local/nginx/conf/nginx.conf
-c表示configuration,指定設定檔。
5. 查看 Nginx 版本
有兩種可以查看 Nginx 的版本資訊的參數。第一種如下:
poechant@ubuntu:/usr/local/nginx$ ./sbin/nginx -v
nginx: nginx version: nginx/1.0.0
另一種顯示的是詳細的版本資訊:
poechant@ ubuntu:/usr/local/nginx$ ./sbin/nginx -V
nginx: nginx version: nginx/1.0.0
nginx: built by gcc 4.3.3 (Ubuntu 4.3.3-5ubpatu enabled
nginx: configure arguments: --with-http_ssl_module --with-openssl=/home/luming/openssl-1.0.0d/
6. 檢查設定檔是否正確
poechant@ubuntu:/usr/local/nginx$ . /sbin/nginx -t
nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)
nginx: the configuration file// usr/local/nginx/conf/nginx.conf syntax is ok
2012/01/09 16:45:09 [emerg] 23898#0: open() "/usr/local/nginx/logs/nginx.pid" failed (13: Permission denied)
nginx: configuration file /usr/local/nginx/conf/nginx.conf
test
failed
如果出現如上的提示訊息,表示沒有存取錯誤
日誌
檔案和進程,可以sudo(super user do)一下:poerchant@ubuntu:/usr/local/nginx$ sudo ./sbin/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful設定檔正確。否則,會有相關提示。 7. 顯示幫助資訊poechant@ubuntu:/user/local/nginx$ ./sbin/nginx -h
或:
poechant@ubuntu:/user/local/nginx$ ./sbin/nginx -g


[root@centos-1-22 sbin]# ./nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file/usr/local/nginx/
nginx: configuration file/usr/local/nginx/conf /nginx.conf test is successful
[root@centos-1-22 sbin]# ./nginx -h
nginx version: nginx/1.0.15 sbin]# ./nginx -h
nginx version: nginx/1.0.15
Usage: nginx [-?hvVtq] [-s signal] [-Usage: nginx [-?hvVtq] [-s signal] [- filename] [-p prefix] [-g directives]
Options:
  -?,-h         : this help
  -v         : show version and configure options then exit
  -t            : test configuration and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal
  -s signal     : send signal to a master pros:  : set prefix path (default: /usr/local/nginx/ )
  -c filename   : set configuration file (default: conf/nginx.conf)
  -g directives : set global directives out of configuration file
 發送訊號的相關命令,我們會在後續看到。

以上就介紹了Nginx常用指令,包括了方面的內容,希望對PHP教學有興趣的朋友有幫助。


相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!