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. Scikit-learn:模型选择Model selection

    http://blog.csdn.net/pipisorry/article/details/52250983 选择合适的estimator 通常机器学习最难的一部分是选择合适的estimator,不 ...

  2. 利用CocoaHTTPServer实现wifi局域网传输文件到iphone

    背景 近日在做一个代码阅读器,其中涉及到代码文件的上传,之前看到过许多app支持局域网传文件,因此就通过查询和研究实现了此功能,我是用的框架是CocoaHTTPServer. 原理 CocoaHTTP ...

  3. itoo-快捷部署脚本--提高部署开发效率

     本次是第一次使用批处理文件来作为批量操作的工具,代替了人工的手动的复制,粘贴的方式,使用脚本实现了项目的启动.自动化部署,打开项目根目录.等等,提高了开发和调试的效率. 说明: 当前版本:1.0 ...

  4. 自守数算法----C语言实现

    #include <stdio.h> //自守数算法 //ep : 25 ^ 2 = 625 76 ^ 2 = 5776 9376 ^ 2 = 87909376 /*ep : * 376 ...

  5. GCD API记录(二)

    前言 这是关于GCD的第二篇文章,GCD的API有100多个,通过快捷键Option + 单击,可以在Reference中的Grand Central Dispatch (GCD) Reference ...

  6. Android View框架总结(一)

    View和Activity的区别 View有哪些? ViewGroup是什么? 为什么Google产生ViewGroup? View的层级结构是什么? View的onMeasure()/onLayou ...

  7. 09 ExpanableListView 的代码例子

    <span style="font-size:18px;">package com.qf.day09_expandablelistview03; import andr ...

  8. 初探linux子系统集之timer子系统(三)

    因为现在的linux虽然还是可以使用低精度的timer,但是趋势是高精度hrtimer,所以上一篇试着翻译一下hrtimer的一些介绍,翻译的不是很好,看来英语还得好好学习啊,下面还是好好学习下lin ...

  9. Android简易实战教程--第二话《两种进度条》

    点击按钮模拟进度条下载进度,"下载"完成进度条消失. 代码如下: xml: <?xml version="1.0" encoding="utf- ...

  10. 【一天一道LeetCode】#237. Delete Node in a Linked List

    一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Write a ...