日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > Nginx >内容正文

Nginx

03_Nginx添加新模块

發(fā)布時(shí)間:2024/9/27 Nginx 67 豆豆
生活随笔 收集整理的這篇文章主要介紹了 03_Nginx添加新模块 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.


1 進(jìn)入nginx安裝目錄,查看nginx版本及其編譯參數(shù):

[root@localhost nginx]# ./nginx -V

nginx version: nginx/1.8.0

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

built with OpenSSL 1.0.1c 10 May 2012

TLS SNI support enabled

configure arguments: --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.37 --with-zlib=../zlib-1.2.8 --with-openssl=../openssl-1.0.1c --with-http_stub_status_module --user=nginx --group=nginx

[root@localhost nginx]#

2 進(jìn)入nginx的源碼目錄:

[root@localhost src]# ls

nginx-1.8.0???????? openssl-1.0.1c???????? pcre-8.37???????? zlib-1.2.8

nginx-1.8.0.tar.gz? openssl-1.0.1c.tar.gz? pcre-8.37.tar.gz? zlib-1.2.8.tar.gz

[root@localhost src]# pwd

/usr/local/src

[root@localhost src]# cd nginx-1.8.0

[root@localhost nginx-1.8.0]# ls

auto? CHANGES? CHANGES.ru? conf? configure? contrib? html? LICENSE? Makefile? man? objs? README? src

[root@localhost nginx-1.8.0]#

3 以下是重新編譯的代碼和模塊:

./configure --sbin-path=/usr/local/nginx/nginx \

--conf-path=/usr/local/nginx/nginx.conf \

--pid-path=/usr/local/nginx/nginx.pid \

--with-http_ssl_module \

--with-http_realip_module \

--with-http_addition_module \

--with-http_stub_status_module \

--with-http_sub_module \

--with-http_dav_module \

--with-http_flv_module \

--with-http_mp4_module \

--with-http_gunzip_module \

--with-http_gzip_static_module \

--with-http_random_index_module \

--with-http_secure_link_module \

--with-http_auth_request_module \

--with-mail \

--with-mail_ssl_module \

--with-file-aio \

--with-http_spdy_module \

--with-ipv6 \

--with-pcre=../pcre-8.37 \

--with-zlib=../zlib-1.2.8 \

--with-openssl=../openssl-1.0.1c \

--user=nginx \

--group=nginx;

截圖如下:

詳細(xì)參數(shù)請(qǐng)看官網(wǎng):http://nginx.org/en/docs/configure.html

4 編譯:

make???(注意:千萬(wàn)不要make install

5 make完成之后再當(dāng)前目錄下的objs目錄下就多了個(gè)nginx,這個(gè)就是新版本的程序了

6 備份舊的nginx程序

[root@localhost objs]# cp /usr/local/nginx/nginx /usr/local/nginx/nginx.bak

?[root@localhost objs]# cd /usr/local/nginx/

[root@localhost nginx]# ls

client_body_temp??????? fastcgi_temp? mime.types.default? sbin????????????????? uwsgi_temp

conf??????????????????? html????????? nginx?????????????? scgi_params?????????? win-utf

fastcgi.conf??????????? koi-utf????? ?nginx.bak? ?????????scgi_params.default

fastcgi.conf.default??? koi-win?????? nginx.conf????????? scgi_temp

fastcgi_params????????? logs????????? nginx.conf.default? uwsgi_params

fastcgi_params.default? mime.types??? proxy_temp????????? uwsgi_params.default

[root@localhost nginx]#

6 把新的nginx程序覆蓋舊的

[root@localhost nginx-1.8.0]# ls

auto? CHANGES? CHANGES.ru? conf? configure? contrib? html? LICENSE? Makefile? man? objs? README? src

[root@localhost nginx-1.8.0]# cp objs/nginx /usr/local/nginx/nginx

cp:是否覆蓋"/usr/local/nginx/nginx" y

[root@localhost nginx-1.8.0]#

7 測(cè)試新的nginx程序是否正確

[root@localhost nginx-1.8.0]#/usr/local/nginx/nginx -t

8 平滑重啟nginx

/usr/local/nginx/nginx –s reload

9 查看nginx版本及其編譯參數(shù):

/usr/local/nginx/nginx –V

?

總結(jié)

以上是生活随笔為你收集整理的03_Nginx添加新模块的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。