给已安装的NGINX添加新的模块

给已安装的NGINX添加新的模块

2018-11-16 14:02:45   Visit  0

使用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发现已经包含需要的模块了

原文地址:https://www.cnblogs.com/Leechg/p/9969000.html

时间: 2024-08-01 13:23:29

给已安装的NGINX添加新的模块的相关文章

如何给在用的nginx添加新模块?

有一个在用的nginx,以yum方法安装的,怎样在不改动配置的情况下,为它添加模块. 以添加spdy模块为例. 编译新模块 预编译 ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin --conf-path=/etc/nginx/nginx.conf --pid-path=/run/nginx.pid --error-log-path=/var/log/nginx/error.log --with-http_spdy_module --wi

nginx添加新模块及第三方模块

一.编译添加新模块 1.查看以前编译安装nginx的信息    /usr/local/nginx/sbin/nginx -V 2.进入nginx源码目录           cd nginx-1.8.0 3.重新编译代码和模块 ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module 4.

给已经在用的nginx添加新模块

已经在用的nginx服务器,需要安装一个新的模块 首先通过-V参数查看当前编译安装的参数: linux_server01:~ # nginx -V nginx version: nginx/1.6.2 built by gcc 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux)  TLS SNI support enabled configure arguments: --prefix=/datas/nginx --user=nginx_srv

biweb添加新的模块

1.例如添加一个新闻模块,首先去纯净的项目的根目录复制出一个news文件夹到项目外 2.打开dreamweaver, 编辑 ->查找和替换 例如 新模块 叫 我的新闻,英文名叫mynews,则进行以下替换. 点击替换全部 , 替换成功,然后替换英文 将 news替换为mynews 然后修改news 文件夹名字为mynews 接下来 打开这里 将news.class.php 改为mynews.class.php 然后在template下也有一个news文件夹 ,同后台一样的道理. 都完成后进入后台

如何在Pycharm中添加新的模块

在使用Pycharm编写程序时,我们时常需要调用某些模块,但有些模块事先是没有的,我们需要把模块添加上去. 最近在学习爬虫,写了下面几行代码: 结果出现错误 错误ModuleNotFoundError: No module named 'bs4'的意思是未找到名为bs4的模块,我们就需要pycharm上安装'bs4'这个模块.方法如下: 1.点击File,选择Default Settings选项 2.选择project interpreter选项 3.点击3.6.3选项(我的为python3.6

java并发之如何向已有的线程安全类添加新功能--java并发编程实践

添加一个新原子操作的最安全的方式是,修改原始的类,以支持期望的操作.但是你可能无法访问源代码或者没有修改的自由,所以通常是不可能的.即使你可以修改原始的类,也需要理解其实现的同步策略,才能在维持原有设计的前提下完善它的功能.直接向类中加入新方法,意味着所有实现类同步策略的代码仍然包含在一个源代码文件中,因此便于理解与维护. 另一种方法是扩展这个类.因为扩展后,同步策略的实现会被分布到多个独立维护的源代码文件中,所以 扩展一个类比直接在类中加入代码更脆弱.如果底层的类选择了不同的锁保护它的状态变量

nginx添加编译lua模块

一 .安装LuaJit 1.下载LuaJit # wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz 2.编译安装 # tar xzvf LuaJIT-2.0.5.tar.gz # cd LuaJIT-2.0.5 # make PREFIX=/opt/programs/nginx_1.12.2/lua/luajit # make install PREFIX=/opt/programs/nginx_1.12.2/lua/luajit 二.下载

yii2.0中添加新的模块

比如现在需要添加一个新的hnews模块:复制frontend改名hnews 1.在common文件下的config下的 bootstrap.php 2.修改命名空间 在具体实例的main.config下 修改 3.主要修改的就是这两块,之后就是关联命名空间的修改了.

php中添加新模块支持

php安装额外的扩展模块php安装完成以后,如果php中缺少某个模块,这是我们也不可能重新编译php,只能通过php的模块扩展来安装缺少的功能模块使用/usr/local/php7/bin/php -m 查看php已编译的模块,也可查看未编译的模块,配合grep查看是否存在模块可以下载一个第三方的的php扩展,这里只使用php内置模块演示:进入内置模块目录(第三方需要解压后进入其目录中),在目录中执行/usr/local/php7/bin/phpize,生成./configure编译文件,如果p