前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nginx反向代理服务器

Nginx反向代理服务器

作者头像
别先生
发布2019-07-23 16:13:55
2.3K0
发布2019-07-23 16:13:55
举报
文章被收录于专栏:别先生

1、Nginx做反向代理服务器(反向代理区分与正向代理),可以为反向代理的服务器集群做集群管理和负载均衡。 正向代理: 对客户端已知,对服务端透明的代理应用,称为正向代理。

反向代理: 对服务端已知,对客户端透明的代理应用,称为反向代理。如:nginx。

2、Nginx的手动安装搭建。

参考:https://www.cnblogs.com/jackyzm/p/9600738.html#top

首先搭建Nginx的安装环境。

代码语言:javascript
复制
1 Nginx服务器一旦安装,一般提供7*24小时服务。建议安装在服务器中(如:Unix、Linux)。
2 Nginx是一个C语言开发的应用服务器。可以提供的服务有:静态WEB服务(Apache http server),邮件代理服务器,虚拟主机,反向代理服务器。
3 Nginx应用体积非常的小,对CPU和内存的要求也很低。且对负载能力有非常好的体现。核心功能是应用自主开发,很多的附属功能都是借助其他的应用实现的,如:SSL协议的解析-opensll,perl库(正则)的解析-perl包实现。
4 Nginx安装成功后,在安装位置有三个目录。sbin/conf/html。 sbin是可执行文件,html是nginx提供的默认静态页面,conf是配置文件目录。

nginx 是 C 语言开发,建议在 linux 上运行,本教程使用 Centos7.5 作为安装环境。

1)、安装gcc

代码语言:javascript
复制
安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,需要安装 gcc:yum install gcc-c++

yum:在线安装命令。
install:安装
-y:不提供互动要求。
gcc:编译器名称。
-c++:安装gcc编译器的c++编译模块。

[root@slaver4 ~]# yum install -y gcc-c++

代码语言:javascript
复制
  1 [root@slaver4 ~]# yum install -y gcc-c++
  2 已加载插件:fastestmirror, langpacks
  3 Loading mirror speeds from cached hostfile
  4  * base: mirrors.zju.edu.cn
  5  * extras: mirror.bit.edu.cn
  6  * updates: mirrors.njupt.edu.cn
  7 正在解决依赖关系
  8 --> 正在检查事务
  9 ---> 软件包 gcc-c++.x86_64.0.4.8.5-36.el7_6.2 将被 安装
 10 --> 正在处理依赖关系 libstdc++-devel = 4.8.5-36.el7_6.2,它被软件包 gcc-c++-4.8.5-36.el7_6.2.x86_64 需要
 11 --> 正在处理依赖关系 libstdc++ = 4.8.5-36.el7_6.2,它被软件包 gcc-c++-4.8.5-36.el7_6.2.x86_64 需要
 12 --> 正在处理依赖关系 gcc = 4.8.5-36.el7_6.2,它被软件包 gcc-c++-4.8.5-36.el7_6.2.x86_64 需要
 13 --> 正在检查事务
 14 ---> 软件包 gcc.x86_64.0.4.8.5-36.el7_6.2 将被 安装
 15 --> 正在处理依赖关系 libgomp = 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
 16 --> 正在处理依赖关系 cpp = 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
 17 --> 正在处理依赖关系 libgcc >= 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
 18 --> 正在处理依赖关系 glibc-devel >= 2.2.90-12,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
 19 ---> 软件包 libstdc++.x86_64.0.4.8.5-36.el7 将被 升级
 20 ---> 软件包 libstdc++.x86_64.0.4.8.5-36.el7_6.2 将被 更新
 21 ---> 软件包 libstdc++-devel.x86_64.0.4.8.5-36.el7_6.2 将被 安装
 22 --> 正在检查事务
 23 ---> 软件包 cpp.x86_64.0.4.8.5-36.el7_6.2 将被 安装
 24 ---> 软件包 glibc-devel.x86_64.0.2.17-260.el7_6.6 将被 安装
 25 --> 正在处理依赖关系 glibc-headers = 2.17-260.el7_6.6,它被软件包 glibc-devel-2.17-260.el7_6.6.x86_64 需要
 26 --> 正在处理依赖关系 glibc-headers,它被软件包 glibc-devel-2.17-260.el7_6.6.x86_64 需要
 27 ---> 软件包 libgcc.x86_64.0.4.8.5-36.el7 将被 升级
 28 ---> 软件包 libgcc.x86_64.0.4.8.5-36.el7_6.2 将被 更新
 29 ---> 软件包 libgomp.x86_64.0.4.8.5-36.el7 将被 升级
 30 ---> 软件包 libgomp.x86_64.0.4.8.5-36.el7_6.2 将被 更新
 31 --> 正在检查事务
 32 ---> 软件包 glibc-headers.x86_64.0.2.17-260.el7_6.6 将被 安装
 33 --> 正在处理依赖关系 kernel-headers >= 2.2.1,它被软件包 glibc-headers-2.17-260.el7_6.6.x86_64 需要
 34 --> 正在处理依赖关系 kernel-headers,它被软件包 glibc-headers-2.17-260.el7_6.6.x86_64 需要
 35 --> 正在检查事务
 36 ---> 软件包 kernel-headers.x86_64.0.3.10.0-957.21.3.el7 将被 安装
 37 --> 解决依赖关系完成
 38 
 39 依赖关系解决
 40 
 41 =======================================================================================================================
 42  Package                        架构                  版本                                源                      大小
 43 =======================================================================================================================
 44 正在安装:
 45  gcc-c++                        x86_64                4.8.5-36.el7_6.2                    updates                7.2 M
 46 为依赖而安装:
 47  cpp                            x86_64                4.8.5-36.el7_6.2                    updates                5.9 M
 48  gcc                            x86_64                4.8.5-36.el7_6.2                    updates                 16 M
 49  glibc-devel                    x86_64                2.17-260.el7_6.6                    updates                1.1 M
 50  glibc-headers                  x86_64                2.17-260.el7_6.6                    updates                684 k
 51  kernel-headers                 x86_64                3.10.0-957.21.3.el7                 updates                8.0 M
 52  libstdc++-devel                x86_64                4.8.5-36.el7_6.2                    updates                1.5 M
 53 为依赖而更新:
 54  libgcc                         x86_64                4.8.5-36.el7_6.2                    updates                102 k
 55  libgomp                        x86_64                4.8.5-36.el7_6.2                    updates                158 k
 56  libstdc++                      x86_64                4.8.5-36.el7_6.2                    updates                305 k
 57 
 58 事务概要
 59 =======================================================================================================================
 60 安装  1 软件包 (+6 依赖软件包)
 61 升级           ( 3 依赖软件包)
 62 
 63 总计:41 M
 64 总下载量:41 M
 65 Downloading packages:
 66 (1/7): glibc-headers-2.17-260.el7_6.6.x86_64.rpm                                                | 684 kB  00:00:01     
 67 (2/7): cpp-4.8.5-36.el7_6.2.x86_64.rpm                                                          | 5.9 MB  00:00:05     
 68 (3/7): libstdc++-devel-4.8.5-36.el7_6.2.x86_64.rpm                                              | 1.5 MB  00:00:01     
 69 (4/7): gcc-4.8.5-36.el7_6.2.x86_64.rpm                                                          |  16 MB  00:00:09     
 70 (5/7): glibc-devel-2.17-260.el7_6.6.x86_64.rpm                                                  | 1.1 MB  00:00:10     
 71 (6/7): gcc-c++-4.8.5-36.el7_6.2.x86_64.rpm                                                      | 7.2 MB  00:00:12     
 72 (7/7): kernel-headers-3.10.0-957.21.3.el7.x86_64.rpm                                            | 8.0 MB  00:00:11     
 73 -----------------------------------------------------------------------------------------------------------------------
 74 总计                                                                                   3.1 MB/s |  41 MB  00:00:13     
 75 Running transaction check
 76 Running transaction test
 77 Transaction test succeeded
 78 Running transaction
 79   正在更新    : libgcc-4.8.5-36.el7_6.2.x86_64                                                                    1/13 
 80   正在更新    : libstdc++-4.8.5-36.el7_6.2.x86_64                                                                 2/13 
 81   正在安装    : libstdc++-devel-4.8.5-36.el7_6.2.x86_64                                                           3/13 
 82   正在安装    : kernel-headers-3.10.0-957.21.3.el7.x86_64                                                         4/13 
 83   正在安装    : glibc-headers-2.17-260.el7_6.6.x86_64                                                             5/13 
 84   正在安装    : glibc-devel-2.17-260.el7_6.6.x86_64                                                               6/13 
 85   正在安装    : cpp-4.8.5-36.el7_6.2.x86_64                                                                       7/13 
 86   正在更新    : libgomp-4.8.5-36.el7_6.2.x86_64                                                                   8/13 
 87   正在安装    : gcc-4.8.5-36.el7_6.2.x86_64                                                                       9/13 
 88   正在安装    : gcc-c++-4.8.5-36.el7_6.2.x86_64                                                                  10/13 
 89   清理        : libstdc++-4.8.5-36.el7.x86_64                                                                    11/13 
 90   清理        : libgcc-4.8.5-36.el7.x86_64                                                                       12/13 
 91   清理        : libgomp-4.8.5-36.el7.x86_64                                                                      13/13 
 92   验证中      : glibc-devel-2.17-260.el7_6.6.x86_64                                                               1/13 
 93   验证中      : libstdc++-devel-4.8.5-36.el7_6.2.x86_64                                                           2/13 
 94   验证中      : gcc-c++-4.8.5-36.el7_6.2.x86_64                                                                   3/13 
 95   验证中      : libgcc-4.8.5-36.el7_6.2.x86_64                                                                    4/13 
 96   验证中      : libgomp-4.8.5-36.el7_6.2.x86_64                                                                   5/13 
 97   验证中      : cpp-4.8.5-36.el7_6.2.x86_64                                                                       6/13 
 98   验证中      : gcc-4.8.5-36.el7_6.2.x86_64                                                                       7/13 
 99   验证中      : glibc-headers-2.17-260.el7_6.6.x86_64                                                             8/13 
