1 进入nginx安装目录,查看nginx版本及其编译参数:

[root@localhost nginx]# ./nginx -V

nginx version: nginx/1.8.0

built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

built with OpenSSL 1.0.1c 10 May 2012

TLS SNI support enabled

configure arguments: --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.37 --with-zlib=../zlib-1.2.8 --with-openssl=../openssl-1.0.1c --with-http_stub_status_module --user=nginx --group=nginx

[root@localhost nginx]#

2 进入nginx的源码目录:

[root@localhost src]# ls

nginx-1.8.0         openssl-1.0.1c         pcre-8.37         zlib-1.2.8

nginx-1.8.0.tar.gz  openssl-1.0.1c.tar.gz  pcre-8.37.tar.gz  zlib-1.2.8.tar.gz

[root@localhost src]# pwd

/usr/local/src

[root@localhost src]# cd nginx-1.8.0

[root@localhost nginx-1.8.0]# ls

auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src

[root@localhost nginx-1.8.0]#

3 以下是重新编译的代码和模块:

./configure --sbin-path=/usr/local/nginx/nginx \

--conf-path=/usr/local/nginx/nginx.conf \

--pid-path=/usr/local/nginx/nginx.pid \

--with-http_ssl_module \

--with-http_realip_module \

--with-http_addition_module \

--with-http_stub_status_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_auth_request_module \

--with-mail \

--with-mail_ssl_module \

--with-file-aio \

--with-http_spdy_module \

--with-ipv6 \

--with-pcre=../pcre-8.37 \

--with-zlib=../zlib-1.2.8 \

--with-openssl=../openssl-1.0.1c \

--user=nginx \

--group=nginx;

截图如下:

详细参数请看官网:http://nginx.org/en/docs/configure.html

4 编译:

make   (注意:千万不要make install)

5 make完成之后再当前目录下的objs目录下就多了个nginx,这个就是新版本的程序了

6 备份旧的nginx程序

[root@localhost objs]# cp /usr/local/nginx/nginx /usr/local/nginx/nginx.bak

[root@localhost objs]# cd /usr/local/nginx/

[root@localhost nginx]# ls

client_body_temp        fastcgi_temp  mime.types.default  sbin                  uwsgi_temp

conf                    html          nginx               scgi_params           win-utf

fastcgi.conf            koi-utf       nginx.bak           scgi_params.default

fastcgi.conf.default    koi-win       nginx.conf          scgi_temp

fastcgi_params          logs          nginx.conf.default  uwsgi_params

fastcgi_params.default  mime.types    proxy_temp          uwsgi_params.default

[root@localhost nginx]#

6 把新的nginx程序覆盖旧的

[root@localhost nginx-1.8.0]# ls

auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src

[root@localhost nginx-1.8.0]# cp objs/nginx /usr/local/nginx/nginx

cp:是否覆盖"/usr/local/nginx/nginx"? y

[root@localhost nginx-1.8.0]#

7 测试新的nginx程序是否正确

[root@localhost nginx-1.8.0]#/usr/local/nginx/nginx -t

8 平滑重启nginx

/usr/local/nginx/nginx –s reload

9 查看nginx版本及其编译参数:

/usr/local/nginx/nginx –V

03_Nginx添加新模块的更多相关文章

  1. thinkPHP5 添加新模块

    1. 修改build.php文件 , 添加新模块 2. cmd 运行命令 php think build --config build.php

  2. 线上nginx 平滑添加新模块;如(--with-http_realip_module)

    nginx 添加模块1.查看当前nginx信息(配置文件路径,启动用户...) ps aux | grep nginx 2.查看当前nginx已启用的模块(记录模块信息,安装路径)./nginx -V ...

  3. nginx使用热部署添加新模块

    简介 当初次编译安装nginx时,http_ssl_module 模块默认是不编译进nginx的二进制文件当中,如果需要添加 ssl 证书.也就是使用 https协议.那么则需要添加 http_ssl ...

  4. springboot~添加新模块的方法

    在springboot项目框架里,把一个项目两大模块,主项目main和测试项目test,而我们的测试项目根据功能又可以再分,比如可以有单元测试,集成测试,业务测试等等. 对于一个初学者来说,建立模块的 ...

  5. httpd添加新模块

    */ .hljs { display: block; overflow-x: auto; padding: 0.5em; color: #333; background: #f8f8f8; } .hl ...

  6. nginx添加新模块

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

  7. 03_Nginx加入新模块

     1 进入nginx安装文件夹,查看nginx版本号及其编译參数: [root@localhost nginx]# ./nginx -V nginx version: nginx/1.8.0 bu ...

  8. Nginx编译添加新模块

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

  9. Nginx重新编译添加新模块

    找到nginx的安装包目录,如果没有的话去官网重新下载 查看ngixn版本极其编译参数 /usr/local/nginx/sbin/nginx -V 进入nginx源码目录,重新设置nginx ./c ...

随机推荐

  1. Docker简介/安装/使用

    什么是Docker?docker是一个开源的应用容器引擎,系统级的轻量虚拟化技术.应用程序的自动化部署解决方案,能够迅速创建一个容器,并在容器上部署和运行应用程序,并通过配置文件可以轻松实现应用程序的 ...

  2. 团队项目必备神器——自定义Lint

    Lint 在android studio中内置了大概200个左右的lint检查,比如定义变量未使用,直接Handler报内存泄漏提醒,时时刻刻在监督着我们的代码.自己定制了一些Lint规则,项目开源在 ...

  3. ThinkPHP 初探

    准备 ThinkPHP下载 Eclipse-for-php 如何使用 放置位置 检验引用效果 效果 路由 调试之模板的使用 前提 生产模式 开发模式 添加完相应的路径以及模板文件后 总结 对国人开发的 ...

  4. Linux动态频率调节系统CPUFreq之三:governor

    在上一篇文章中,介绍了cpufreq的core层,core提供了cpufreq系统的初始化,公共数据结构的建立以及对cpufreq中其它子部件提供注册功能.core的最核心功能是对policy的管理, ...

  5. activiti uuid主键

    1.1.1.  activiti默认主键生成方式 ; 下面我们看一下主键的生成策略:主键的生成策略定义在IdGenerator接口中,接口定义如下所示: public interface IdGene ...

  6. LMAX高并发系统架构

    很早就看到过MF的这篇The LMAX Architecture,可是之前一来英文水平不够,二来确实看不懂- 今天有幸再次看到,一口气读完终于有所领悟. 1 Overall Architecture ...

  7. Linux系统编程---实现目录或者文件拷贝

    关于拷贝文件,前面写过一个例子:点击打开链接 ,可以看看,实现cp命令. 这次我们实现一个目录和文件的拷贝,综合点. #include <stdio.h> #include <fcn ...

  8. UNIX网络编程——客户/服务器程序设计示范(一)

    下面给出的是客户程序用于测试我们的服务器程序的各个变体. #include "unp.h" #define MAXN 16384 /* max # bytes to request ...

  9. gradle2.0笔记——让项目升级到gradle2.0

    昨晚看到QQ群消息说gradle2.0发布了,今天去看了一下,确实是昨天发布的,为rc版本:Gradle 2.0-rc-2.于是决定试一下. gradle可以在官网上下载,地址如下:http://ww ...

  10. Elcipse安装gradle插件

    参考:             http://www.gradle.org/docs/current/userguide/installation.html (1)下载Gradle 官网下载www.g ...