查看现有nginx的编译参数:

[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# nginx -V
nginx version: nginx/1.12.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
built with OpenSSL 1.0.2l 25 May 2017
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-openssl=/root/lnmp1.4/src/openssl-1.0.2l --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

查看所需模块名字:

原有nginx编译目录:

[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# cd /nginx-1.12.2

[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# ./configure --help | grep proxy
--without-http_proxy_module   disable ngx_http_proxy_module

重新编译模块参数:

./configure --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-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-openssl=/root/lnmp1.4/src/openssl-1.0.2l

[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# make

替换nginx二进制文件:

[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# which nginx
/usr/bin/nginx

可以看到是一个软连接:
[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# ll /usr/bin/nginx
lrwxrwxrwx 1 root root 27 May 7 2018 /usr/bin/nginx -> /usr/local/nginx/sbin/nginx

停止nginx:

[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# nginx -s stop

[root@iZbp1d0dkjhfmxnxp7wuhmZ nginx-1.12.2]# cp objs/nginx /usr/local/nginx/sbin/nginx

启动nginx:

nginx添加模块记录的更多相关文章

  1. nginx添加模块 (非覆盖安装)

    nginx添加模块(非覆盖安装) 原已经安装好的nginx,现在需要添加一个未被编译安装的模块: 查看原来编译时都带了哪些参数# /usr/local/nginx/sbin/nginx -V ngin ...

  2. nginx添加模块

    [root@VM_0_3_centos nginx]# ./sbin/nginx -V nginx version: nginx/1.12.2 built by gcc 4.8.5 20150623 ...

  3. Nginx 添加模块

    说明: 已经安装好的Nginx,需要添加一个未被编译安装的模块(以nginx-rtmp-module模块为例),则需要重新编译nginx nginx的模块是需要重新编译nginx,而不是像apache ...

  4. nginx自定义模块记录上游服务器特定响应头

    功能,服务器通过扩展自定义命令,记录上游的服务器返回的特定响应头内容,记录到本地文件中 代码如下: /* * Copyright (C) Ciaos */ #include <ngx_confi ...

  5. Linux下Nginx的安装、升级及动态添加模块

    系统基于ubuntu server 14.04.4 amd64 安装 第一步 下载并解压Nginx压缩包 从Nginx官网下载Nginx,或者在Linux上执行wget http://nginx.or ...

  6. nginx添加sticky模块-cookie保持会话

    cookie不同于session,一个存于客户端,一个存于服务端. 环境nginx 1.8.0 centos6.X sticky:1.2.5  wget https://bitbucket.org/n ...

  7. Linux下,Nginx的安装、升级及动态添加模块

    系统基于ubuntu server 14.04.4 amd64 安装 第一步 下载并解压Nginx压缩包 从Nginx官网下载Nginx,或者在Linux上执行wget http://nginx.or ...

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

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

  9. 已安装nginx动态添加模块

    说明:已经安装好的nginx,需要添加一个未被编译安装的模块,需要怎么弄呢? 具体:这里以安装第三方ngx_http_google_filter_module模块为例nginx的模块是需要重新编译ng ...

随机推荐

  1. QtCreator中打开.ui文件时卡死崩溃的解决方法

    问题 QtCreator中打开一个项目,在编辑器中打开普通的.cpp或.h等文件正常,构建正常,运行正常,但是打开ui文件(QtCreator自动调用designer)时会卡死然后崩溃退出. 解决方法 ...

  2. [bzoj4368][IOI2015]boxes纪念品盒_动态规划_单调队列_贪心

    bzoj4368 IOI2015 boxes纪念品盒 题目链接:https://lydsy.com/JudgeOnline/problem.php?id=4368 数据范围:略. 题解: 如果在一个最 ...

  3. stub_status监控Nginx使用情况!

    stub_status监控Nginx使用情况! 查看nginx安装的模块! # /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.8.1 bu ...

  4. PCL学习(五)如何在mesh模型上sample更多点及三维物体姿态估计

    ---恢复内容开始--- 最近在做关于物体姿态估计的项目 基本思路就是 我们在估计物体的pose的时候,需要用分割得到的点云与模型库中的模型做匹配 1.通过基于RANSANC的SAC-IA将点云和模型 ...

  5. element form 校验数组每一项

    1.校验的数据结构如下: 2.html结构 <el-dialog :title="title" :visible.sync="visable" width ...

  6. [windows官网]虚拟地址空间

    虚拟地址空间 https://docs.microsoft.com/zh-cn/windows-hardware/drivers/gettingstarted/virtual-address-spac ...

  7. [转帖]从光刻机的发展,看懂ASML为何是不可取替

    从光刻机的发展,看懂ASML为何是不可取替 http://mini.eastday.com/mobile/171230223351249.html# 2017-12-30 22:33    来源:半导 ...

  8. java模拟from表单提交,上传图片

    /** * java上传表单,有图片 * @param urlStr 上传地址 * @param textMap 表单参数 * @param fileMap 文件参数 key:文件名称 value:文 ...

  9. C++Primer 5th Chap7 Classes

    this关键字: 在成员函数内部可以直接调用函数的对象的成员(类成员的直接访问看做是对this隐式引用,默认this指向非常量) 例如:string isbn() const{return this- ...

  10. 通过jquery触发select自身的change事件

    ###通过jquery触发select自身的change事件 1.通过js来去触发select的change事件 代码如下:包含了html部分和js部分 //html部分 <select cla ...