100   验证中      : kernel-headers-3.10.0-957.21.3.el7.x86_64                                                         9/13 
101   验证中      : libstdc++-4.8.5-36.el7_6.2.x86_64                                                                10/13 
102   验证中      : libgomp-4.8.5-36.el7.x86_64                                                                      11/13 
103   验证中      : libgcc-4.8.5-36.el7.x86_64                                                                       12/13 
104   验证中      : libstdc++-4.8.5-36.el7.x86_64                                                                    13/13 
105 
106 已安装:
107   gcc-c++.x86_64 0:4.8.5-36.el7_6.2                                                                                    
108 
109 作为依赖被安装:
110   cpp.x86_64 0:4.8.5-36.el7_6.2                               gcc.x86_64 0:4.8.5-36.el7_6.2                            
111   glibc-devel.x86_64 0:2.17-260.el7_6.6                       glibc-headers.x86_64 0:2.17-260.el7_6.6                  
112   kernel-headers.x86_64 0:3.10.0-957.21.3.el7                 libstdc++-devel.x86_64 0:4.8.5-36.el7_6.2                
113 
114 作为依赖被升级:
115   libgcc.x86_64 0:4.8.5-36.el7_6.2      libgomp.x86_64 0:4.8.5-36.el7_6.2      libstdc++.x86_64 0:4.8.5-36.el7_6.2     
116 
117 完毕!
118 [root@slaver4 ~]# 

2)、PCRE PCRE(Perl Compatible Regular Expressions)是一个 Perl 库,包括 perl 兼容的正则表达式库。nginx 的 http 模块使用 pcre 来解析正则表达式,所以需要在 linux 上安装 pcre 库。 yum install -y pcre pcre-devel 注:pcre-devel 是使用 pcre 开发的一个二次开发库。nginx 也需要此库。可以一次性安装若干应用,多应用之间使用空格分隔。建议一次性安装多应用的时候,安装的多应用应该有直接关系。比如:pcre,pcre-devel。

代码语言:javascript
复制
 1 [root@slaver4 ~]# yum install -y pcre pcre-devel
 2 已加载插件:fastestmirror, langpacks
 3 Loading mirror speeds from cached hostfile
 4  * base: mirrors.zju.edu.cn
 5  * extras: mirror.bit.edu.cn
 6  * updates: mirrors.njupt.edu.cn
 7 软件包 pcre-8.32-17.el7.x86_64 已安装并且是最新版本
 8 正在解决依赖关系
 9 --> 正在检查事务
10 ---> 软件包 pcre-devel.x86_64.0.8.32-17.el7 将被 安装
11 --> 解决依赖关系完成
12 
13 依赖关系解决
14 
15 =======================================================================================================================
16  Package                       架构                      版本                            源                       大小
17 =======================================================================================================================
18 正在安装:
19  pcre-devel                    x86_64                    8.32-17.el7                     base                    480 k
20 
21 事务概要
22 =======================================================================================================================
23 安装  1 软件包
24 
25 总下载量:480 k
26 安装大小:1.4 M
27 Downloading packages:
28 pcre-devel-8.32-17.el7.x86_64.rpm                                                               | 480 kB  00:00:06     
29 Running transaction check
30 Running transaction test
31 Transaction test succeeded
32 Running transaction
33   正在安装    : pcre-devel-8.32-17.el7.x86_64                                                                      1/1 
34   验证中      : pcre-devel-8.32-17.el7.x86_64                                                                      1/1 
35 
36 已安装:
37   pcre-devel.x86_64 0:8.32-17.el7                                                                                      
38 
39 完毕!
40 [root@slaver4 ~]# 

3)、zlib zlib 库提供了很多种压缩和解压缩的方式,nginx 使用 zlib 对 http 包的内容进行 gzip,所以需要在 linux 上安装 zlib 库。yum install -y zlib zlib-devel。

代码语言:javascript
复制
 1 [root@slaver4 ~]# yum install -y zlib zlib-devel
 2 已加载插件:fastestmirror, langpacks
 3 Loading mirror speeds from cached hostfile
 4  * base: mirrors.zju.edu.cn
 5  * extras: mirror.bit.edu.cn
 6  * updates: mirrors.njupt.edu.cn
 7 软件包 zlib-1.2.7-18.el7.x86_64 已安装并且是最新版本
 8 正在解决依赖关系
 9 --> 正在检查事务
10 ---> 软件包 zlib-devel.x86_64.0.1.2.7-18.el7 将被 安装
11 --> 解决依赖关系完成
12 
13 依赖关系解决
14 
15 =================================================================================================================================================================================================================
16  Package                                             架构                                            版本                                                    源                                             大小
17 =================================================================================================================================================================================================================
18 正在安装:
19  zlib-devel                                          x86_64                                          1.2.7-18.el7                                            base                                           50 k
20 
21 事务概要
22 =================================================================================================================================================================================================================
23 安装  1 软件包
24 
25 总下载量:50 k
26 安装大小:132 k
27 Downloading packages:
28 zlib-devel-1.2.7-18.el7.x86_64.rpm                                                                                                                                                        |  50 kB  00:00:08     
29 Running transaction check
30 Running transaction test
31 Transaction test succeeded
32 Running transaction
33   正在安装    : zlib-devel-1.2.7-18.el7.x86_64                                                                                                                                                               1/1 
34   验证中      : zlib-devel-1.2.7-18.el7.x86_64                                                                                                                                                               1/1 
35 
36 已安装:
37   zlib-devel.x86_64 0:1.2.7-18.el7                                                                                                                                                                               
38 
39 完毕!
40 [root@slaver4 ~]# 

4)、openssl OpenSSL 是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及 SSL 协议,并提供丰富的应用程序供测试或其它目的使用。 nginx 不仅支持 http 协议,还支持 https(即在 ssl 协议上传输 http),所以需要在 linux 安装 openssl 库。 yum install -y openssl openssl-devel

