查看现有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. 高级UI-符合MD的常用控件

    在Google提供的控件中,在support-design及v4,v7包中,存在着很多符合MD标准的控件,这里罗列出一些常用的控件 TextInputLayout 这个控件在作为输入框的时候是极其方便 ...

  2. C# checked和unchecked 关键字详解

    checked 和 unchecked关键字用来限定检查或者不检查数学运算溢出的:如果使用了checked发生数学运算溢出时会抛出OverflowException:如果使用了unchecked则不会 ...

  3. win7下exe文件设置为开机启动

    如何将自己的exe程序设置为开机自启动 如何将自己的exe程序设置为开机自启动 将自己的exe程序设置为开机自启动话不多说,直接看 首先1:cmd—>regedit 其次找到下面的路径就可以:( ...

  4. iframe里访问父级里的方法属性

    window.parent.attributeName;  // 访问属性attributeName是在父级窗口的属性名 window.parent.Func();  // 访问属性Func()是在父 ...

  5. opencv根据摄像头名称获取索引值

    OpenCV的VideoCapture是一个视频读取与解码的API接口,支持各种视频格式.网络视频流.摄像头读取. 针对一般摄像头的读取,opencv为了实现跨平台读取摄像头时是使用的摄像头索引, V ...

  6. 笔记-8:使用turtle库进行图形绘制

    1.窗体函数 turtle.setup(width,height,startx,starty) 作用:设置窗体的大小和位置 width:窗口宽度,如果值是整数,表示像素值:如果值是小数,表示窗口宽度与 ...

  7. Python之并行编程笔记

    概述: 非并发: 1 程序由单个步骤序列构成  2 包含独立子任务的程序执行性能低 并发:  1 异步.高效  2 分解子任务.简化流程与逻辑 进程process:1 一个程序的执行实例  2 每个进 ...

  8. prometheus+grafana监控nginx

    被监控机器环境搭建&配置 nginx-module-vts下载: https://github.com/vozlt/nginx-module-vts nginx-module-vts安装 un ...

  9. Admui相关第三方插件

    ace 版本:1.2.3au 官网:https://github.com/ajaxorg/ace-builds/ 许可:BSD 依赖:无 DataAPI:data-pulgin="ace&q ...

  10. The Heaviest Non-decreasing Subsequence Problem

    最长非递减子序列变形题,把大于等于10000的copy五次放回去就可以了 ac代码: #include <cstdio> #include <cstring> #include ...