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;

截图例如以下:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" v:shapes="图片_x0020_3" alt="" />

具体參数请看官网: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. 03_Nginx添加新模块

     1 进入nginx安装目录,查看nginx版本及其编译参数: [root@localhost nginx]# ./nginx -V nginx version: nginx/1.8.0 buil ...

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

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

  3. Anaconda安装新模块

    如果使用import导入的新模块没有安装,则会报错,下面是使用Anaconda管理进行安装的过程:1.打开Anaconda工具,如图: 2.可通过输入 conda list 查看已安装的模块 3.如果 ...

  4. ecmall 开发一个新模块

    要开发新模块,要借鉴原有模块的代码并进行修改. 首先打开目录external/modules 会有一个datacall文件夹,这个文件夹对应的就是一个模块. 复制datacall文件夹,重命名为tes ...

  5. [实战] 给现有的NGINX二进制RPM包加新模块

    [实战] 给现有的NGINX二进制RPM包加新模块 一.前言 在做 wiki 的镜像,这样以后文章就可以使用外链了(链接直接跳转墙内小站). 遇到的问题就是:我的 NGINX 包安装的时候图方便采用 ...

  6. Magento 2开发教程 - 创建新模块

    视频在youtube网站国内访问不了,可以使用FQ软件查看. 视频地址:www.youtube.com/embed/682p52tFcmY@autoplay=1 下面是视频文字介绍: Magento ...

  7. thinkPHP5 添加新模块

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

  8. nginx增加新模块

    以gunzip这个模块为例,讲述一下,在nginx中如何安装新的模块 1.首先查看nginx已经安装了哪些模块. nginx –V 2.发现没有gunzip模块,安装 进入nginx的安装目录中,不是 ...

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

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

随机推荐

  1. 一个 Java 的 Socket 服务器和客户端通信的例子

    一个 HelloWord 级别的 Java Socket 通信的例子.通讯过程: 先启动 Server 端,进入一个死循环以便一直监听某端口是否有连接请求.然后运行 Client 端,客户端发出连接请 ...

  2. BZOJ-1043 [HAOI2008]下落的圆盘

    几何题... 先把所有圆储存起来,然后对于每个圆我们求得之后放下的圆挡住了的部分,求个并集,并把没被挡到的周长加进答案. #include <cstdlib> #include <c ...

  3. [usaco jan 09] 气象牛 baric [dp]

    题面: 传送门 思路: 题意有点绕,实际上就是给你一个计算规则,让你取最少的元素,通过这个计算方式,得到一个小于指定误差上限的结果 这个规则分为三个部分,这里分别用pre,sum,suf表示 因为给定 ...

  4. 挖煤(coal)

    挖煤(coal) solution 我好弱,啥也想不到. 想了很久dp,这有后效性啊. 结果倒着做就可以了,因为后面的不会影响前面的. 考虑前面的影响后面:挖煤相当于让后面所有a[I]*(1+k%) ...

  5. 关于5Gwifi

    但目前全球最快的WiFi传输速度仅为300Mbps(少数可以达到600Mbps),相当于每秒只能传输约36MB的内容.在人们只利用它来看网站.处理邮件的年代,这没什么问题.但到了今天,面对越来越复杂的 ...

  6. python中文注释报错

    # -*- coding: utf-8 -*-#coding=utf-8 在开头加这个

  7. 如何在vue里实现同步阻塞请求,请求完成之前不加载页面或组件?

    https://segmentfault.com/q/1010000013787292 答案: getUserInfo函数数据请求下来,设置开关flag=true,页面最外层box v-if=&quo ...

  8. bat文件【java调用】

    Runtime.getRuntime().exec("cmd /c del c:\\a.doc");   //Runtime.getRuntime().exec("not ...

  9. linux mmap 详解【转】

    转自:http://blog.chinaunix.net/uid-20321537-id-3483405.html 一.前言mmap的具体实现以前在学习内核时学习过,但是对于其中的很多函数是一知半解的 ...

  10. 【C/C++】快速排序的两种实现思路

    方法一:不断填坑,一次确定一个值.http://blog.csdn.net/morewindows/article/details/6684558 #include<stdio.h> vo ...