代码语言:javascript
复制
  1 [root@slaver4 ~]# yum install -y openssl openssl-devel
  2 已加载插件:fastestmirror, langpacks
  3 Loading mirror speeds from cached hostfile
  4  * base: mirrors.zju.edu.cn
  5  * extras: mirror.bit.edu.cn
  6  * updates: mirrors.njupt.edu.cn
  7 正在解决依赖关系
  8 --> 正在检查事务
  9 ---> 软件包 openssl.x86_64.1.1.0.2k-16.el7 将被 升级
 10 ---> 软件包 openssl.x86_64.1.1.0.2k-16.el7_6.1 将被 更新
 11 --> 正在处理依赖关系 openssl-libs(x86-64) = 1:1.0.2k-16.el7_6.1,它被软件包 1:openssl-1.0.2k-16.el7_6.1.x86_64 需要
 12 ---> 软件包 openssl-devel.x86_64.1.1.0.2k-16.el7_6.1 将被 安装
 13 --> 正在处理依赖关系 krb5-devel(x86-64),它被软件包 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64 需要
 14 --> 正在检查事务
 15 ---> 软件包 krb5-devel.x86_64.0.1.15.1-37.el7_6 将被 安装
 16 --> 正在处理依赖关系 libkadm5(x86-64) = 1.15.1-37.el7_6,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
 17 --> 正在处理依赖关系 krb5-libs(x86-64) = 1.15.1-37.el7_6,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
 18 --> 正在处理依赖关系 libverto-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
 19 --> 正在处理依赖关系 libselinux-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
 20 --> 正在处理依赖关系 libcom_err-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
 21 --> 正在处理依赖关系 keyutils-libs-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
 22 ---> 软件包 openssl-libs.x86_64.1.1.0.2k-16.el7 将被 升级
 23 ---> 软件包 openssl-libs.x86_64.1.1.0.2k-16.el7_6.1 将被 更新
 24 --> 正在检查事务
 25 ---> 软件包 keyutils-libs-devel.x86_64.0.1.5.8-3.el7 将被 安装
 26 ---> 软件包 krb5-libs.x86_64.0.1.15.1-34.el7 将被 升级
 27 ---> 软件包 krb5-libs.x86_64.0.1.15.1-37.el7_6 将被 更新
 28 ---> 软件包 libcom_err-devel.x86_64.0.1.42.9-13.el7 将被 安装
 29 ---> 软件包 libkadm5.x86_64.0.1.15.1-37.el7_6 将被 安装
 30 ---> 软件包 libselinux-devel.x86_64.0.2.5-14.1.el7 将被 安装
 31 --> 正在处理依赖关系 libsepol-devel(x86-64) >= 2.5-10,它被软件包 libselinux-devel-2.5-14.1.el7.x86_64 需要
 32 --> 正在处理依赖关系 pkgconfig(libsepol),它被软件包 libselinux-devel-2.5-14.1.el7.x86_64 需要
 33 ---> 软件包 libverto-devel.x86_64.0.0.2.5-4.el7 将被 安装
 34 --> 正在检查事务
 35 ---> 软件包 libsepol-devel.x86_64.0.2.5-10.el7 将被 安装
 36 --> 解决依赖关系完成
 37 
 38 依赖关系解决
 39 
 40 =================================================================================================================================================================================================================
 41  Package                                                 架构                                       版本                                                       源                                           大小
 42 =================================================================================================================================================================================================================
 43 正在安装:
 44  openssl-devel                                           x86_64                                     1:1.0.2k-16.el7_6.1                                        updates                                     1.5 M
 45 正在更新:
 46  openssl                                                 x86_64                                     1:1.0.2k-16.el7_6.1                                        updates                                     493 k
 47 为依赖而安装:
 48  keyutils-libs-devel                                     x86_64                                     1.5.8-3.el7                                                base                                         37 k
 49  krb5-devel                                              x86_64                                     1.15.1-37.el7_6                                            updates                                     271 k
 50  libcom_err-devel                                        x86_64                                     1.42.9-13.el7                                              base                                         31 k
 51  libkadm5                                                x86_64                                     1.15.1-37.el7_6                                            updates                                     178 k
 52  libselinux-devel                                        x86_64                                     2.5-14.1.el7                                               base                                        187 k
 53  libsepol-devel                                          x86_64                                     2.5-10.el7                                                 base                                         77 k
 54  libverto-devel                                          x86_64                                     0.2.5-4.el7                                                base                                         12 k
 55 为依赖而更新:
 56  krb5-libs                                               x86_64                                     1.15.1-37.el7_6                                            updates                                     803 k
 57  openssl-libs                                            x86_64                                     1:1.0.2k-16.el7_6.1                                        updates                                     1.2 M
 58 
 59 事务概要
 60 =================================================================================================================================================================================================================
 61 安装  1 软件包 (+7 依赖软件包)
 62 升级  1 软件包 (+2 依赖软件包)
 63 
 64 总计:4.7 M
 65 总下载量:2.3 M
 66 Downloading packages:
 67 (1/8): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm                                                                                                                                         |  37 kB  00:00:06     
 68 (2/8): libcom_err-devel-1.42.9-13.el7.x86_64.rpm                                                                                                                                          |  31 kB  00:00:06     
 69 (3/8): libkadm5-1.15.1-37.el7_6.x86_64.rpm                                                                                                                                                | 178 kB  00:00:06     
 70 (4/8): krb5-devel-1.15.1-37.el7_6.x86_64.rpm                                                                                                                                              | 271 kB  00:00:06     
 71 (5/8): libsepol-devel-2.5-10.el7.x86_64.rpm                                                                                                                                               |  77 kB  00:00:00     
 72 (6/8): libverto-devel-0.2.5-4.el7.x86_64.rpm                                                                                                                                              |  12 kB  00:00:00     
 73 (7/8): libselinux-devel-2.5-14.1.el7.x86_64.rpm                                                                                                                                           | 187 kB  00:00:00     
 74 (8/8): openssl-devel-1.0.2k-16.el7_6.1.x86_64.rpm                                                                                                                                         | 1.5 MB  00:00:02     
 75 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 76 总计                                                                                                                                                                             261 kB/s | 2.3 MB  00:00:08     
 77 Running transaction check
 78 Running transaction test
 79 Transaction test succeeded
 80 Running transaction
 81   正在更新    : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                     1/14 
 82   正在更新    : krb5-libs-1.15.1-37.el7_6.x86_64                                                                                                                                                            2/14 
 83   正在安装    : libkadm5-1.15.1-37.el7_6.x86_64                                                                                                                                                             3/14 
 84   正在安装    : libcom_err-devel-1.42.9-13.el7.x86_64                                                                                                                                                       4/14 
 85   正在安装    : libsepol-devel-2.5-10.el7.x86_64                                                                                                                                                            5/14 
 86   正在安装    : libselinux-devel-2.5-14.1.el7.x86_64                                                                                                                                                        6/14 
 87   正在安装    : libverto-devel-0.2.5-4.el7.x86_64                                                                                                                                                           7/14 
 88   正在安装    : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                                                                                                      8/14 
 89   正在安装    : krb5-devel-1.15.1-37.el7_6.x86_64                                                                                                                                                           9/14 
 90   正在安装    : 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                   10/14 
 91   正在更新    : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                         11/14 
 92   清理        : 1:openssl-1.0.2k-16.el7.x86_64                                                                                                                                                             12/14 
 93   清理        : krb5-libs-1.15.1-34.el7.x86_64                                                                                                                                                             13/14 
 94   清理        : 1:openssl-libs-1.0.2k-16.el7.x86_64                                                                                                                                                        14/14 
 95   验证中      : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                          1/14 
 96   验证中      : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                                                                                                      2/14 
 97   验证中      : libverto-devel-0.2.5-4.el7.x86_64                                                                                                                                                           3/14 
 98   验证中      : krb5-libs-1.15.1-37.el7_6.x86_64                                                                                                                                                            4/14 
 99   验证中      : libkadm5-1.15.1-37.el7_6.x86_64                                                                                                                                                             5/14 
100   验证中      : krb5-devel-1.15.1-37.el7_6.x86_64                                                                                                                                                           6/14 
101   验证中      : libselinux-devel-2.5-14.1.el7.x86_64                                                                                                                                                        7/14 
102   验证中      : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                     8/14 
103   验证中      : libsepol-devel-2.5-10.el7.x86_64                                                                                                                                                            9/14 
104   验证中      : libcom_err-devel-1.42.9-13.el7.x86_64                                                                                                                                                      10/14 
105   验证中      : 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64                                                                                                                                                   11/14 
106   验证中      : 1:openssl-libs-1.0.2k-16.el7.x86_64                                                                                                                                                        12/14 
107   验证中      : krb5-libs-1.15.1-34.el7.x86_64                                                                                                                                                             13/14 
108   验证中      : 1:openssl-1.0.2k-16.el7.x86_64                                                                                                                                                             14/14 
109 
110 已安装:
111   openssl-devel.x86_64 1:1.0.2k-16.el7_6.1                                                                                                                                                                       
112 
113 作为依赖被安装:
114   keyutils-libs-devel.x86_64 0:1.5.8-3.el7    krb5-devel.x86_64 0:1.15.1-37.el7_6    libcom_err-devel.x86_64 0:1.42.9-13.el7    libkadm5.x86_64 0:1.15.1-37.el7_6    libselinux-devel.x86_64 0:2.5-14.1.el7   
115   libsepol-devel.x86_64 0:2.5-10.el7          libverto-devel.x86_64 0:0.2.5-4.el7   
116 
117 更新完毕:
118   openssl.x86_64 1:1.0.2k-16.el7_6.1                                                                                                                                                                             
119 
120 作为依赖被升级:
121   krb5-libs.x86_64 0:1.15.1-37.el7_6                                                                   openssl-libs.x86_64 1:1.0.2k-16.el7_6.1                                                                  
122 
123 完毕!
124 [root@slaver4 ~]# 

3、编译安装。将nginx-1.8.0.tar.gz 拷贝至 linux 服务器。

下载nginx-1.8.0.tar.gz包。

[root@slaver4 package]# wget http://nginx.org/download/nginx-1.8.0.tar.gz

解压缩操作:

[root@slaver4 package]# tar -zxvf nginx-1.8.0.tar.gz -C /usr/local/soft/

[root@slaver4 package]# cd ../soft/ [root@slaver4 soft]# ls

makefile代表编译和安装的配置信息,刚解压缩是不存在的。 configure在安装的时候需要提供配置,通过ngnix的configure可执行文件来实现的。

configure 配置nginx安装环境的可执行文件,需要执行下述文档中的命令。./configure --help 查询详细参数(参考本教程附录部分:nginx 编译参数)

