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

nginx -V

  

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

  1. 已安装的nginx添加其他模块

    总体操作就是添加新模块并重新编译源码,然后把编译后的nginx可执行文件覆盖原来的那个即可.1 查看已安装的参数nginx -V拷贝那些巴拉巴拉的参数,后面编译的时候使用 2 下载相同版本号的源码,解 ...

  2. 【Nginx】如何为已安装的Nginx动态添加模块?看完我懂了!!

    写在前面 很多时候,我们根据当时的项目情况和业务需求安装完Nginx后,后续随着业务的发展,往往会给安装好的Nginx添加其他的功能模块.在为Nginx添加功能模块时,要求Nginx不停机.这就涉及到 ...

  3. 十三、给已安装的nginx动态添加模块

    给已安装的nginx动态添加模块说明:已经安装好的nginx,需要添加一个未被编译安装的模块,需要怎么弄呢?具体:这里以安装 --with-http_ssl_module模块为例nginx的模块是需要 ...

  4. python添加新的模块

    添加新的模块可以把路径放到环境变量中 或者放到site-packages文件夹下

  5. yum安装的Nginx添加第三方模块支持tcp

    需求:生产有个接口是通过socket通信.nginx1.9开始支持tcp层的转发,通过stream实现的,而socket也是基于tcp通信. 实现方法:Centos7.2下yum直接安装的nginx, ...

  6. biweb添加新的模块

    1.例如添加一个新闻模块,首先去纯净的项目的根目录复制出一个news文件夹到项目外 2.打开dreamweaver, 编辑 ->查找和替换 例如 新模块 叫 我的新闻,英文名叫mynews,则进 ...

  7. 如何在Pycharm中添加新的模块

    在使用Pycharm编写程序时,我们时常需要调用某些模块,但有些模块事先是没有的,我们需要把模块添加上去. 最近在学习爬虫,写了下面几行代码: 结果出现错误 错误ModuleNotFoundError ...

  8. nginx添加新模块

    1.下载模块 git clone https://github.com/agentzh/echo-nginx-module 2.放入指定位置 mv echo-nginx-module-master / ...

  9. git cmd 命令在已有的仓库重新添加新的文件夹

    正确步骤: 1. git init //初始化仓库 git add .(文件name) //添加文件到本地仓库 git commit -m “first commit” //添加文件描述信息 git ...

随机推荐

  1. LDAP概念了解

    LDAP是轻量目录访问协议,英文全称是Lightweight Directory Access Protocol,一般都简称为LDAP.LDAP支持TCP/IP,这对访问Internet是必须的. L ...

  2. bash的常用功能呢

    一.tab键可以自动补齐命令 二.命令历史 1.history 查看之前敲过的所有命令 2.!历史命令编号 调用历史的某一个命令 三.命令别名 1.设置别名    alias 别名=‘命令’ 2.移除 ...

  3. maven(5)--依赖特性

    依赖的子标签中有scope,常用值有compile.provide.test.runtime compile:编译范围有效,即编译和打包时都会将这个依赖存储 provide:编译测试有效,但是打包是将 ...

  4. jquery each() 方法跳出循环

    1.jquery each() 方法  return false: 的时候  相当于  break; 跳出整个循环: 2.jquery each() 方法  return true: 的时候  相当于 ...

  5. GEOS编译

    GEOS是开源的空间运算引擎,最近用到,在这里记录下. 目录 GEOS简介 GEOS编译 一.GEOS简介 GEOS(几何引擎 - 开源)是一个具有完整空间查询和分析功能的C++库.它包括所有Open ...

  6. 06_javassist

    [简述] Javassist是一个开源的java字节码操作工具,主要是对已经编译好class文件进行修改和处理,可以直接检查.修改.创建 java类. [javassist实例] package co ...

  7. JSP / JDK和Apache的配置

    系统环境:Windows7 x64 Ultimate chs 1.首先安装jdk,可以再oracle官网下载到,此处安装jdk6.0版本. 2.配置jdk环境变量: 我的电脑-->属性--> ...

  8. c#调用c++制作的基于mfc的ocx控件

    原文:http://blog.csdn.net/yhhyhhyhhyhh/article/details/51286926 原文中有问题部分已修改. c#调用c++制作的基于mfc的ocx控件     ...

  9. 部署node.js的开发环境

    1.进入Node.js的官方网站下载安装包: http:nodejs.org 2.安装后打开cmd的dos窗口(在path环境变量中查看到有nodejs说明安装成功): 3.运行node.

  10. onchange,onfocus ,oninput事件

    compositionstart 在输入一段需要确认的文本如拼音to汉字.语音时会触发 compositionend  在拼音选词完成.语音输入完毕时会触发 addEventListener() 方法 ...