centos7安裝nginx1.12.2步驟指南

安裝nginx

下載

從公司機器下載nginx-1.12.2-1.el7_4.ngx.x86_64.rpmhtml

或者:http://nginx.org/download/ nginx安裝包下載地址。nginx

安裝

[nginx[@test2](https://my.oschina.net/u/1253032) ~]$ rpm -ivh nginx-1.12.2-1.el7_4.ngx.x86_64.rpm
warning: nginx-1.12.2-1.el7_4.ngx.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)

解決:用root用戶。測試

用root安裝

[root[@test2](https://my.oschina.net/u/1253032) nginx]# rpm -ivh nginx-1.12.2-1.el7_4.ngx.x86_64.rpm
warning: nginx-1.12.2-1.el7_4.ngx.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:nginx-1:1.12.2-1.el7_4.ngx       ################################# [100%]
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* http://nginx.org/en/support.html

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------

訪問nginx主頁

http://10.13.22.19:80.net

目錄

  1. 配置所在目錄:/etc/nginx/
  2. PID目錄:/var/run/nginx.pid
  3. 錯誤日誌:/var/log/nginx/error.log
  4. 訪問日誌:/var/log/nginx/access.log
  5. 默認站點目錄:/usr/share/nginx/html

經常使用命令

  1. 啓動nginx:nginx
  2. 重啓nginx(不殺進程,從新加載nginx.conf):killall -HUP nginx
  3. 中止nginx:nginx -s stop
  4. 測試nginx配置:nginx -t
相關文章
相關標籤/搜索