代码语言:javascript
复制
  1 [root@slaver4 nginx-1.8.0]# ./configure --help
  2 
  3   --help                             print this message
  4 
  5   --prefix=PATH                      set installation prefix
  6   --sbin-path=PATH                   set nginx binary pathname
  7   --conf-path=PATH                   set nginx.conf pathname
  8   --error-log-path=PATH              set error log pathname
  9   --pid-path=PATH                    set nginx.pid pathname
 10   --lock-path=PATH                   set nginx.lock pathname
 11 
 12   --user=USER                        set non-privileged user for
 13                                      worker processes
 14   --group=GROUP                      set non-privileged group for
 15                                      worker processes
 16 
 17   --build=NAME                       set build name
 18   --builddir=DIR                     set build directory
 19 
 20   --with-rtsig_module                enable rtsig module
 21   --with-select_module               enable select module
 22   --without-select_module            disable select module
 23   --with-poll_module                 enable poll module
 24   --without-poll_module              disable poll module
 25 
 26   --with-threads                     enable thread pool support
 27 
 28   --with-file-aio                    enable file AIO support
 29   --with-ipv6                        enable IPv6 support
 30 
 31   --with-http_ssl_module             enable ngx_http_ssl_module
 32   --with-http_spdy_module            enable ngx_http_spdy_module
 33   --with-http_realip_module          enable ngx_http_realip_module
 34   --with-http_addition_module        enable ngx_http_addition_module
 35   --with-http_xslt_module            enable ngx_http_xslt_module
 36   --with-http_image_filter_module    enable ngx_http_image_filter_module
 37   --with-http_geoip_module           enable ngx_http_geoip_module
 38   --with-http_sub_module             enable ngx_http_sub_module
 39   --with-http_dav_module             enable ngx_http_dav_module
 40   --with-http_flv_module             enable ngx_http_flv_module
 41   --with-http_mp4_module             enable ngx_http_mp4_module
 42   --with-http_gunzip_module          enable ngx_http_gunzip_module
 43   --with-http_gzip_static_module     enable ngx_http_gzip_static_module
 44   --with-http_auth_request_module    enable ngx_http_auth_request_module
 45   --with-http_random_index_module    enable ngx_http_random_index_module
 46   --with-http_secure_link_module     enable ngx_http_secure_link_module
 47   --with-http_degradation_module     enable ngx_http_degradation_module
 48   --with-http_stub_status_module     enable ngx_http_stub_status_module
 49 
 50   --without-http_charset_module      disable ngx_http_charset_module
 51   --without-http_gzip_module         disable ngx_http_gzip_module
 52   --without-http_ssi_module          disable ngx_http_ssi_module
 53   --without-http_userid_module       disable ngx_http_userid_module
 54   --without-http_access_module       disable ngx_http_access_module
 55   --without-http_auth_basic_module   disable ngx_http_auth_basic_module
 56   --without-http_autoindex_module    disable ngx_http_autoindex_module
 57   --without-http_geo_module          disable ngx_http_geo_module
 58   --without-http_map_module          disable ngx_http_map_module
 59   --without-http_split_clients_module disable ngx_http_split_clients_module
 60   --without-http_referer_module      disable ngx_http_referer_module
 61   --without-http_rewrite_module      disable ngx_http_rewrite_module
 62   --without-http_proxy_module        disable ngx_http_proxy_module
 63   --without-http_fastcgi_module      disable ngx_http_fastcgi_module
 64   --without-http_uwsgi_module        disable ngx_http_uwsgi_module
 65   --without-http_scgi_module         disable ngx_http_scgi_module
 66   --without-http_memcached_module    disable ngx_http_memcached_module
 67   --without-http_limit_conn_module   disable ngx_http_limit_conn_module
 68   --without-http_limit_req_module    disable ngx_http_limit_req_module
 69   --without-http_empty_gif_module    disable ngx_http_empty_gif_module
 70   --without-http_browser_module      disable ngx_http_browser_module
 71   --without-http_upstream_hash_module
 72                                      disable ngx_http_upstream_hash_module
 73   --without-http_upstream_ip_hash_module
 74                                      disable ngx_http_upstream_ip_hash_module
 75   --without-http_upstream_least_conn_module
 76                                      disable ngx_http_upstream_least_conn_module
 77   --without-http_upstream_keepalive_module
 78                                      disable ngx_http_upstream_keepalive_module
 79 
 80   --with-http_perl_module            enable ngx_http_perl_module
 81   --with-perl_modules_path=PATH      set Perl modules path
 82   --with-perl=PATH                   set perl binary pathname
 83 
 84   --http-log-path=PATH               set http access log pathname
 85   --http-client-body-temp-path=PATH  set path to store
 86                                      http client request body temporary files
 87   --http-proxy-temp-path=PATH        set path to store
 88                                      http proxy temporary files
 89   --http-fastcgi-temp-path=PATH      set path to store
 90                                      http fastcgi temporary files
 91   --http-uwsgi-temp-path=PATH        set path to store
 92                                      http uwsgi temporary files
 93   --http-scgi-temp-path=PATH         set path to store
 94                                      http scgi temporary files
 95 
 96   --without-http                     disable HTTP server
 97   --without-http-cache               disable HTTP cache
 98 
 99   --with-mail                        enable POP3/IMAP4/SMTP proxy module
100   --with-mail_ssl_module             enable ngx_mail_ssl_module
101   --without-mail_pop3_module         disable ngx_mail_pop3_module
102   --without-mail_imap_module         disable ngx_mail_imap_module
103   --without-mail_smtp_module         disable ngx_mail_smtp_module
104 
105   --with-google_perftools_module     enable ngx_google_perftools_module
106   --with-cpp_test_module             enable ngx_cpp_test_module
107 
108   --add-module=PATH                  enable an external module
109 
110   --with-cc=PATH                     set C compiler pathname
111   --with-cpp=PATH                    set C preprocessor pathname
112   --with-cc-opt=OPTIONS              set additional C compiler options
113   --with-ld-opt=OPTIONS              set additional linker options
114   --with-cpu-opt=CPU                 build for the specified CPU, valid values:
115                                      pentium, pentiumpro, pentium3, pentium4,
116                                      athlon, opteron, sparc32, sparc64, ppc64
117 
118   --without-pcre                     disable PCRE library usage
119   --with-pcre                        force PCRE library usage
120   --with-pcre=DIR                    set path to PCRE library sources
121   --with-pcre-opt=OPTIONS            set additional build options for PCRE
122   --with-pcre-jit                    build PCRE with JIT compilation support
123 
124   --with-md5=DIR                     set path to md5 library sources
125   --with-md5-opt=OPTIONS             set additional build options for md5
126   --with-md5-asm                     use md5 assembler sources
127 
128   --with-sha1=DIR                    set path to sha1 library sources
129   --with-sha1-opt=OPTIONS            set additional build options for sha1
130   --with-sha1-asm                    use sha1 assembler sources
131 
132   --with-zlib=DIR                    set path to zlib library sources
133   --with-zlib-opt=OPTIONS            set additional build options for zlib
134   --with-zlib-asm=CPU                use zlib assembler sources optimized
135                                      for the specified CPU, valid values:
136                                      pentium, pentiumpro
137 
138   --with-libatomic                   force libatomic_ops library usage
139   --with-libatomic=DIR               set path to libatomic_ops library sources
140 
141   --with-openssl=DIR                 set path to OpenSSL library sources
142   --with-openssl-opt=OPTIONS         set additional build options for OpenSSL
143 
144   --with-debug                       enable debug logging
145 
146 [root@slaver4 nginx-1.8.0]# 

参数设置如下:

代码语言:javascript
复制
 1 ./configure \
 2 
 3 --prefix=/usr/local/nginx \    安装目录位置
 4 
 5 --pid-path=/var/run/nginx/nginx.pid \ 启动的时候,进程描述文件保存位置和进程文件名 --lock-path=/var/lock/nginx.lock \ 锁定文件
 6 
 7 --error-log-path=/var/log/nginx/error.log \    错误日志
 8 
 9 --http-log-path=/var/log/nginx/access.log \    访问日志
10 
11 --with-http_gzip_static_module \    解压 压缩模式
12 
13 --http-client-body-temp-path=/var/temp/nginx/client \    客户端定义
14 
15 --http-proxy-temp-path=/var/temp/nginx/proxy \    代理临时目录位置.
16 
17 --http-fastcgi-temp-path=/var/temp/nginx/fastcgi \    快速访问临时目录
18 
19 --http-uwsgi-temp-path=/var/temp/nginx/uwsgi \    sgi 访问目录
20 
21 --http-scgi-temp-path=/var/temp/nginx/scgi    scgi 访问临时目录
22 
23 nginx 可以创建临时目录的自定义使用目录. 但是不能创建临时目录的父目录.
24 
25 父目录/var/temp/nginx 目录,nginx 服务应用无法自主创建.必须有 linux 服务器管理员提前创建。

注意:上边将临时文件目录指定为/var/temp/nginx,需要在/var下创建temp及 nginx 目录。其他/var/temp/nginx的子级目录可以自动创建的。

然后执行Nginx的参数设置。

