温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

在已经安装好的Nginx上增加新模块

发布时间:2020-07-29 00:41:27 来源:网络 阅读:246 作者:知行知行 栏目:系统运维

在现有的web服务器上增加新的模块实现更为丰富的功能,Nginx算是比较常用的web服务器, nginx不仅仅可以做web服务器,只要安装对应的插件还可作反向代理、即时通讯、文件下载、流媒体服务等功能,有时候我们已经安装好了Nginx,改变用途或者发现缺少用到没有安装的模块,可是我们又不想重新安装覆盖已经安装的nginx,我们该如何新增模块呢?下面通过安装--with-mail_ssl_module作为示例进行说明,安装其他模块也是同样的道理。
1、 当前nginx:
/usr/local/nginx-1.6.3/sbin/nginx –V
configure arguments: --prefix=/usr/local/nginx-1.6.3 --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre --with-http_realip_module --add-module=/root/ngx_cache_purge-1.3
2、 安装:
解压相同版本的nginx源码包(以前安装时的源码包)
tar zxf nginx-1.6.3.tar.gz
cd nginx-1.6.3
./configure (原来的参数) --prefix=/usr/local/nginx-1.6.3 --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre --with-http_realip_module --add-module=/root/ngx_cache_purge-1.3 --with-mail_ssl_module
编译:make
但是不要make install,这样会覆盖原程序。
mv /usr/local/nginx-1.6.3/sbin/nginx /usr/local/nginx-1.6.3/sbin/nginx_bak
cp objs/nginx /usr/local/nginx-1.6.3/sbin/
3、 验证,查看一下nginx的模块情况
/usr/local/nginx-1.6.3/sbin/nginx –V
configure arguments: --prefix=/usr/local/nginx-1.6.3 --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre --with-http_realip_module --add-module=/root/ngx_cache_purge-1.3 --with-mail_ssl_module

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI