给已安装的NGINX添加新的模块
使用
nginx -V
查看当前nginx的信息,包括版本号和configure编译配置信息
版本号 : 1.14.1
configure
--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt=\\\'-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC\\\' --with-ld-opt=\\\'-Wl,-z,relro -Wl,-z,now -pie\\\'
下载相同版本号的源码
http://nginx.org/en/download.html
解压,cd到源码目录
下载解压要编译的模块源码和nginx源码目录同一目录
在nginx源码目录下执行configure
configure参数包括已安装的参数和你要添加的模块
例如
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt=\\\'-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC\\\' --with-ld-opt=\\\'-Wl,-z,relro -Wl,-z,now -pie\\\' --add-module=../nginx-rtmp-module-1.2.1
--add-module=../nginx-rtmp-module-1.2.1
就是我要添加的模块
configure完成后执行编译
make
记住不要install !!!!!!!!!!!!!!!!!!!!!!!!!
编译后的nginx在当前目录的objs文件夹内。
备份 /usr/sbin 目录下的nginx文件
把编译后的objs文件夹内的nginx问价移动到、usr/sbin 文件夹内
重启nginx
nginx -s stop
nginx
运行nginx -V发现已经包含需要的模块了
nginx -V
给已安装的NGINX添加新的模块的更多相关文章
- 已安装的nginx添加其他模块
总体操作就是添加新模块并重新编译源码,然后把编译后的nginx可执行文件覆盖原来的那个即可.1 查看已安装的参数nginx -V拷贝那些巴拉巴拉的参数,后面编译的时候使用 2 下载相同版本号的源码,解 ...
- 【Nginx】如何为已安装的Nginx动态添加模块?看完我懂了!!
写在前面 很多时候,我们根据当时的项目情况和业务需求安装完Nginx后,后续随着业务的发展,往往会给安装好的Nginx添加其他的功能模块.在为Nginx添加功能模块时,要求Nginx不停机.这就涉及到 ...
- 十三、给已安装的nginx动态添加模块
给已安装的nginx动态添加模块说明:已经安装好的nginx,需要添加一个未被编译安装的模块,需要怎么弄呢?具体:这里以安装 --with-http_ssl_module模块为例nginx的模块是需要 ...
- python添加新的模块
添加新的模块可以把路径放到环境变量中 或者放到site-packages文件夹下
- yum安装的Nginx添加第三方模块支持tcp
需求:生产有个接口是通过socket通信.nginx1.9开始支持tcp层的转发,通过stream实现的,而socket也是基于tcp通信. 实现方法:Centos7.2下yum直接安装的nginx, ...
- biweb添加新的模块
1.例如添加一个新闻模块,首先去纯净的项目的根目录复制出一个news文件夹到项目外 2.打开dreamweaver, 编辑 ->查找和替换 例如 新模块 叫 我的新闻,英文名叫mynews,则进 ...
- 如何在Pycharm中添加新的模块
在使用Pycharm编写程序时,我们时常需要调用某些模块,但有些模块事先是没有的,我们需要把模块添加上去. 最近在学习爬虫,写了下面几行代码: 结果出现错误 错误ModuleNotFoundError ...
- nginx添加新模块
1.下载模块 git clone https://github.com/agentzh/echo-nginx-module 2.放入指定位置 mv echo-nginx-module-master / ...
- git cmd 命令在已有的仓库重新添加新的文件夹
正确步骤: 1. git init //初始化仓库 git add .(文件name) //添加文件到本地仓库 git commit -m “first commit” //添加文件描述信息 git ...
随机推荐
- 十、cent OS开启APR模式报错:configure: error: Found APR 1.3.9. You need version 1.4.3 or newer installed
错误内容显示APR的版本过低,需要新版本 到http://apr.apache.org/download.cgi#apr1这个地址下载所需要的包apr-1.4.5.tar.gz apr-iconv-1 ...
- Redis单机数据迁移至Sentinel集群
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...
- 互联网轻量级框架SSM-查缺补漏第五天
简言:这个地方我就草草过了,NBA圣诞大战,偷偷看比赛,真香~ 第五章映射器 5.2select元素 自动映射和驼峰映射:MyBatis提供了自动映射功能,在默认的情况下自动映射功能是开启的. 在se ...
- Can't read stdin: end of file found
问题是在我修改svn的账号和密码后出现的,因为百度出来的情况只有一种答案,所以记录一下我的情况,给其他人多一种排查思路.问题根源是,由于该版本库只有一个账号,更改了账号密码,没有同步修改post-co ...
- world特殊控制符输入
特殊符号的输入表示法. 1,“^l”表示软回车(象这种“↓”). 2,“^p”表示硬回车. 3,“^t”表示制表符. 4,“^m”表示手动分页符. 5,“^+”表示长划线(—). 6,“^=”表示短划 ...
- Android Studio设置代码风格
进入settings,然后搜索CodeStyle选择Java进入如下界面 scheme选择project
- HTML 5篇(持续更新)
1.sessionStorage .localStorage 和 cookie 之间的区别 (一)共同点:都是保存在浏览器端,且同源的. (二)区别:cookie数据始终在同源的http请求中携带(即 ...
- 求解2的N次幂的问题(多种方法)
#include <iostream> using namespace std; //计算2的N次幂 //一般方法,时间复杂度为2^n __int64 pow2(int n) { __in ...
- 面试准备之一Python
基本数据类型 函数 模块与包 面向对象 网络编程 垃圾回收机制 G 并发编程
- 【Leetcode】【Medium】Find Minimum in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 migh ...