[root@ittestserver1 opt]# /usr/local/nginx2/sbin/nginx -V nginx version: nginx/1.10.3 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) built with OpenSSL 1.1.0e 16 Feb 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx2 --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_stub_status_module --with-http_v2_module --with-openssl=/tmp/install/openssl-1.1.0e --with-http_v2_module #注意【configure arguments】,升級的時候,要保持一致!
這個再也不贅述,本身用wget或者去官網上面下壓縮包,而後ftp上傳便可。下載地址:http://nginx.org/cn/download.htmlhtml
[root@ittestserver1 soft]# tar xf nginx-1.12.1.tar.gz [root@ittestserver1 soft]# cd nginx-1.12.1 [root@ittestserver1 nginx-1.12.1]# ls auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src [root@ittestserver1 nginx-1.12.1]# ./configure --prefix=/usr/local/nginx2 \ --with-http_stub_status_module \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-http_stub_status_module \ --with-http_v2_module \ --with-openssl=/tmp/install/openssl-1.1.0e \ --with-http_v2_module
PS:服務器若是沒有安裝nginx依賴的軟件,好比openssl、prce等,且本身不是root用戶,沒法使用yum進行安裝,能夠使用參數來指定相應依賴的源碼路徑(依賴源碼需本身去下載),例如指定prce依賴:--with-pcre=【prce源碼】nginx
[root@ittestserver1 soft]# make
[root@ittestserver1 nginx-1.12.1]# mv /usr/local/nginx2/sbin/nginx /usr/local/nginx2/sbin/nginx.bak [root@ittestserver1 nginx-1.12.1]# cp objs/nginx /usr/local/nginx2/sbin/
[root@ittestserver1 nginx-1.12.1]# make upgrade #注意是在進行make的目錄下進行的
[root@ittestserver1 nginx-1.12.1]# /usr/local/nginx2/sbin/nginx -V nginx version: nginx/1.12.1 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) built with OpenSSL 1.1.0e 16 Feb 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx2 --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_stub_status_module --with-http_v2_module --with-openssl=/tmp/install/openssl-1.1.0e --with-http_v2_module