已经编译安装的nginx/tenginx编译增加新模块
只适用于自行编译安装的nginx配置
业务变更带来的Nginx增加模块需求
由于业务从php转为go开发,需要用到Http2的协议。这种协议在Nginx上需要http_v2_module这个模块的支持,但是现有服务器上,查看Nginx的编译参数中,并未添加。所以需要再次编译替换nginx
[root@ip-172-60-0-193 ~]# nginx -V
Tengine version: Tengine/2.3.2
nginx version: nginx/1.17.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/data/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --add-module=modules/ngx_http_reqstat_module --add-module=modules/ngx_http_user_agent_module --add-module=modules/ngx_http_upstream_check_module --add-module=modules/ngx_http_upstream_dynamic_module --add-module=modules/ngx_http_upstream_session_sticky_module --add-module=modules/ngx_http_upstream_consistent_hash_module --with-pcre=/root/web/pcre-8.37
从以上命令的输出中,可以看到。当前的Nginx并未添加http_v2_module模块的支持
为nginx添加新的模块
找到当时编译安装的Nginx源码,或者相同版本的源码包。解压后,进行重新编译
编译时,使用之前的编译参数,并添加上对于新模块的支持
cd tengine-2.3.2
# 使用新的编译参数
./configure --user=www --group=www --prefix=/data/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --add-module=modules/ngx_http_reqstat_module --add-module=modules/ngx_http_user_agent_module --add-module=modules/ngx_http_upstream_check_module --add-module=modules/ngx_http_upstream_dynamic_module --add-module=modules/ngx_http_upstream_session_sticky_module --add-module=modules/ngx_http_upstream_consistent_hash_module --with-pcre=/root/web/pcre-8.37
进行make。一定要注意,不能进行
make install# 上边编译没有报错的话,进行make
make
关闭现有的Nginx,并进行nginx二进制文件的替换
# make成功后,新的nginx二进制,在编译目录的objs目录下
# 查看编译后的Nginx,都支持哪些模块
objs/nginx -m Tengine version: Tengine/2.3.2
nginx version: nginx/1.17.3
nginx: loaded modules:
nginx: ngx_core_module (static)
...
nginx: ngx_http_v2_module (static)
... # 可以看到我们新编译后的nginx,已经添加好了我们需要的模块
systemctl stop nginx cd nginx/sbin
cp nginx nginx_old
mv ${make_dir}/objs/nginx nginx/sbin systemctl start nginx
查看替换后的Nginx,对于新模块的支持
# 再次查看当前系统上Nginx的模块
nginx -m nginx -V
到这里,整个Nginx重新编译安装增加新模块操作已完成。其他模块也可以按照此操作执行
已经编译安装的nginx/tenginx编译增加新模块的更多相关文章
- centos6.5生产环境编译安装nginx-1.11.3并增加第三方模块ngx_cache_purge、nginx_upstream_check、ngx_devel_kit、lua-nginx
1.安装依赖包 yum install -y gcc gcc-c++ pcre-devel openssl-devel geoip-devel 2.下载需要的安装包 LuaJIT-2.0.4.zip ...
- 在已经安装的nginx上,增加ssl模块
1. /usr/local/nginx/sbin/nginx -V 查看nginx版本与编译安装了哪些模块nginx version: nginx/1.10.3built by gcc 4.4.7 2 ...
- Nginx之编译安装的nginx加入systemctl
编译安装的nginx需要添加rc.local 编译安装后设置 /usr/lib/systemd/system/nginx.service [Unit] Description=nginx After= ...
- 20190418 CentOS7实用技能综合:系统安装 + WinScp客户端连接 + 防火墙端口号iptables + Nginx编译安装 + MySQL编译安装 + Redis编译安装 + MongoDB编译安装 + ActiveMQ/RocketMQ/RabbitMQ编译安装 + ...各类常用生产环境软件的编译安装
系统安装 + WinScp客户端连接 + 防火墙端口号iptables + Nginx编译安装 + MySQL编译安装 + Redis编译安装 + MongoDB编译安装 + ActiveMQ/Roc ...
- CentOS6.3 编译安装LAMP(2):编译安装 Apache2.4.6
Apache官方说: 与Apache 2.2.x相比,Apache 2.4.x提供了很多性能方面的提升,包括支持更大流量.更好地支持云计算.利用更少的内存处理更多的并发等.除此之外,还包括性能提升.内 ...
- CentOS6.3 编译安装LAMP(2):编译安装 Apache2.2.25
所需源码包: /usr/local/src/Apache-2.2.25/httpd-2.2.25.tar.gz 编译安装 Apache2.2.25 #切换到源码目录 cd /usr/local/src ...
- CentOS6.3 编译安装LAMP(3):编译安装 MySQL5.5.25
所需源码包: /usr/local/src/MySQL-5.5.25/cmake-2.8.8.tar.gz /usr/local/src/MySQL-5.5.25/mysql-5.5.25.tar.g ...
- CentOS6.3 编译安装LAMP(4):编译安装 PHP5.2.17
所需源码包: /usr/local/src/PHP-5.2.17/libmcrypt-2.5.8.tar.gz /usr/local/src/PHP-5.2.17/mhash-0.9.9.9.tar. ...
- CentOS6.3 编译安装LAMP(4):编译安装 PHP5.3.27
所需源码包: /usr/local/src/PHP-5.3.27/libmcrypt-2.5.8.tar.gz /usr/local/src/PHP-5.3.27/mhash-0.9.9.9.tar. ...
随机推荐
- 手写“SpringBoot”近况:IoC模块已经完成
jsoncat:https://github.com/Snailclimb/jsoncat (About 仿 Spring Boot 但不同于 Spring Boot 的一个轻量级的 HTTP 框架) ...
- [VBA原创源代码] excelhome 对花名册进行分类
最近在学习<菜鸟谈VBA最最基础入门<原创>>,其中第22节有一个VBA编程作业,实现对花名册进行分类. 自己花了点时间,自己丫丫学步,终于实现出来. 在原创聚集地cnblog ...
- plt.imshow()显示图片色差问题
转载:https://www.cnblogs.com/darkknightzh/p/6039667.html 由于系统缺少某些库,导致cv2.imshow()无法使用,于是使用matplotlib.p ...
- VS 高级版本新建的项目如何降级使低版本 VS 可以打开
转载:https://blog.csdn.net/u012814856/article/details/70325267 一.引言 这里因为工作的原因,公司项目使用的是 VS2015 的编译环境,但是 ...
- 「剑指offer」27道Mybatis面试题含解析
1.什么是Mybatis? Mybatis是一个半ORM(对象关系映射)框架,它内部封装了JDBC,开发时只需要关注SQL语句本身,不需要花费精力去处理加载驱动.创建连接.创建statement等繁杂 ...
- JavaScript常用对象介绍
目录 对象(object) 对象的创建方式 点语法 括号表示法 内置对象 Array 数组创建方式 检测数组 转换方法 分割字符串 栈方法 队列方法 重排序方法 操作方法 位置方法 迭代方法 Stri ...
- Cesium资料
CesiumLab论坛:https://github.com/cesiumlab/cesium-lab-forum/issues简书上的Cesium实验室文集:https://www.jianshu. ...
- SpringBoot+单机redis
spring boot-redis集成 看教程来的,看起来很简单,但是集成后发现启动失败? WARN 2556 --- [ restartedMain] ationConfigEmbeddedWebA ...
- if-else和if if的对比
- 以太坊blockchain源码分析
blockchain关键元素 db:持久化到底层数据储存,即leveldb: genesisBlock:创始区块 currentBlock:当前区块,blockchain中并不是储存链所有的block ...