代码语言:javascript
复制
  1 [root@slaver4 nginx-1.8.0]# ./configure \
  2 > --prefix=/usr/local/nginx \
  3 > --pid-path=/var/run/nginx/nginx.pid \
  4 > --lock-path=/var/lock/nginx.lock \
  5 > --error-log-path=/var/log/nginx/error.log \
  6 > --http-log-path=/var/log/nginx/access.log \
  7 > --with-http_gzip_static_module \
  8 > --http-client-body-temp-path=/var/temp/nginx/client \
  9 > --http-proxy-temp-path=/var/temp/nginx/proxy \
 10 > --http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
 11 > --http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
 12 > --http-scgi-temp-path=/var/temp/nginx/scgi
 13 checking for OS
 14  + Linux 3.10.0-957.el7.x86_64 x86_64
 15 checking for C compiler ... found
 16  + using GNU C compiler
 17  + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) 
 18 checking for gcc -pipe switch ... found
 19 checking for gcc builtin atomic operations ... found
 20 checking for C99 variadic macros ... found
 21 checking for gcc variadic macros ... found
 22 checking for unistd.h ... found
 23 checking for inttypes.h ... found
 24 checking for limits.h ... found
 25 checking for sys/filio.h ... not found
 26 checking for sys/param.h ... found
 27 checking for sys/mount.h ... found
 28 checking for sys/statvfs.h ... found
 29 checking for crypt.h ... found
 30 checking for Linux specific features
 31 checking for epoll ... found
 32 checking for EPOLLRDHUP ... found
 33 checking for O_PATH ... found
 34 checking for sendfile() ... found
 35 checking for sendfile64() ... found
 36 checking for sys/prctl.h ... found
 37 checking for prctl(PR_SET_DUMPABLE) ... found
 38 checking for sched_setaffinity() ... found
 39 checking for crypt_r() ... found
 40 checking for sys/vfs.h ... found
 41 checking for nobody group ... found
 42 checking for poll() ... found
 43 checking for /dev/poll ... not found
 44 checking for kqueue ... not found
 45 checking for crypt() ... not found
 46 checking for crypt() in libcrypt ... found
 47 checking for F_READAHEAD ... not found
 48 checking for posix_fadvise() ... found
 49 checking for O_DIRECT ... found
 50 checking for F_NOCACHE ... not found
 51 checking for directio() ... not found
 52 checking for statfs() ... found
 53 checking for statvfs() ... found
 54 checking for dlopen() ... not found
 55 checking for dlopen() in libdl ... found
 56 checking for sched_yield() ... found
 57 checking for SO_SETFIB ... not found
 58 checking for SO_ACCEPTFILTER ... not found
 59 checking for TCP_DEFER_ACCEPT ... found
 60 checking for TCP_KEEPIDLE ... found
 61 checking for TCP_FASTOPEN ... found
 62 checking for TCP_INFO ... found
 63 checking for accept4() ... found
 64 checking for eventfd() ... found
 65 checking for int size ... 4 bytes
 66 checking for long size ... 8 bytes
 67 checking for long long size ... 8 bytes
 68 checking for void * size ... 8 bytes
 69 checking for uint64_t ... found
 70 checking for sig_atomic_t ... found
 71 checking for sig_atomic_t size ... 4 bytes
 72 checking for socklen_t ... found
 73 checking for in_addr_t ... found
 74 checking for in_port_t ... found
 75 checking for rlim_t ... found
 76 checking for uintptr_t ... uintptr_t found
 77 checking for system byte ordering ... little endian
 78 checking for size_t size ... 8 bytes
 79 checking for off_t size ... 8 bytes
 80 checking for time_t size ... 8 bytes
 81 checking for setproctitle() ... not found
 82 checking for pread() ... found
 83 checking for pwrite() ... found
 84 checking for sys_nerr ... found
 85 checking for localtime_r() ... found
 86 checking for posix_memalign() ... found
 87 checking for memalign() ... found
 88 checking for mmap(MAP_ANON|MAP_SHARED) ... found
 89 checking for mmap("/dev/zero", MAP_SHARED) ... found
 90 checking for System V shared memory ... found
 91 checking for POSIX semaphores ... not found
 92 checking for POSIX semaphores in libpthread ... found
 93 checking for struct msghdr.msg_control ... found
 94 checking for ioctl(FIONBIO) ... found
 95 checking for struct tm.tm_gmtoff ... found
 96 checking for struct dirent.d_namlen ... not found
 97 checking for struct dirent.d_type ... found
 98 checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
 99 checking for openat(), fstatat() ... found
100 checking for getaddrinfo() ... found
101 checking for PCRE library ... found
102 checking for PCRE JIT support ... found
103 checking for md5 in system md library ... not found
104 checking for md5 in system md5 library ... not found
105 checking for md5 in system OpenSSL crypto library ... found
106 checking for sha1 in system md library ... not found
107 checking for sha1 in system OpenSSL crypto library ... found
108 checking for zlib library ... found
109 creating objs/Makefile
110 
111 Configuration summary
112   + using system PCRE library
113   + OpenSSL library is not used
114   + md5: using system crypto library
115   + sha1: using system crypto library
116   + using system zlib library
117 
118   nginx path prefix: "/usr/local/nginx"
119   nginx binary file: "/usr/local/nginx/sbin/nginx"
120   nginx configuration prefix: "/usr/local/nginx/conf"
121   nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
122   nginx pid file: "/var/run/nginx/nginx.pid"
123   nginx error log file: "/var/log/nginx/error.log"
124   nginx http access log file: "/var/log/nginx/access.log"
125   nginx http client request body temporary files: "/var/temp/nginx/client"
126   nginx http proxy temporary files: "/var/temp/nginx/proxy"
127   nginx http fastcgi temporary files: "/var/temp/nginx/fastcgi"
128   nginx http uwsgi temporary files: "/var/temp/nginx/uwsgi"
129   nginx http scgi temporary files: "/var/temp/nginx/scgi"
130 
131 [root@slaver4 nginx-1.8.0]# 

4、编译安装。因为下载的是源代码,所以先进行make命令(编译,将源代码编译成可执行文件)。再执行make install命令(安装,将编译后的可执行文件,运行并且安装,形成一个应用)即可。

[root@slaver4 nginx-1.8.0]# make && make install 或者

[root@slaver4 nginx-1.8.0]# make [root@slaver4 nginx-1.8.0]# make install

代码语言:javascript
复制
  1 [root@slaver4 nginx-1.8.0]# make
  2 make -f objs/Makefile
  3 make[1]: 进入目录“/usr/local/soft/nginx-1.8.0”
  4 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  5     -o objs/src/core/nginx.o \
  6     src/core/nginx.c
  7 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  8     -o objs/src/core/ngx_log.o \
  9     src/core/ngx_log.c
 10 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 11     -o objs/src/core/ngx_palloc.o \
 12     src/core/ngx_palloc.c
 13 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 14     -o objs/src/core/ngx_array.o \
 15     src/core/ngx_array.c
 16 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 17     -o objs/src/core/ngx_list.o \
 18     src/core/ngx_list.c
 19 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 20     -o objs/src/core/ngx_hash.o \
 21     src/core/ngx_hash.c
 22 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 23     -o objs/src/core/ngx_buf.o \
 24     src/core/ngx_buf.c
 25 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 26     -o objs/src/core/ngx_queue.o \
 27     src/core/ngx_queue.c
 28 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 29     -o objs/src/core/ngx_output_chain.o \
 30     src/core/ngx_output_chain.c
 31 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 32     -o objs/src/core/ngx_string.o \
 33     src/core/ngx_string.c
 34 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 35     -o objs/src/core/ngx_parse.o \
 36     src/core/ngx_parse.c
 37 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 38     -o objs/src/core/ngx_inet.o \
 39     src/core/ngx_inet.c
 40 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 41     -o objs/src/core/ngx_file.o \
 42     src/core/ngx_file.c
 43 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 44     -o objs/src/core/ngx_crc32.o \
 45     src/core/ngx_crc32.c
 46 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 47     -o objs/src/core/ngx_murmurhash.o \
 48     src/core/ngx_murmurhash.c
 49 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 50     -o objs/src/core/ngx_md5.o \
 51     src/core/ngx_md5.c
 52 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 53     -o objs/src/core/ngx_rbtree.o \
 54     src/core/ngx_rbtree.c
 55 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 56     -o objs/src/core/ngx_radix_tree.o \
 57     src/core/ngx_radix_tree.c
 58 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 59     -o objs/src/core/ngx_slab.o \
 60     src/core/ngx_slab.c
 61 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 62     -o objs/src/core/ngx_times.o \
 63     src/core/ngx_times.c
 64 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 65     -o objs/src/core/ngx_shmtx.o \
 66     src/core/ngx_shmtx.c
 67 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 68     -o objs/src/core/ngx_connection.o \
 69     src/core/ngx_connection.c
 70 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 71     -o objs/src/core/ngx_cycle.o \
 72     src/core/ngx_cycle.c
 73 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 74     -o objs/src/core/ngx_spinlock.o \
 75     src/core/ngx_spinlock.c
 76 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 77     -o objs/src/core/ngx_cpuinfo.o \
 78     src/core/ngx_cpuinfo.c
 79 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 80     -o objs/src/core/ngx_conf_file.o \
 81     src/core/ngx_conf_file.c
 82 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 83     -o objs/src/core/ngx_resolver.o \
 84     src/core/ngx_resolver.c
 85 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 86     -o objs/src/core/ngx_open_file_cache.o \
 87     src/core/ngx_open_file_cache.c
 88 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 89     -o objs/src/core/ngx_crypt.o \
 90     src/core/ngx_crypt.c
 91 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 92     -o objs/src/core/ngx_proxy_protocol.o \
 93     src/core/ngx_proxy_protocol.c
 94 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 95     -o objs/src/core/ngx_syslog.o \
 96     src/core/ngx_syslog.c
 97 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
 98     -o objs/src/event/ngx_event.o \
 99     src/event/ngx_event.c
