欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到夢飛科技

服務器租用

當前優惠活動:

Nginx進級到1.9.12并開啟HTTP/2的具體步調

一、籌備事情

昨天把站點從http進級到https,那么接下來就應該可以嘗嘗http/2的味道了!

可是今朝站點陳設在阿里云CentOS下,Nginx版本較量低,v1.4.4,所以必需得進級到v1.9.x,索性直接升到最新版得了!

安裝之前,先籌備好兩個目次:

# 下載的源碼,放在這個目次下舉辦編譯

# 編譯后的App,安裝到這個目次

mkdir -p /root/server

# 進入源碼目次,籌備接下來的操縱

cd /root/source

二、下載openssl最新版源碼

Openssl官方下載頁面:這里

# 這里下載1.0.2g

wget http://www.openssl.org/source/openssl-1.0.2g.tar.gz

# 解壓,備用

tar zxfv openssl-1.0.2g.tar.gz

三、下載zlib最新版源碼

Zlib官方下載頁面:這里

# 這里下載1.2.8

wget -O - http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz\?download > zlib-1.2.8.tar.gz

# 解壓,備用

tar zxfv zlib-1.2.8.tar.gz

四、下載Nginx最新版源碼

Nginx官方下載頁面:這里

# 這里下載1.9.12

wget http://nginx.org/download/nginx-1.9.12.tar.gz

# 解壓

tar zxfv nginx-1.9.12.tar.gz

五、編譯Nginx

這里有個原則,就是:

當前低版本的Nginx已有的modules,都需要保存,萬一丟了誰,一會兒新版本跑不起來就悲催了!

1、獲取當前低版本Nginx的編譯參數

# -V參數獲取具體信息

/root/server/nginx-1.4.4/sbin/nginx -V

獲得功效:

nginx version: nginx/1.4.4

built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)

configure arguments: --user=www --group=www --prefix=/root/server/nginx-1.4.4 --with-http_stub_status_module --without-http-cache --with-http_gzip_static_module

2、增加新參數

--with-openssl=/root/source/openssl-1.0.2g --with-pcre --with-zlib=/root/source/zlib-1.2.8 --with-stream --with-stream_ssl_module --with-http_v2_module --with-threads    

3、編譯&安裝

cd nginx-1.9.12

# 編譯

./configure --user=www --group=www --prefix=/root/server/nginx-1.9.12 --with-http_stub_status_module --without-http-cache --with-http_gzip_static_module --with-openssl=/root/source/openssl-1.0.2g --with-pcre --with-zlib=/root/source/zlib-1.2.8 --with-stream --with-stream_ssl_module --with-http_v2_module --with-threads

# 安裝

make && make install

并沒有什么[Error]之類的錯誤信息,編譯安裝樂成!

4、新版本測試

# 查察安裝后的信息

/root/server/nginx-1.9.12/sbin/nginx -V

# 測試

/root/server/nginx-1.9.12/sbin/nginx -t

安心了,確實樂成了!

六、Nginx設置文件移植

即便Nginx版本從1.4.4到1.9.12超過了那么多,但我根基可以猜到,設置文件必定沒啥非凡的大行動,所以直接cp移植,測試即可!

# 從本來的nginx/conf目次移植

cp /root/server/nginx-1.4.4/conf/nginx.conf /root/server/nginx-1.9.12/conf/nginx.conf

cp -r /root/server/nginx-1.4.4/conf/vhost /root/server/nginx-1.9.12/conf/

# 測試

/root/server/nginx-1.9.12/sbin/nginx -t

nginx: the configuration file /root/server/nginx-1.9.12/conf/nginx.conf syntax is ok

nginx: configuration file /root/server/nginx-1.9.12/conf/nginx.conf test is successful

完美,根基無縫移植!

七、啟用新版本Nginx

# 溫柔的遏制老版本nginx,雖然,也可以采納暴力的 pkill nginx 方法

service nginx stop

# 啟用新版本nginx

/root/server/nginx-1.9.12/sbin/nginx

會見網站 https://www.server110.com,一切正常!可以修改軟連了:

# 移除老的軟連,成立新的軟連

unlink /root/server/nginx && ln -s /root/server/nginx-1.9.12 /root/server/nginx

八、回歸正題--開啟http2

這一步,東京主機 日本代理服務器,就已經變得很是簡樸了,修改nginx/conf/vhosts/baidufe.conf即可:

server {

    listen 443 ssl http2;

    server_name  baidufe.com www.server110.com;

    ...

}

其實,也就是直接在listen 443 ssl后頭增加http2即可!然后nginx reload,搞定!

九、網站http2驗證

進入 https://www.server110.com刷新,右上角HTTP/2 and SPDY indicator圖標變藍色了,驗證通過!

雖然,還可以通過curl的方法來檢測,可是前提條件是,curl的版本得足夠新!

curl --http2 -I https://www.server110.com

至此,大功告成!

夢飛科技 - 全球數據中心基礎服務領先供應商

Copyright © 2003-2019 MFISP.COM. 國外服務器租用 IDC公司 版權所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 遂溪县| 石楼县| 武宣县| 北票市| 崇阳县| 苍溪县| 日照市| 廊坊市| 青海省| 永康市| 霍城县| 福清市| 扎囊县| 辽源市| 贡觉县| 达拉特旗| 晋宁县| 潜山县| 庆城县| 上栗县| 舞钢市| 太白县| 甘德县| 瓦房店市| 杭州市| 邵武市| 宜兴市| 柳河县| 蛟河市| 五寨县| 博湖县| 陇南市| 英德市| 崇仁县| 疏勒县| 云安县| 鸡西市| 罗甸县| 响水县| 海南省| 彭泽县|