成人无码视频,亚洲精品久久久久av无码,午夜精品久久久久久毛片,亚洲 中文字幕 日韩 无码

資訊專欄INFORMATION COLUMN

CentOs7.3 編譯安裝 Nginx 1.9.9

endiat / 2696人閱讀

摘要:默認情況下,該模塊沒有被構建。使用時,需要從網站下載庫的源碼版本并解壓,剩下的就交給的和來完成。正則表達式使用在指令和模塊中。在默認就啟用的網絡傳輸壓縮模塊時需要使用。

CentOs7.3 編譯安裝 Nginx 1.9.9 安裝 安裝依賴
$ yum install -y  gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel
下載并解壓
$ cd /opt/
$ wget http://nginx.org/download/nginx-1.9.9.tar.gz
$ tar zxvf nginx-1.9.9.tar.gz
編譯

編譯時候可以指定編譯參數(shù),參考文章尾部:常用編譯選項

$ cd nginx-1.9.9
$ ./configure 
安裝
$ make
$ make && make install

默認安裝在/usr/local/nginx

里面有四個目錄:

conf: 配置文件夾,最重要文件是nginx.conf

html: 靜態(tài)網頁文件夾

logs: 日志文件夾

sbin: nginx 的可執(zhí)行文件,啟動、停止等操作

常用命令 正確性檢查

每次修改nginx配置文件后都要進行檢查

$ /usr/local/nginx/sbin/nginx -t
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
啟動
$ /usr/local/nginx/sbin/nginx

如果不能訪問,檢查防火墻并關閉防火墻

centos 6.x 關閉 iptables

$ service iptables status # 查詢防火墻狀態(tài)命令
$ service iptables stop # 關閉命令

centos 7.x 關閉firewall

$ ssystemctl status  firewalld.service # 查看狀態(tài)
$ systemctl stop firewalld.service # 停止firewall

瀏覽器輸入本機IP ,看到如下內容證明安裝成功

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.
停止
$ /usr/local/nginx/sbin/nginx -s stop
重啟
$ /usr/local/nginx/sbin/nginx -s reload
常用編譯選項
./configure 
--prefix=/home/nginx 
--sbin-path=/usr/sbin/nginx 
--user=nginx 
--group=nginx 
--conf-path=/etc/nginx/nginx.conf 
--error-log-path=/home/log/nginx/error.log 
--http-log-path=/home/log/nginx/access.log 
--with-http_ssl_module 
--with-http_gzip_static_module 
--with-http_stub_status_module 
--with-http_realip_module 
--pid-path=/home/run/nginx.pid 
--with-pcre=/home/software/pcre-8.35 
--with-zlib=/home/software/zlib-1.2.8 
--with-openssl=/home/software/openssl-1.0.1i
選項說明
--prefix=/home/nginx  Nginx安裝的根路徑,所有其它路徑都要依賴該選項
--sbin-path=/usr/sbin/nginx  nginx的可執(zhí)行文件的路徑(nginx)
--user=nginx  worker進程運行的用戶
--group=nginx  worker進程運行的組
--conf-path=/etc/nginx/nginx.conf   指向配置文件(nginx.conf)
--error-log-path=/var/log/nginx/error.log  指向錯誤日志目錄
--http-log-path=/var/log/nginx/access.log   設置主請求的HTTP服務器的日志文件的名稱
--with-http_ssl_module   使用https協(xié)議模塊。默認情況下,該模塊沒有被構建。前提是openssl與openssl-devel已安裝
--with-http_gzip_static_module   啟用ngx_http_gzip_static_module支持(在線實時壓縮輸出數(shù)據(jù)流)
--with-http_stub_status_module   啟用ngx_http_stub_status_module支持(獲取nginx自上次啟動以來的工作狀態(tài))
--with-http_realip_module   啟用ngx_http_realip_module支持(這個模塊允許從請求標頭更改客戶端的IP地址值,默認為關)
--pid-path=/var/run/nginx.pid   指向pid文件(nginx.pid)

設置PCRE庫的源碼路徑,如果已通過yum方式安裝,使用–with-pcre自動找到庫文件。使用–with-pcre=PATH時,需要從PCRE網站下載pcre庫的源碼(版本4.4 – 8.30)并解壓,剩下的就交給Nginx的./configure和make來完成。perl正則表達式使用在location指令和 ngx_http_rewrite_module模塊中。
--with-pcre=/home/software/pcre-8.35  

指定 zlib(版本1.1.3 – 1.2.5)的源碼解壓目錄。在默認就啟用的網絡傳輸壓縮模塊ngx_http_gzip_module時需要使用zlib 。
--with-zlib=/home/software/zlib-1.2.8 

指向openssl安裝目錄
--with-openssl=/home/software/openssl-1.0.1i
Contact

作者:鵬磊

出處:http://www.ymq.io

Email:admin@souyunku.com

版權歸作者所有,轉載請注明出處

Wechat:關注公眾號,搜云庫,專注于開發(fā)技術的研究與知識分享

文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉載請注明本文地址:http://m.hztianpu.com/yun/40551.html

相關文章

  • Ubuntu 17.04 編譯安裝 Nginx 1.9.9 配置 https 免費證書

    摘要:編譯安裝配置免費證書安裝安裝依賴下載并解壓編譯安裝默認安裝在里面有四個目錄配置文件夾,最重要文件是靜態(tài)網頁文件夾日志文件夾的可執(zhí)行文件,啟動停止等操作常用命令正確性檢查每次修改配置文件后都要進行檢查啟動瀏覽 Ubuntu 17.04 編譯安裝 Nginx 1.9.9 配置 https 免費證書 安裝 Nginx 安裝依賴 $ apt-get update $ apt-get insta...

    sevi_stuo 評論0 收藏0
  • 虛擬機上Centos7開發(fā)環(huán)境搭建(編譯安裝LNMP,多版本PHP共存,PHP擴展安裝

    摘要:安裝系統(tǒng)本次安裝的是的最小化版本,以下操作在用戶下進行。在搭建完該環(huán)境后,筆者使用作為開發(fā),配置使其可以直接調試虛擬機上的代碼即開發(fā)環(huán)境下代碼是運行在虛擬機上的。通過該方法,可以最大程度地確保開發(fā)環(huán)境與生產環(huán)境的一致性。 安裝系統(tǒng) 本次安裝的是Centos7.3的最小化版本,以下操作在root用戶下進行。在搭建完該環(huán)境后,筆者使用phpstorm作為開發(fā)ide,配置phpstorm使其...

    zhangke3016 評論0 收藏0
  • CentOS7.3 安裝配置 Nginx、MariaDB、PHP

    摘要:編譯提示如下成功離開目錄檢查是否安裝成功執(zhí)行如下命令啟動,并用命令檢查啟動情況添加到系統(tǒng)服務增加如下內容結合安裝時的配置文件進行修改其中特殊的環(huán)境變量可用于表示主進程的。以下組件也可以挑需要的安裝。成功后刪除測試頁面。 CentOS7.3 安裝配置 Nginx、MariaDB、PHP 配置 nginx 安裝參數(shù)并安裝 配置 以下參數(shù)也可以在后期通過配置 conf 文件進行配置基本配置如...

    tommego 評論0 收藏0

發(fā)表評論

0條評論

endiat

|高級講師

TA的文章

閱讀更多
最新活動
閱讀需要支付1元查看
<