100 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
101     -o objs/src/event/ngx_event_timer.o \
102     src/event/ngx_event_timer.c
103 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
104     -o objs/src/event/ngx_event_posted.o \
105     src/event/ngx_event_posted.c
106 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
107     -o objs/src/event/ngx_event_accept.o \
108     src/event/ngx_event_accept.c
109 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
110     -o objs/src/event/ngx_event_connect.o \
111     src/event/ngx_event_connect.c
112 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
113     -o objs/src/event/ngx_event_pipe.o \
114     src/event/ngx_event_pipe.c
115 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
116     -o objs/src/os/unix/ngx_time.o \
117     src/os/unix/ngx_time.c
118 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
119     -o objs/src/os/unix/ngx_errno.o \
120     src/os/unix/ngx_errno.c
121 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
122     -o objs/src/os/unix/ngx_alloc.o \
123     src/os/unix/ngx_alloc.c
124 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
125     -o objs/src/os/unix/ngx_files.o \
126     src/os/unix/ngx_files.c
127 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
128     -o objs/src/os/unix/ngx_socket.o \
129     src/os/unix/ngx_socket.c
130 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
131     -o objs/src/os/unix/ngx_recv.o \
132     src/os/unix/ngx_recv.c
133 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
134     -o objs/src/os/unix/ngx_readv_chain.o \
135     src/os/unix/ngx_readv_chain.c
136 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
137     -o objs/src/os/unix/ngx_udp_recv.o \
138     src/os/unix/ngx_udp_recv.c
139 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
140     -o objs/src/os/unix/ngx_send.o \
141     src/os/unix/ngx_send.c
142 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
143     -o objs/src/os/unix/ngx_writev_chain.o \
144     src/os/unix/ngx_writev_chain.c
145 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
146     -o objs/src/os/unix/ngx_channel.o \
147     src/os/unix/ngx_channel.c
148 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
149     -o objs/src/os/unix/ngx_shmem.o \
150     src/os/unix/ngx_shmem.c
151 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
152     -o objs/src/os/unix/ngx_process.o \
153     src/os/unix/ngx_process.c
154 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
155     -o objs/src/os/unix/ngx_daemon.o \
156     src/os/unix/ngx_daemon.c
157 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
158     -o objs/src/os/unix/ngx_setaffinity.o \
159     src/os/unix/ngx_setaffinity.c
160 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
161     -o objs/src/os/unix/ngx_setproctitle.o \
162     src/os/unix/ngx_setproctitle.c
163 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
164     -o objs/src/os/unix/ngx_posix_init.o \
165     src/os/unix/ngx_posix_init.c
166 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
167     -o objs/src/os/unix/ngx_user.o \
168     src/os/unix/ngx_user.c
169 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
170     -o objs/src/os/unix/ngx_process_cycle.o \
171     src/os/unix/ngx_process_cycle.c
172 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
173     -o objs/src/os/unix/ngx_linux_init.o \
174     src/os/unix/ngx_linux_init.c
175 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
176     -o objs/src/event/modules/ngx_epoll_module.o \
177     src/event/modules/ngx_epoll_module.c
178 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
179     -o objs/src/os/unix/ngx_linux_sendfile_chain.o \
180     src/os/unix/ngx_linux_sendfile_chain.c
181 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
182     -o objs/src/core/ngx_regex.o \
183     src/core/ngx_regex.c
184 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
185     -o objs/src/http/ngx_http.o \
186     src/http/ngx_http.c
187 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
188     -o objs/src/http/ngx_http_core_module.o \
189     src/http/ngx_http_core_module.c
190 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
191     -o objs/src/http/ngx_http_special_response.o \
192     src/http/ngx_http_special_response.c
193 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
194     -o objs/src/http/ngx_http_request.o \
195     src/http/ngx_http_request.c
196 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
197     -o objs/src/http/ngx_http_parse.o \
198     src/http/ngx_http_parse.c
199 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
200     -o objs/src/http/ngx_http_header_filter_module.o \
201     src/http/ngx_http_header_filter_module.c
202 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
203     -o objs/src/http/ngx_http_write_filter_module.o \
204     src/http/ngx_http_write_filter_module.c
205 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
206     -o objs/src/http/ngx_http_copy_filter_module.o \
207     src/http/ngx_http_copy_filter_module.c
208 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
209     -o objs/src/http/modules/ngx_http_log_module.o \
210     src/http/modules/ngx_http_log_module.c
211 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
212     -o objs/src/http/ngx_http_request_body.o \
213     src/http/ngx_http_request_body.c
214 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
215     -o objs/src/http/ngx_http_variables.o \
216     src/http/ngx_http_variables.c
217 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
218     -o objs/src/http/ngx_http_script.o \
219     src/http/ngx_http_script.c
220 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
221     -o objs/src/http/ngx_http_upstream.o \
222     src/http/ngx_http_upstream.c
223 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
224     -o objs/src/http/ngx_http_upstream_round_robin.o \
225     src/http/ngx_http_upstream_round_robin.c
226 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
227     -o objs/src/http/ngx_http_parse_time.o \
228     src/http/ngx_http_parse_time.c
229 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
230     -o objs/src/http/modules/ngx_http_static_module.o \
231     src/http/modules/ngx_http_static_module.c
232 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
233     -o objs/src/http/modules/ngx_http_index_module.o \
234     src/http/modules/ngx_http_index_module.c
235 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
236     -o objs/src/http/modules/ngx_http_chunked_filter_module.o \
237     src/http/modules/ngx_http_chunked_filter_module.c
238 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
239     -o objs/src/http/modules/ngx_http_range_filter_module.o \
240     src/http/modules/ngx_http_range_filter_module.c
241 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
242     -o objs/src/http/modules/ngx_http_headers_filter_module.o \
243     src/http/modules/ngx_http_headers_filter_module.c
244 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
245     -o objs/src/http/modules/ngx_http_not_modified_filter_module.o \
246     src/http/modules/ngx_http_not_modified_filter_module.c
247 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
248     -o objs/src/http/ngx_http_file_cache.o \
249     src/http/ngx_http_file_cache.c
250 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
251     -o objs/src/http/modules/ngx_http_gzip_filter_module.o \
252     src/http/modules/ngx_http_gzip_filter_module.c
253 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
254     -o objs/src/http/ngx_http_postpone_filter_module.o \
255     src/http/ngx_http_postpone_filter_module.c
256 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
257     -o objs/src/http/modules/ngx_http_ssi_filter_module.o \
258     src/http/modules/ngx_http_ssi_filter_module.c
259 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
260     -o objs/src/http/modules/ngx_http_charset_filter_module.o \
261     src/http/modules/ngx_http_charset_filter_module.c
262 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
263     -o objs/src/http/modules/ngx_http_userid_filter_module.o \
264     src/http/modules/ngx_http_userid_filter_module.c
265 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
266     -o objs/src/http/modules/ngx_http_gzip_static_module.o \
267     src/http/modules/ngx_http_gzip_static_module.c
268 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
269     -o objs/src/http/modules/ngx_http_autoindex_module.o \
270     src/http/modules/ngx_http_autoindex_module.c
271 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
272     -o objs/src/http/modules/ngx_http_auth_basic_module.o \
273     src/http/modules/ngx_http_auth_basic_module.c
274 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
275     -o objs/src/http/modules/ngx_http_access_module.o \
276     src/http/modules/ngx_http_access_module.c
277 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
278     -o objs/src/http/modules/ngx_http_limit_conn_module.o \
279     src/http/modules/ngx_http_limit_conn_module.c
280 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
281     -o objs/src/http/modules/ngx_http_limit_req_module.o \
282     src/http/modules/ngx_http_limit_req_module.c
283 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
284     -o objs/src/http/modules/ngx_http_geo_module.o \
285     src/http/modules/ngx_http_geo_module.c
286 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
287     -o objs/src/http/modules/ngx_http_map_module.o \
288     src/http/modules/ngx_http_map_module.c
289 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
290     -o objs/src/http/modules/ngx_http_split_clients_module.o \
291     src/http/modules/ngx_http_split_clients_module.c
292 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
293     -o objs/src/http/modules/ngx_http_referer_module.o \
294     src/http/modules/ngx_http_referer_module.c
295 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
296     -o objs/src/http/modules/ngx_http_rewrite_module.o \
297     src/http/modules/ngx_http_rewrite_module.c
298 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
299     -o objs/src/http/modules/ngx_http_proxy_module.o \
300     src/http/modules/ngx_http_proxy_module.c
301 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
302     -o objs/src/http/modules/ngx_http_fastcgi_module.o \
303     src/http/modules/ngx_http_fastcgi_module.c
304 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
305     -o objs/src/http/modules/ngx_http_uwsgi_module.o \
306     src/http/modules/ngx_http_uwsgi_module.c
307 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
308     -o objs/src/http/modules/ngx_http_scgi_module.o \
309     src/http/modules/ngx_http_scgi_module.c
310 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
311     -o objs/src/http/modules/ngx_http_memcached_module.o \
312     src/http/modules/ngx_http_memcached_module.c
313 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
314     -o objs/src/http/modules/ngx_http_empty_gif_module.o \
315     src/http/modules/ngx_http_empty_gif_module.c
316 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
317     -o objs/src/http/modules/ngx_http_browser_module.o \
318     src/http/modules/ngx_http_browser_module.c
319 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
320     -o objs/src/http/modules/ngx_http_upstream_hash_module.o \
321     src/http/modules/ngx_http_upstream_hash_module.c
322 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
323     -o objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
324     src/http/modules/ngx_http_upstream_ip_hash_module.c
325 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
326     -o objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
327     src/http/modules/ngx_http_upstream_least_conn_module.c
328 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
329     -o objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
330     src/http/modules/ngx_http_upstream_keepalive_module.c
331 cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
332     -o objs/ngx_modules.o \
333     objs/ngx_modules.c
334 cc -o objs/nginx \
335 objs/src/core/nginx.o \
336 objs/src/core/ngx_log.o \
337 objs/src/core/ngx_palloc.o \
338 objs/src/core/ngx_array.o \
339 objs/src/core/ngx_list.o \
340 objs/src/core/ngx_hash.o \
341 objs/src/core/ngx_buf.o \
342 objs/src/core/ngx_queue.o \
343 objs/src/core/ngx_output_chain.o \
344 objs/src/core/ngx_string.o \
345 objs/src/core/ngx_parse.o \
346 objs/src/core/ngx_inet.o \
347 objs/src/core/ngx_file.o \
348 objs/src/core/ngx_crc32.o \
349 objs/src/core/ngx_murmurhash.o \
350 objs/src/core/ngx_md5.o \
351 objs/src/core/ngx_rbtree.o \
352 objs/src/core/ngx_radix_tree.o \
353 objs/src/core/ngx_slab.o \
354 objs/src/core/ngx_times.o \
355 objs/src/core/ngx_shmtx.o \
356 objs/src/core/ngx_connection.o \
357 objs/src/core/ngx_cycle.o \
358 objs/src/core/ngx_spinlock.o \
359 objs/src/core/ngx_cpuinfo.o \
360 objs/src/core/ngx_conf_file.o \
361 objs/src/core/ngx_resolver.o \
362 objs/src/core/ngx_open_file_cache.o \
363 objs/src/core/ngx_crypt.o \
364 objs/src/core/ngx_proxy_protocol.o \
365 objs/src/core/ngx_syslog.o \
366 objs/src/event/ngx_event.o \
367 objs/src/event/ngx_event_timer.o \
368 objs/src/event/ngx_event_posted.o \
369 objs/src/event/ngx_event_accept.o \
370 objs/src/event/ngx_event_connect.o \
371 objs/src/event/ngx_event_pipe.o \
372 objs/src/os/unix/ngx_time.o \
373 objs/src/os/unix/ngx_errno.o \
374 objs/src/os/unix/ngx_alloc.o \
375 objs/src/os/unix/ngx_files.o \
376 objs/src/os/unix/ngx_socket.o \
377 objs/src/os/unix/ngx_recv.o \
378 objs/src/os/unix/ngx_readv_chain.o \
379 objs/src/os/unix/ngx_udp_recv.o \
380 objs/src/os/unix/ngx_send.o \
381 objs/src/os/unix/ngx_writev_chain.o \
382 objs/src/os/unix/ngx_channel.o \
383 objs/src/os/unix/ngx_shmem.o \
384 objs/src/os/unix/ngx_process.o \
385 objs/src/os/unix/ngx_daemon.o \
386 objs/src/os/unix/ngx_setaffinity.o \
387 objs/src/os/unix/ngx_setproctitle.o \
388 objs/src/os/unix/ngx_posix_init.o \
389 objs/src/os/unix/ngx_user.o \
390 objs/src/os/unix/ngx_process_cycle.o \
391 objs/src/os/unix/ngx_linux_init.o \
392 objs/src/event/modules/ngx_epoll_module.o \
393 objs/src/os/unix/ngx_linux_sendfile_chain.o \
394 objs/src/core/ngx_regex.o \
395 objs/src/http/ngx_http.o \
396 objs/src/http/ngx_http_core_module.o \
397 objs/src/http/ngx_http_special_response.o \
398 objs/src/http/ngx_http_request.o \
399 objs/src/http/ngx_http_parse.o \
400 objs/src/http/ngx_http_header_filter_module.o \
401 objs/src/http/ngx_http_write_filter_module.o \
402 objs/src/http/ngx_http_copy_filter_module.o \
403 objs/src/http/modules/ngx_http_log_module.o \
404 objs/src/http/ngx_http_request_body.o \
405 objs/src/http/ngx_http_variables.o \
406 objs/src/http/ngx_http_script.o \
407 objs/src/http/ngx_http_upstream.o \
408 objs/src/http/ngx_http_upstream_round_robin.o \
409 objs/src/http/ngx_http_parse_time.o \
410 objs/src/http/modules/ngx_http_static_module.o \
411 objs/src/http/modules/ngx_http_index_module.o \
412 objs/src/http/modules/ngx_http_chunked_filter_module.o \
413 objs/src/http/modules/ngx_http_range_filter_module.o \
414 objs/src/http/modules/ngx_http_headers_filter_module.o \
415 objs/src/http/modules/ngx_http_not_modified_filter_module.o \
416 objs/src/http/ngx_http_file_cache.o \
417 objs/src/http/modules/ngx_http_gzip_filter_module.o \
418 objs/src/http/ngx_http_postpone_filter_module.o \
419 objs/src/http/modules/ngx_http_ssi_filter_module.o \
420 objs/src/http/modules/ngx_http_charset_filter_module.o \
421 objs/src/http/modules/ngx_http_userid_filter_module.o \
422 objs/src/http/modules/ngx_http_gzip_static_module.o \
423 objs/src/http/modules/ngx_http_autoindex_module.o \
424 objs/src/http/modules/ngx_http_auth_basic_module.o \
425 objs/src/http/modules/ngx_http_access_module.o \
426 objs/src/http/modules/ngx_http_limit_conn_module.o \
427 objs/src/http/modules/ngx_http_limit_req_module.o \
428 objs/src/http/modules/ngx_http_geo_module.o \
429 objs/src/http/modules/ngx_http_map_module.o \
430 objs/src/http/modules/ngx_http_split_clients_module.o \
431 objs/src/http/modules/ngx_http_referer_module.o \
432 objs/src/http/modules/ngx_http_rewrite_module.o \
433 objs/src/http/modules/ngx_http_proxy_module.o \
434 objs/src/http/modules/ngx_http_fastcgi_module.o \
435 objs/src/http/modules/ngx_http_uwsgi_module.o \
436 objs/src/http/modules/ngx_http_scgi_module.o \
437 objs/src/http/modules/ngx_http_memcached_module.o \
438 objs/src/http/modules/ngx_http_empty_gif_module.o \
439 objs/src/http/modules/ngx_http_browser_module.o \
440 objs/src/http/modules/ngx_http_upstream_hash_module.o \
441 objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
442 objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
443 objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
444 objs/ngx_modules.o \
445 -lpthread -lcrypt -lpcre -lcrypto -lcrypto -lz
446 make[1]: 离开目录“/usr/local/soft/nginx-1.8.0”
447 make -f objs/Makefile manpage
448 make[1]: 进入目录“/usr/local/soft/nginx-1.8.0”
449 sed -e "s|%%PREFIX%%|/usr/local/nginx|" \
450     -e "s|%%PID_PATH%%|/var/run/nginx/nginx.pid|" \
451     -e "s|%%CONF_PATH%%|/usr/local/nginx/conf/nginx.conf|" \
452     -e "s|%%ERROR_LOG_PATH%%|/var/log/nginx/error.log|" \
453     < man/nginx.8 > objs/nginx.8
454 make[1]: 离开目录“/usr/local/soft/nginx-1.8.0”
455 [root@slaver4 nginx-1.8.0]# 
代码语言:javascript
复制
 1 [root@slaver4 nginx-1.8.0]# make install
 2 make -f objs/Makefile install
 3 make[1]: 进入目录“/usr/local/soft/nginx-1.8.0”
 4 test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
 5 test -d '/usr/local/nginx/sbin'         || mkdir -p '/usr/local/nginx/sbin'
 6 test ! -f '/usr/local/nginx/sbin/nginx'         || mv '/usr/local/nginx/sbin/nginx'             '/usr/local/nginx/sbin/nginx.old'
 7 cp objs/nginx '/usr/local/nginx/sbin/nginx'
 8 test -d '/usr/local/nginx/conf'         || mkdir -p '/usr/local/nginx/conf'
 9 cp conf/koi-win '/usr/local/nginx/conf'
