安装第三方模块

安装第三方模块,第1张

nginx安装第三方模块

Nginx文件很小,但是它的功能非常高效。这些方面完全爆阿帕奇。nginx文件小的原因之一是nginx的内置函数比较小。好在nginx允许第三方模块,第三方模块让nginx越来越强大。在模块安装层面,nginx看起来没有Apache安装模块方便,自然也没有php安装和扩展方便。在最初的nginx中,你不能动态加载模块,所以如果你安装了第三方,

我们来看看如何安装nginx的第三个模块:


nginx第三方模块的安装方式:

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


下载免费模块:

#cd/usr/local/src

#wgethttps://github.com/cfsego/file-md5/archive/master.zip-O文件-md5-master.zip

#解压缩文件-md5-master.zip


安装可分为两种情况:

1.nginx从未安装过,具体编译的主要参数和第三方模块的目录都是在编译时添加的。


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

[[email protected]]#。/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

[[email protected]]#make

[[email protected]]#进行安装

[[email protected]]#/usr/local/nginx/sbin/nginx


2.nginx已经安装好了,必须重新编译。要加上之前编译的主要参数,可以加上第三方模块。

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

[[email protected]]#。/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

[[email protected]]#make

[[email protected]]#CPobjs/nginx/usr/local/nginx/sbin/

[[email protected]]#/usr/local/nginx/sbin/nginx


总结:安装nginx,安装第三方模块,其实就是应用-添加-模块重新安装nginx。没有必要进行安装。只需立即用编译目录中的objs/nginx文件覆盖旧的nginx文件。如果必须安装几个nginx第三方模块,只需要指定几个relative-add-modules即可。


注意:再次编译时,记得将之前编译的模块添加到configure的主参数中。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/777749.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-03
下一篇 2022-05-03

发表评论

登录后才能评论

评论列表(0条)

保存