查看现有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. 解决安装eclipse时出现"Failed to load JNI shared library"

    下午远程帮别人弄了很久的eclipse,安装时老是出现如图的字样 最后在安装配置文件中找到问题所在,这个最新版本的eclipse需要jdk1.8的环境,由于系统的jdk是1.7,版本过低从而导致安装失 ...

  2. golang web框架 beego 学习 (六) request body和module的映射

    router.go package routers import ( "gowebProject/controllers" "github.com/astaxie/bee ...

  3. 最新 新浪java校招面经 (含整理过的面试题大全)

    从6月到10月,经过4个月努力和坚持,自己有幸拿到了网易雷火.京东.去哪儿.新浪等10家互联网公司的校招Offer,因为某些自身原因最终选择了新浪.6.7月主要是做系统复习.项目复盘.LeetCode ...

  4. XMemcached的基本使用

    XMemcached是memcached的一个java客户端,基于java nio,支持memcached的所有协议.本文简要介绍XMemcached的基本使用. 一.添加依赖 <depende ...

  5. 使用Apache服务部署网站(基于IP,域名,端口)

    本篇主要学习Apache网站服务程序的基本部署,基于IP地址.主机名(域名).端口号的虚拟主机功能. 1.基于IP地址 首先我们需要在虚拟机中线安装Apache服务程序,Apache服务程序的软件包名 ...

  6. vim文本编辑器的介绍及使用

    (一)什么是vim编辑器 在Linux系统中配置应用服务,实际上就是在修改它的配置文件(配置文件可能有多个,其中包含不同的参数),而且日常工作中也一定免不了编写文档的事情吧,这些都是要通过文本编辑器来 ...

  7. RISC-V汇编指南

    原文出处:https://github.com/riscv/riscv-asm-manual/blob/master/riscv-asm.md RISC-V Assembly Programmer's ...

  8. IIC挂死问题解决过程

    0.环境:arm CPU 带有IIC控制器作为slave端,带有调试串口. 1.bug表现:IIC slave 在系统启动后概率挂死,导致master无法detect到slave. 猜测1:认为IIC ...

  9. 1、3 list 加入缓存,并postman测试

    1.pom.xml导入redis依赖 2.配置文件配置 redis 3.主类开启缓存注解 4.Service方法上加注解 @Cacheable(value="list")//val ...

  10. java输入输出 -- Java NIO之套接字通道

    一.简介 前面一篇文章讲了文件通道,本文继续来说说另一种类型的通道 – 套接字通道.在展开说明之前,咱们先来聊聊套接字的由来.套接字即 socket,最早由伯克利大学的研究人员开发,所以经常被称为Be ...