10 cp conf/koi-utf '/usr/local/nginx/conf'
11 cp conf/win-utf '/usr/local/nginx/conf'
12 test -f '/usr/local/nginx/conf/mime.types'         || cp conf/mime.types '/usr/local/nginx/conf'
13 cp conf/mime.types '/usr/local/nginx/conf/mime.types.default'
14 test -f '/usr/local/nginx/conf/fastcgi_params'         || cp conf/fastcgi_params '/usr/local/nginx/conf'
15 cp conf/fastcgi_params         '/usr/local/nginx/conf/fastcgi_params.default'
16 test -f '/usr/local/nginx/conf/fastcgi.conf'         || cp conf/fastcgi.conf '/usr/local/nginx/conf'
17 cp conf/fastcgi.conf '/usr/local/nginx/conf/fastcgi.conf.default'
18 test -f '/usr/local/nginx/conf/uwsgi_params'         || cp conf/uwsgi_params '/usr/local/nginx/conf'
19 cp conf/uwsgi_params         '/usr/local/nginx/conf/uwsgi_params.default'
20 test -f '/usr/local/nginx/conf/scgi_params'         || cp conf/scgi_params '/usr/local/nginx/conf'
21 cp conf/scgi_params         '/usr/local/nginx/conf/scgi_params.default'
22 test -f '/usr/local/nginx/conf/nginx.conf'         || cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf'
23 cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'
24 test -d '/var/run/nginx'         || mkdir -p '/var/run/nginx'
25 test -d '/var/log/nginx' ||         mkdir -p '/var/log/nginx'
26 test -d '/usr/local/nginx/html'         || cp -R html '/usr/local/nginx'
27 test -d '/var/log/nginx' ||         mkdir -p '/var/log/nginx'
28 make[1]: 离开目录“/usr/local/soft/nginx-1.8.0”
29 [root@slaver4 nginx-1.8.0]# 

