nginx的模块是需要重新编译nginx,而不是像apache一样配置文件引用.so

这里以安装第三方ngx_http_google_filter_module模块为例

  1. 下载第三方扩展模块ngx_http_google_filter_module
# cd /data/software/
# git clone https://github.com/cuber/ngx_http_google_filter_module
  1. 查看nginx编译安装时安装了哪些模块
# nginx -V
nginx version: nginx/1.8.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --add-module=/data/software/ngx_http_substitutions_filter_module

可以看出编译安装使用了--prefix=/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --add-module=/data/software/ngx_http_substitutions_filter_module这些参数。--add-module=/data/software/ngx_http_substitutions_filter_module是之前编译添加ngx_http_substitutions_filter_module模块时添加

  1. 加入需要安装的模块,重新编译,如这里添加–add-module=/data/software/ngx_http_google_filter_module
# ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --add-module=/data/software/ngx_http_substitutions_filter_module --add-module=/data/software/ngx_http_google_filter_module
# make //千万不要make install,不然就真的覆盖了
  1. 替换nginx二进制文件:(把nginx停止)
# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
# cp ./objs/nginx /usr/local/nginx/sbin/

如果是内置的模块,在第三步骤的时候,直接--with-相关的模块即可,剩下的步骤依旧

nginx编译安装新模块的更多相关文章

  1. Nginx编译安装第三方模块http_substitutions_filter_module2222

    Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...

  2. Nginx编译安装第三方模块http_substitutions_filter_module

    Nginx编译安装第三方模块http_substitutions_filter_module 分类:服务器技术  作者:rming  时间:-- . >>ngx_http_substitu ...

  3. Nginx编译添加新模块

    目录 一.简介与思路 一.简介与思路 当前适用于nginx已经在安装过了,如果没安装过,直接在编译时候添加模块即可. Nginx主要程序就是nginx这个二进制脚本,只要在编译一个nginx脚本替换掉 ...

  4. nginx编译安装配置模块大全

    使用configure命令配置构建.它定义了系统的各个方面,包括允许nginx用于连接处理的方法.最后,它会创建一个Makefile.该configure命令支持以下参数:--help 打印帮助信息. ...

  5. mac下使用opencv编译安装新模块contrib

    opencv-4.0.1 opencv_contrib-4.0.1 提供ippicv下载链接: https://pan.baidu.com/s/1OIJRUqPqAtpMetku8qX36w cont ...

  6. Nginx编译安装lua-nginx-module

    lua-nginx-module 模块可以将Lua的强大功能嵌入NGINX服务器. 下载Nginx源码 如果已安装Nginx,需要查看当前安装版本的编译参数: $ /usr/local/nginx/s ...

  7. 已经编译安装的nginx/tenginx编译增加新模块

    只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...

  8. 原已经安装好的nginx,现在需要添加一个未被编译安装的模块--echo-nginx-module-0.56

    为了测试一个NGINX变量,将NGINX加了一个编译模板echo-nginx-module-0.56. 参照如下文件 1,先看以前NGINX有哪些东东. sbin/nginx -Vnginx vers ...

  9. nginx 编译增加新的模块

    原已经安装好的nginx,现在需要添加一个未被编译安装的模块: nginx -V 可以查看原来编译时都带了哪些参数 原来的参数:--prefix=/app/nginx 添加的参数: --with-ht ...

随机推荐

  1. 爬虫系列(九) xpath的基本使用

    一.xpath 简介 究竟什么是 xpath 呢?简单来说,xpath 就是一种在 XML 文档中查找信息的语言 而 XML 文档就是由一系列节点构成的树,例如,下面是一份简单的 XML 文档: &l ...

  2. Linux - centos7 下 MySQL(mariadb) 和 主从复制

    目录 Linux - centos7 下 MySQL(mariadb) 和 主从复制 MySQL(mariadb) 安装MySQL(mariadb) 配置数据库的中文支持 在远程用 mysql客户端去 ...

  3. CentOS7版本的新特性

    综述 XFS  比 EXT 4更适合大文件处理,但消耗的CPU资源是EXT4的两倍 XFS 最大支持单文件16TB ,EXT4:50TB 最小1GB/建议每个逻辑CPU 1GB 逻辑CPU:核数,而非 ...

  4. 从事分布式系统,计算,hadoop

    作者:廖君链接:https://www.zhihu.com/question/19868791/answer/88873783来源:知乎 分布式系统(Distributed System)资料 < ...

  5. oracle 12c之前用sequence 和 trigger来生成自动增长的列

    SQL> create table scott.t1 (id number, val varchar2(8)); Table created. SQL> CREATE SEQUENCE s ...

  6. jQuery toast message 地址 使用

    jQuery toast message 地址 使用 https://github.com/akquinet/jquery-toastmessage-plugin/wiki

  7. 微信获得access-token

    微信获得access-token RestTemplate template = new RestTemplate(); String appid = "aa"; String s ...

  8. UVA 11762 - Race to 1(概率)

    UVA 11762 - Race to 1 题意:给定一个n,每次随即选择一个n以内的质数,假设不是质因子,就保持不变,假设是的话.就把n除掉该因子,问n变成1的次数的期望值 思路:tot为总的质数. ...

  9. 设计模式C++实现——外观模式

    模式定义: 外观模式提供了一个统一的接口,用来訪问子系统中的一群接口.外观定义了一个高层接口,让子系统更easy使用. 模式结构: watermark/2/text/aHR0cDovL2Jsb2cuY ...

  10. HBase编程实例

    摘要:在前文中安装了Hbase,通过Hbase shell能够进行一些操作.可是和实际的编程实例联系起来不方便,因此本文介绍有关Hbase编程的实例. 一.使用Eclipse开发HBase应用程序 1 ...