linux第三方模块参数,Nginx安装第三方模块

nginx文件非常小,但是性能非常的高效,这方面完胜apache,nginx文件小的一个原因之一是nginx自带的功能相对较少,好在nginx允许第三方模块,第三方模块使得nginx越发的强大. 在安装模块方面,nginx显得没有apache安装模块方便,当然也没有php安装扩展方便.在原生的nginx,不可以动态加载模块,所以当你安装第三方模块的时候需要覆盖nginx文件。

接下来看看如何安装nginx第三模块吧:

nginx第三方模块安装方法:

./configure --prefix=/你的安装目录  --add-module=/第三方模块目录

下载模块:

# cd /usr/local/src

# wget https://github.com/cfsego/file-md5/archive/master.zip -O file-md5-master.zip

# unzip file-md5-master.zip

安装分为二种情况:

1、从未安装过nginx,编译时指定编译参数和添加第三方模块目录

[root@localhost ~]# cd /usr/local/src/nginx-1.6.2

[root@localhost nginx-1.6.2]# ./configure --prefix=/usr/local/nginx --with-pcre --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --add-module=../file-md5-master

[root@localhost nginx-1.6.2]#make

[root@localhost nginx-1.6.2]#make install

[root@localhost nginx-1.6.2]# /usr/local/nginx/sbin/nginx

2、已经安装过nginx,需要重新编译,以前编译的参数也要加上,再添加第三方模块即可

[root@localhost ~]# cd /usr/local/src/nginx-1.6.2

[root@localhost nginx-1.6.2]# ./configure --prefix=/usr/local/nginx --with-pcre --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --add-module=../file-md5-master

[root@localhost nginx-1.6.2]#make

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

[root@localhost nginx-1.6.2]# /usr/local/nginx/sbin/nginx

总结:安装nginx安装第三方模块实际上是使用--add-module重新安装一次nginx,不要make install而是直接把编译目录下objs/nginx文件直接覆盖老的nginx文件.如果你需要安装多个nginx第三方模块,你只需要多指定几个相应的--add-module即可.

备注:重新编译的时候,记得一定要把以前编译过的模块一同加到configure参数里面.

下面关于Nginx的文章您也可能喜欢,不妨参考下:

Nginx 的详细介绍:请点这里

Nginx 的下载地址:请点这里

0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值