安装成功查看安装目录 :安装成功的时候就是这个样子的。

Nginx安装成功后,在安装位置有三个目录。sbin/conf/html。 sbin是可执行文件,html是nginx提供的默认静态页面,conf是配置文件目录。

5、启动Nginx。没有输出信息就是正常的,如果有输出信息就会报错了,那你安装可能失败了就。

[root@slaver4 nginx]# sbin/nginx

或者进入到sbin的目录进行命令启动nginx;

10733是nginx主进程的进程 id,10734是nginx 工作进程的进程id。

注意:执行./nginx 启动 nginx,这里可以-c 指定加载的 nginx 配置文件,如下: ./nginx -c /usr/local/nginx/conf/nginx.conf 如果不指定-c,nginx 在启动时默认加载 conf/nginx.conf 文件,此文件的地址也可以在编译 安装 nginx 时指定./configure 的参数(--conf-path= 指向配置文件(nginx.conf))

6、停止Nginx(优雅停止,将所有请求处理完毕,这个命令运行以后,以后所有命令不再运行。区分与强行停止)。

[root@slaver4 nginx]# sbin/nginx -s quit

代码语言:javascript
复制
1 方式 1,快速停止:
2 cd /usr/local/nginx/sbin
3 ./nginx -s stop
4 此方式相当于先查出 nginx 进程 id 再使用 kill 命令强制杀掉进程。
5 方式 2,完整停止(建议使用):
6 cd /usr/local/nginx/sbin
7 ./nginx -s quit
8 此方式停止步骤是待 nginx 进程处理任务完毕进行停止。

7、测试nginx是否安装成功,启动 nginx,即可访问虚拟机上的 nginx(请记住关闭防火墙哦,显示这个界面说明 nginx 上安装成功):

8、重启Nginx。

代码语言:javascript
复制
1 方式1,先停止再启动(建议使用):
2 对nginx 进行重启相当于先停止nginx 再启动 nginx,即先执行停止命令再执行启动命令。如下:
3 [root@slaver4 sbin]# ./nginx -s quit
4 [root@slaver4 sbin]# ./nginx
5 
6 方式 2,重新加载配置文件:
7 当nginx 的配置文件nginx.conf 修改后,要想让配置生效需要重启 nginx,使用-s reload 不用先停止 nginx 再启动 nginx 即可将配置信息在 nginx 中生效,如下:
8 [root@slaver4 sbin]# ./nginx -s reload

9、修改 nginx 配置文件。修改配置文件后,重新启动 nginx 服务。

nginx 配置文件在 conf 目录中。 配置 : nginx.conf - 使用的配置文件。 nginx.conf.default - 备份的配置文件模板。 nginx.conf - 配置文件中可以配置,web 服务器定位的目录。

代码语言:javascript
复制
 1 #    user 代表访问权限是什么,就是通过 nginx 访问 linux 服务器中文件时,使用的用户权限 
 2 user ftpuser;
 3 
 4 #    工作流程 ID。
 5 worker_processes    1;
 6 
 7 events {
 8     worker_connections    1024;
 9 }
10 
11 #定义 http 服务器内容 
12 http {
13     include            mime.types;        # 加载响应类型
14     default_type    application/octet-stream;    # 默认使用 IO 流实现请求/应答
15     sendfile        on;     # 是否支持文件传输
16     keepalive_        timeout    65;     # 心跳监测。
17     
18     #配置一个服务节点 
19     server {
20         listen        80;     # 端口
21         server_name    localhost;     # 监听的地址/IP/域名/主机名
22         
23         
24         #当前网络服务节点对应本地什么目录.
25         #相对地址,从 nginx 安装目录开始寻址. 绝对地址从根开始寻址 
26         location / {
27             #修改 web 服务节点的根目录为 ftpuser 用户的主目录。 
28             root /home/ftpuser;
29             #root    html; # 映射的根目录
30             index    index.html index.htm; # 欢迎页面
31         }
32         
33         #如果出现错误,显示的页面
34         error_page    500 502 503 504    /50x.html;
35         location = /50x.html {
36             root    html;
37         }
38     }
39 }

10、开机自启动 nginx。

1)、编写 shell 脚本。这里使用的是编写 shell 脚本的方式来处理。

vi /etc/init.d/nginx(输入下面的代码,:wq 保存并退出)

代码语言:javascript
复制
 1 #!/bin/bash
 2 #    nginx Startup script for the Nginx HTTP Server
 3 #    it is v.0.0.2 version.
 4 #    chkconfig: - 85 15
 5 #    description: Nginx is a high-performance web and proxy server.
 6 #    It has a lot of features, but it's not for everyone.
 7 
 8 #    processname: nginx
 9 #    pidfile: /var/run/nginx.pid
10 #    config: /usr/local/nginx/conf/nginx.conf 
11 nginxd=/usr/local/nginx/sbin/nginx 
12 nginx_config=/usr/local/nginx/conf/nginx.conf 
13 nginx_pid=/var/run/nginx.pid
14 RETVAL=0
15 prog="nginx"
16 
17 #    Source function library.
18 . /etc/rc.d/init.d/functions
19 
20 #    Source networking configuration.
21 . /etc/sysconfig/network
22 
23 #    Check that networking is up.
24 [ ${NETWORKING} = "no" ] && exit 0
25 [ -x $nginxd ] || exit 0
26 
27 #    Start nginx daemons functions. 
28 start() {
29 if [ -e $nginx_pid ];then
30     echo "nginx already 
31     running...." exit 1
32 fi
33     echo -n $"Starting $prog: " 
34     daemon $nginxd -c ${nginx_config} 
35     RETVAL=$?
36     echo
37     [ $RETVAL = 0 ] && touch 
38     /var/lock/subsys/nginx return $RETVAL
39 }
40 
41 #    Stop nginx daemons functions.
42 
43 stop() {
44     echo -n $"Stopping $prog: "
45     killproc $nginxd
46     RETVAL=$?
47     echo
48     [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid
49 }
50 
51 #    reload nginx service functions. 
52 reload() {
53     echo -n $"Reloading $prog: 
54     " #kill -HUP `cat 
55     ${nginx_pid}` killproc 
56     $nginxd -HUP RETVAL=$?
57     echo
58 }
59 
60 #    See how we were called. case "$1" in
61 start)
62     start
63     ;;
64     
65 stop)
66     stop
67     ;;
68 
69 reload)
70     reload
71     ;;
72 
73 restart)
74     stop start
75     ;;
76 
77 status)
78 
79     status $prog 
80     RETVAL=$?
81     ;;
82 *)
83 
84     echo $"Usage: $prog 
85     {start|stop|restart|reload|status|help}" exit 1
86 esac
87 exit $RETVAL

2)、设置文件的访问权限。

chmod a+x /etc/init.d/nginx (a+x ==> all user can execute 所有用户可执行),这样在控制台就很容易的操作 nginx 了:查看 Nginx 当前状态、启动 Nginx、停止 Nginx、重启Nginx…

如果修改了 nginx 的配置文件 nginx.conf,也可以使用上面的命令重新加载新的配置文件并运行,可以将此命令加入到 rc.local 文件中,这样开机的时候 nginx 就默认启动了。

[root@slaver4 nginx]# /etc/init.d/nginx status

[root@slaver4 nginx]# /etc/init.d/nginx start

[root@slaver4 nginx]# /etc/init.d/nginx stop

[root@slaver4 nginx]# /etc/init.d/nginx restart

3)、加入到 rc.local 文件中 vi /etc/rc.local 加入一行/etc/init.d/nginx start 保存并退出,下次重启会生效。

11、开机自启动(推荐),即在rc.local增加启动代码就可以了。增加一行 /usr/local/nginx/sbin/nginx。

如果报重启Nginx报错, nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)。

参考:https://www.cnblogs.com/biehongli/p/11224668.html

设置执行权限:

[root@slaver4 nginx]# chmod 755 /etc/rc.local

[root@slaver4 ~]# reboot

试下是否正常自启动。

待续......

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-07-22 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
负载均衡
负载均衡(Cloud Load Balancer,CLB)提供安全快捷的四七层流量分发服务,访问流量经由 CLB 可以自动分配到多台后端服务器上,扩展系统的服务能力并消除单点故障。轻松应对大流量访问场景。 网关负载均衡(Gateway Load Balancer,GWLB)是运行在网络层的负载均衡。通过 GWLB 可以帮助客户部署、扩展和管理第三方虚拟设备,操作简单,安全性强。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档