linux部署web服务器-Nginx

前言:

有很多小伙伴想要建立一个自己的web站点,今天就给大家演示一下。

准备工作:

1、Nginx安装包;

2、Linux服务器;

3、PCRE安装包;

4、手。

方式一:手动编译安装

1、安装编译库

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: mirrors.aliyun.com
  • extras: mirrors.aliyun.com
  • updates: mirrors.aliyun.com
    软件包 1:make-3.82-24.el7.x86_64 已安装并且是最新版本
    软件包 gcc-c+±4.8.5-44.el7.x86_64 已安装并且是最新版本
    软件包 libtool-2.4.2-22.el7_3.x86_64 已安装并且是最新版本
    正在解决依赖关系
    –> 正在检查事务
    —> 软件包 openssl.x86_64.1.1.0.2k-19.el7 将被 升级
    —> 软件包 openssl.x86_64.1.1.0.2k-25.el7_9 将被 更新
    –> 正在处理依赖关系 openssl-libs(x86-64) = 1:1.0.2k-25.el7_9,它被软件包 1:openssl-1.0.2k-25.el7_9.x86_64 需要
    —> 软件包 openssl-devel.x86_64.1.1.0.2k-25.el7_9 将被 安装
    –> 正在处理依赖关系 krb5-devel(x86-64),它被软件包 1:openssl-devel-1.0.2k-25.el7_9.x86_64 需要
    —> 软件包 zlib.x86_64.0.1.2.7-18.el7 将被 升级
    —> 软件包 zlib.x86_64.0.1.2.7-20.el7_9 将被 更新
    —> 软件包 zlib-devel.x86_64.0.1.2.7-20.el7_9 将被 安装
    –> 正在检查事务
    —> 软件包 krb5-devel.x86_64.0.1.15.1-51.el7_9 将被 安装
    –> 正在处理依赖关系 libkadm5(x86-64) = 1.15.1-51.el7_9,它被软件包 krb5-devel-1.15.1-51.el7_9.x86_64 需要
    –> 正在处理依赖关系 krb5-libs(x86-64) = 1.15.1-51.el7_9,它被软件包 krb5-devel-1.15.1-51.el7_9.x86_64 需要
    –> 正在处理依赖关系 libverto-devel,它被软件包 krb5-devel-1.15.1-51.el7_9.x86_64 需要
    –> 正在处理依赖关系 libselinux-devel,它被软件包 krb5-devel-1.15.1-51.el7_9.x86_64 需要
    –> 正在处理依赖关系 libcom_err-devel,它被软件包 krb5-devel-1.15.1-51.el7_9.x86_64 需要
    –> 正在处理依赖关系 keyutils-libs-devel,它被软件包 krb5-devel-1.15.1-51.el7_9.x86_64 需要
    —> 软件包 openssl-libs.x86_64.1.1.0.2k-19.el7 将被 升级
    —> 软件包 openssl-libs.x86_64.1.1.0.2k-25.el7_9 将被 更新
    –> 正在检查事务
    —> 软件包 keyutils-libs-devel.x86_64.0.1.5.8-3.el7 将被 安装
    —> 软件包 krb5-libs.x86_64.0.1.15.1-50.el7 将被 升级
    –> 正在处理依赖关系 krb5-libs(x86-64) = 1.15.1-50.el7,它被软件包 krb5-server-1.15.1-50.el7.x86_64 需要
    –> 正在处理依赖关系 krb5-libs(x86-64) = 1.15.1-50.el7,它被软件包 krb5-workstation-1.15.1-50.el7.x86_64 需要
    –> 正在处理依赖关系 krb5-libs(x86-64) = 1.15.1-50.el7,它被软件包 krb5-pkinit-1.15.1-50.el7.x86_64 需要
    —> 软件包 krb5-libs.x86_64.0.1.15.1-51.el7_9 将被 更新
    —> 软件包 libcom_err-devel.x86_64.0.1.42.9-19.el7 将被 安装
    —> 软件包 libkadm5.x86_64.0.1.15.1-50.el7 将被 升级
    —> 软件包 libkadm5.x86_64.0.1.15.1-51.el7_9 将被 更新
    —> 软件包 libselinux-devel.x86_64.0.2.5-15.el7 将被 安装
    –> 正在处理依赖关系 libsepol-devel(x86-64) >= 2.5-10,它被软件包 libselinux-devel-2.5-15.el7.x86_64 需要
    –> 正在处理依赖关系 pkgconfig(libsepol),它被软件包 libselinux-devel-2.5-15.el7.x86_64 需要
    –> 正在处理依赖关系 pkgconfig(libpcre),它被软件包 libselinux-devel-2.5-15.el7.x86_64 需要
    —> 软件包 libverto-devel.x86_64.0.0.2.5-4.el7 将被 安装
    –> 正在检查事务
    —> 软件包 krb5-pkinit.x86_64.0.1.15.1-50.el7 将被 升级
    —> 软件包 krb5-pkinit.x86_64.0.1.15.1-51.el7_9 将被 更新
    —> 软件包 krb5-server.x86_64.0.1.15.1-50.el7 将被 升级
    —> 软件包 krb5-server.x86_64.0.1.15.1-51.el7_9 将被 更新
    base/7/x86_64/filelists_db | 7.2 MB 00:00:13
    —> 软件包 krb5-workstation.x86_64.0.1.15.1-50.el7 将被 升级
    —> 软件包 krb5-workstation.x86_64.0.1.15.1-51.el7_9 将被 更新
    —> 软件包 libsepol-devel.x86_64.0.2.5-10.el7 将被 安装
    —> 软件包 pcre-devel.x86_64.0.8.32-17.el7 将被 安装
    –> 解决依赖关系完成

依赖关系解决

=======================================================================================

Package 架构 版本 源 大小

正在安装:
openssl-devel x86_64 1:1.0.2k-25.el7_9 updates 1.5 M
zlib-devel x86_64 1.2.7-20.el7_9 updates 50 k
正在更新:
openssl x86_64 1:1.0.2k-25.el7_9 updates 494 k
zlib x86_64 1.2.7-20.el7_9 updates 90 k
为依赖而安装:
keyutils-libs-devel x86_64 1.5.8-3.el7 base 37 k
krb5-devel x86_64 1.15.1-51.el7_9 updates 273 k
libcom_err-devel x86_64 1.42.9-19.el7 base 32 k
libselinux-devel x86_64 2.5-15.el7 base 187 k
libsepol-devel x86_64 2.5-10.el7 base 77 k
libverto-devel x86_64 0.2.5-4.el7 base 12 k
pcre-devel x86_64 8.32-17.el7 base 480 k
为依赖而更新:
krb5-libs x86_64 1.15.1-51.el7_9 updates 809 k
krb5-pkinit x86_64 1.15.1-51.el7_9 updates 167 k
krb5-server x86_64 1.15.1-51.el7_9 updates 1.0 M
krb5-workstation x86_64 1.15.1-51.el7_9 updates 820 k
libkadm5 x86_64 1.15.1-51.el7_9 updates 179 k
openssl-libs x86_64 1:1.0.2k-25.el7_9 updates 1.2 M

事务概要

安装 2 软件包 (+7 依赖软件包)
升级 2 软件包 (+6 依赖软件包)

总计:7.3 M
总下载量:5.0 M
Downloading packages:
No Presto metadata available for updates
(1/13): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm | 37 kB 00:00:00
(2/13): krb5-devel-1.15.1-51.el7_9.x86_64.rpm | 273 kB 00:00:00
(3/13): libcom_err-devel-1.42.9-19.el7.x86_64.rpm | 32 kB 00:00:00
(4/13): krb5-pkinit-1.15.1-51.el7_9.x86_64.rpm | 167 kB 00:00:00
(5/13): libsepol-devel-2.5-10.el7.x86_64.rpm | 77 kB 00:00:00
(6/13): libverto-devel-0.2.5-4.el7.x86_64.rpm | 12 kB 00:00:00
(7/13): libkadm5-1.15.1-51.el7_9.x86_64.rpm | 179 kB 00:00:00
(8/13): libselinux-devel-2.5-15.el7.x86_64.rpm | 187 kB 00:00:00
(9/13): krb5-libs-1.15.1-51.el7_9.x86_64.rpm | 809 kB 00:00:02
(10/13): pcre-devel-8.32-17.el7.x86_64.rpm | 480 kB 00:00:01
(11/13): openssl-devel-1.0.2k-25.el7_9.x86_64.rpm | 1.5 MB 00:00:03
(12/13): zlib-devel-1.2.7-20.el7_9.x86_64.rpm | 50 kB 00:00:00

(13/13): openssl-libs-1.0.2k-25.el7_9.x86_64.rpm | 1.2 MB 00:00:03

总计 843 kB/s | 5.0 MB 00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : zlib-1.2.7-20.el7_9.x86_64 1/25
正在更新 : 1:openssl-libs-1.0.2k-25.el7_9.x86_64 2/25
正在更新 : krb5-libs-1.15.1-51.el7_9.x86_64 3/25
正在更新 : libkadm5-1.15.1-51.el7_9.x86_64 4/25
正在安装 : zlib-devel-1.2.7-20.el7_9.x86_64 5/25
正在安装 : libcom_err-devel-1.42.9-19.el7.x86_64 6/25
正在安装 : libverto-devel-0.2.5-4.el7.x86_64 7/25
正在安装 : libsepol-devel-2.5-10.el7.x86_64 8/25
正在安装 : keyutils-libs-devel-1.5.8-3.el7.x86_64 9/25
正在安装 : pcre-devel-8.32-17.el7.x86_64 10/25
正在安装 : libselinux-devel-2.5-15.el7.x86_64 11/25
正在安装 : krb5-devel-1.15.1-51.el7_9.x86_64 12/25
正在安装 : 1:openssl-devel-1.0.2k-25.el7_9.x86_64 13/25
正在更新 : krb5-workstation-1.15.1-51.el7_9.x86_64 14/25
正在更新 : krb5-server-1.15.1-51.el7_9.x86_64 15/25
正在更新 : 1:openssl-1.0.2k-25.el7_9.x86_64 16/25
正在更新 : krb5-pkinit-1.15.1-51.el7_9.x86_64 17/25
清理 : 1:openssl-1.0.2k-19.el7.x86_64 18/25
清理 : krb5-pkinit-1.15.1-50.el7.x86_64 19/25
清理 : krb5-server-1.15.1-50.el7.x86_64 20/25
清理 : krb5-workstation-1.15.1-50.el7.x86_64 21/25
清理 : libkadm5-1.15.1-50.el7.x86_64 22/25
清理 : 1:openssl-libs-1.0.2k-19.el7.x86_64 23/25
清理 : krb5-libs-1.15.1-50.el7.x86_64 24/25
清理 : zlib-1.2.7-18.el7.x86_64 25/25
验证中 : libselinux-devel-2.5-15.el7.x86_64 1/25
验证中 : krb5-libs-1.15.1-51.el7_9.x86_64 2/25
验证中 : krb5-workstation-1.15.1-51.el7_9.x86_64 3/25
验证中 : 1:openssl-1.0.2k-25.el7_9.x86_64 4/25
验证中 : pcre-devel-8.32-17.el7.x86_64 5/25
验证中 : keyutils-libs-devel-1.5.8-3.el7.x86_64 6/25
验证中 : libsepol-devel-2.5-10.el7.x86_64 7/25
验证中 : libkadm5-1.15.1-51.el7_9.x86_64 8/25
验证中 : libverto-devel-0.2.5-4.el7.x86_64 9/25
验证中 : krb5-server-1.15.1-51.el7_9.x86_64 10/25
验证中 : 1:openssl-libs-1.0.2k-25.el7_9.x86_64 11/25
验证中 : krb5-pkinit-1.15.1-51.el7_9.x86_64 12/25
验证中 : 1:openssl-devel-1.0.2k-25.el7_9.x86_64 13/25
验证中 : krb5-devel-1.15.1-51.el7_9.x86_64 14/25
验证中 : zlib-devel-1.2.7-20.el7_9.x86_64 15/25
验证中 : zlib-1.2.7-20.el7_9.x86_64 16/25
验证中 : libcom_err-devel-1.42.9-19.el7.x86_64 17/25
验证中 : krb5-pkinit-1.15.1-50.el7.x86_64 18/25
验证中 : zlib-1.2.7-18.el7.x86_64 19/25
验证中 : libkadm5-1.15.1-50.el7.x86_64 20/25
验证中 : krb5-workstation-1.15.1-50.el7.x86_64 21/25
验证中 : 1:openssl-1.0.2k-19.el7.x86_64 22/25
验证中 : 1:openssl-libs-1.0.2k-19.el7.x86_64 23/25
验证中 : krb5-libs-1.15.1-50.el7.x86_64 24/25
验证中 : krb5-server-1.15.1-50.el7.x86_64 25/25

已安装:
openssl-devel.x86_64 1:1.0.2k-25.el7_9 zlib-devel.x86_64 0:1.2.7-20.el7_9

作为依赖被安装:
keyutils-libs-devel.x86_64 0:1.5.8-3.el7 krb5-devel.x86_64 0:1.15.1-51.el7_9
libcom_err-devel.x86_64 0:1.42.9-19.el7 libselinux-devel.x86_64 0:2.5-15.el7
libsepol-devel.x86_64 0:2.5-10.el7 libverto-devel.x86_64 0:0.2.5-4.el7
pcre-devel.x86_64 0:8.32-17.el7

更新完毕:
openssl.x86_64 1:1.0.2k-25.el7_9 zlib.x86_64 0:1.2.7-20.el7_9

作为依赖被升级:
krb5-libs.x86_64 0:1.15.1-51.el7_9 krb5-pkinit.x86_64 0:1.15.1-51.el7_9
krb5-server.x86_64 0:1.15.1-51.el7_9 krb5-workstation.x86_64 0:1.15.1-51.el7_9
libkadm5.x86_64 0:1.15.1-51.el7_9 openssl-libs.x86_64 1:1.0.2k-25.el7_9

完毕!

2、下载 安装PCRE

下载地址: http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

[ooyy1102@localhost ~]$ cd /usr/local/src/
[ooyy1102@localhost src]$ su
密码:
[root@localhost src]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

–2022-05-25 13:47:53-- http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
正在解析主机 downloads.sourceforge.net (downloads.sourceforge.net)… 204.68.111.105
正在连接 downloads.sourceforge.net (downloads.sourceforge.net)|204.68.111.105|:80… 已连接。
已发出 HTTP 请求,正在等待回应… 302 Found
位置:http://nchc.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz [跟随至新的 URL]
–2022-05-25 13:47:53-- http://nchc.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
正在解析主机 nchc.dl.sourceforge.net (nchc.dl.sourceforge.net)… 140.110.96.69
正在连接 nchc.dl.sourceforge.net (nchc.dl.sourceforge.net)|140.110.96.69|:80… 已连接。
已发出 HTTP 请求,正在等待回应… 200 OK
长度:1996552 (1.9M) [application/x-gzip]
正在保存至: “pcre-8.35.tar.gz”

100%[=============================================>] 1,996,552 388KB/s 用时 5.0s

2022-05-25 13:47:59 (388 KB/s) - 已保存 “pcre-8.35.tar.gz” [1996552/1996552])

[root@localhost src]# tar zxvf pcre-8.35.tar.gz
[root@localhost src]# cd pcre-8.35/
[root@localhost pcre-8.35]# ./configure
[root@localhost pcre-8.35]# make && make install

checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /usr/bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether make supports nested variables… (cached) yes
checking for style of include used by make… GNU
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking whether gcc understands -c and -o together… yes
checking dependency style of gcc… gcc3
checking for ar… ar
checking the archiver (ar) interface… ar
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking whether gcc understands -c and -o together… (cached) yes
checking dependency style of gcc… (cached) gcc3
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking dependency style of g++… gcc3
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for int64_t… yes
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
checking how to print strings… printf
checking for a sed that does not truncate output… /usr/bin/sed
checking for fgrep… /usr/bin/grep -F
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface… BSD nm
checking whether ln -s works… yes
checking the maximum length of command line arguments… 1572864
checking whether the shell understands some XSI constructs… yes
checking whether the shell understands “+=”… yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format… func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format… func_convert_file_noop
checking for /usr/bin/ld option to reload object files… -r
checking for objdump… objdump
checking how to recognize dependent libraries… pass_all
checking for dlltool… dlltool
checking how to associate runtime and link libraries… printf %s\n
checking for archiver @FILE support… @
checking for strip… strip
checking for ranlib… ranlib
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for sysroot… no
checking for mt… no
checking if : is a manifest tool… no
checking for dlfcn.h… yes
checking for objdir… .libs
checking if gcc supports -fno-rtti -fno-exceptions… no
checking for gcc option to produce PIC… -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works… yes
checking if gcc static flag -static works… no
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.o… (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking how to run the C++ preprocessor… g++ -E
checking for ld used by g++… /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld… yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking for g++ option to produce PIC… -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works… yes
checking if g++ static flag -static works… no
checking if g++ supports -c -o file.o… yes
checking if g++ supports -c -o file.o… (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking dynamic linker characteristics… (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether ln -s works… yes
checking whether the -Werror option is usable… yes
checking for simple visibility declarations… yes
checking for ANSI C header files… (cached) yes
checking limits.h usability… yes
checking limits.h presence… yes
checking for limits.h… yes
checking for sys/types.h… (cached) yes
checking for sys/stat.h… (cached) yes
checking dirent.h usability… yes
checking dirent.h presence… yes
checking for dirent.h… yes
checking windows.h usability… no
checking windows.h presence… no
checking for windows.h… no
checking for alias support in the linker… no
checking for alias support in the linker… no
checking string usability… yes
checking string presence… yes
checking for string… yes
checking bits/type_traits.h usability… no
checking bits/type_traits.h presence… no
checking for bits/type_traits.h… no
checking type_traits.h usability… no
checking type_traits.h presence… no
checking for type_traits.h… no
checking for strtoq… yes
checking for long long… yes
checking for unsigned long long… yes
checking for an ANSI C-conforming const… yes
checking for size_t… yes
checking for bcopy… yes
checking for memmove… yes
checking for strerror… yes
checking zlib.h usability… yes
checking zlib.h presence… yes
checking for zlib.h… yes
checking for gzopen in -lz… yes
checking bzlib.h usability… no
checking bzlib.h presence… no
checking for bzlib.h… no
checking for libbz2… no
checking that generated files are newer than configure… done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libpcre.pc
config.status: creating libpcre16.pc
config.status: creating libpcre32.pc
config.status: creating libpcreposix.pc
config.status: creating libpcrecpp.pc
config.status: creating pcre-config
config.status: creating pcre.h
config.status: creating pcre_stringpiece.h
config.status: creating pcrecpparg.h
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing script-chmod commands
config.status: executing delete-old-chartables commands

pcre-8.35 configuration summary:

Install prefix .................. : /usr/local
C preprocessor .................. : gcc -E
C compiler ...................... : gcc
C++ preprocessor ................ : g++ -E
C++ compiler .................... : g++
Linker .......................... : /usr/bin/ld -m elf_x86_64
C preprocessor flags ............ : 
C compiler flags ................ : -g -O2 -fvisibility=hidden
C++ compiler flags .............. : -O2 -fvisibility=hidden -fvisibility-inlines-hidden
Linker flags .................... : 
Extra libraries ................. : 

Build 8 bit pcre library ........ : yes
Build 16 bit pcre library ....... : no
Build 32 bit pcre library ....... : no
Build C++ library ............... : yes
Enable JIT compiling support .... : no
Enable UTF-8/16/32 support ...... : no
Unicode properties .............. : no
Newline char/sequence ........... : lf
\R matches only ANYCRLF ......... : no
EBCDIC coding ................... : no
EBCDIC code for NL .............. : n/a
Rebuild char tables ............. : no
Use stack recursion ............. : yes
POSIX mem threshold ............. : 10
Internal link size .............. : 2
Nested parentheses limit ........ : 250
Match limit ..................... : 10000000
Match limit recursion ........... : MATCH_LIMIT
Build shared libs ............... : yes
Build static libs ............... : yes
Use JIT in pcregrep ............. : no
Buffer size for pcregrep ........ : 20480
Link pcregrep with libz ......... : no
Link pcregrep with libbz2 ....... : no
Link pcretest with libedit ...... : no
Link pcretest with libreadline .. : no
Valgrind support ................ : no
Code coverage ................... : no

-f pcre_chartables.c
ln -s ./pcre_chartables.c.dist pcre_chartables.c
make all-am
make[1]: 进入目录“/usr/local/src/pcre-8.35”
CC libpcre_la-pcre_byte_order.lo
CC libpcre_la-pcre_compile.lo
CC libpcre_la-pcre_config.lo
CC libpcre_la-pcre_dfa_exec.lo
CC libpcre_la-pcre_exec.lo
CC libpcre_la-pcre_fullinfo.lo
CC libpcre_la-pcre_get.lo
CC libpcre_la-pcre_globals.lo
CC libpcre_la-pcre_jit_compile.lo
CC libpcre_la-pcre_maketables.lo
CC libpcre_la-pcre_newline.lo
CC libpcre_la-pcre_ord2utf8.lo
CC libpcre_la-pcre_refcount.lo
CC libpcre_la-pcre_string_utils.lo
CC libpcre_la-pcre_study.lo
CC libpcre_la-pcre_tables.lo
CC libpcre_la-pcre_ucd.lo
CC libpcre_la-pcre_valid_utf8.lo
CC libpcre_la-pcre_version.lo
CC libpcre_la-pcre_xclass.lo
CC libpcre_la-pcre_chartables.lo
CCLD libpcre.la
CC libpcreposix_la-pcreposix.lo
CCLD libpcreposix.la
CXX libpcrecpp_la-pcrecpp.lo
CXX libpcrecpp_la-pcre_scanner.lo
CXX libpcrecpp_la-pcre_stringpiece.lo
CXXLD libpcrecpp.la
CC pcretest-pcretest.o
CC pcretest-pcre_printint.o
CCLD pcretest
CC pcregrep-pcregrep.o
CCLD pcregrep
CXX pcrecpp_unittest-pcrecpp_unittest.o
CXXLD pcrecpp_unittest
CXX pcre_scanner_unittest-pcre_scanner_unittest.o
CXXLD pcre_scanner_unittest
CXX pcre_stringpiece_unittest-pcre_stringpiece_unittest.o
CXXLD pcre_stringpiece_unittest
make[1]: 离开目录“/usr/local/src/pcre-8.35”
make install-am
make[1]: 进入目录“/usr/local/src/pcre-8.35”
make[2]: 进入目录“/usr/local/src/pcre-8.35”
/usr/bin/mkdir -p ‘/usr/local/lib’
/bin/sh ./libtool --mode=install /usr/bin/install -c libpcre.la libpcreposix.la libpcrecpp.la ‘/usr/local/lib’
libtool: install: /usr/bin/install -c .libs/libpcre.so.1.2.3 /usr/local/lib/libpcre.so.1.2.3
libtool: install: (cd /usr/local/lib && { ln -s -f libpcre.so.1.2.3 libpcre.so.1 || { rm -f libpcre.so.1 && ln -s libpcre.so.1.2.3 libpcre.so.1; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libpcre.so.1.2.3 libpcre.so || { rm -f libpcre.so && ln -s libpcre.so.1.2.3 libpcre.so; }; })
libtool: install: /usr/bin/install -c .libs/libpcre.lai /usr/local/lib/libpcre.la
libtool: install: warning: relinking libpcreposix.la' libtool: install: (cd /usr/local/src/pcre-8.35; /bin/sh /usr/local/src/pcre-8.35/libtool --silent --tag CC --mode=relink gcc -fvisibility=hidden -g -O2 -version-info 0:2:0 -o libpcreposix.la -rpath /usr/local/lib libpcreposix_la-pcreposix.lo libpcre.la ) libtool: install: /usr/bin/install -c .libs/libpcreposix.so.0.0.2T /usr/local/lib/libpcreposix.so.0.0.2 libtool: install: (cd /usr/local/lib && { ln -s -f libpcreposix.so.0.0.2 libpcreposix.so.0 || { rm -f libpcreposix.so.0 && ln -s libpcreposix.so.0.0.2 libpcreposix.so.0; }; }) libtool: install: (cd /usr/local/lib && { ln -s -f libpcreposix.so.0.0.2 libpcreposix.so || { rm -f libpcreposix.so && ln -s libpcreposix.so.0.0.2 libpcreposix.so; }; }) libtool: install: /usr/bin/install -c .libs/libpcreposix.lai /usr/local/lib/libpcreposix.la libtool: install: warning: relinking libpcrecpp.la’
libtool: install: (cd /usr/local/src/pcre-8.35; /bin/sh /usr/local/src/pcre-8.35/libtool --silent --tag CXX --mode=relink g++ -fvisibility=hidden -fvisibility-inlines-hidden -O2 -version-info 0:0:0 -o libpcrecpp.la -rpath /usr/local/lib libpcrecpp_la-pcrecpp.lo libpcrecpp_la-pcre_scanner.lo libpcrecpp_la-pcre_stringpiece.lo libpcre.la )
libtool: install: /usr/bin/install -c .libs/libpcrecpp.so.0.0.0T /usr/local/lib/libpcrecpp.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libpcrecpp.so.0.0.0 libpcrecpp.so.0 || { rm -f libpcrecpp.so.0 && ln -s libpcrecpp.so.0.0.0 libpcrecpp.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libpcrecpp.so.0.0.0 libpcrecpp.so || { rm -f libpcrecpp.so && ln -s libpcrecpp.so.0.0.0 libpcrecpp.so; }; })
libtool: install: /usr/bin/install -c .libs/libpcrecpp.lai /usr/local/lib/libpcrecpp.la
libtool: install: /usr/bin/install -c .libs/libpcre.a /usr/local/lib/libpcre.a
libtool: install: chmod 644 /usr/local/lib/libpcre.a
libtool: install: ranlib /usr/local/lib/libpcre.a
libtool: install: /usr/bin/install -c .libs/libpcreposix.a /usr/local/lib/libpcreposix.a
libtool: install: chmod 644 /usr/local/lib/libpcreposix.a
libtool: install: ranlib /usr/local/lib/libpcreposix.a
libtool: install: /usr/bin/install -c .libs/libpcrecpp.a /usr/local/lib/libpcrecpp.a
libtool: install: chmod 644 /usr/local/lib/libpcrecpp.a
libtool: install: ranlib /usr/local/lib/libpcrecpp.a

libtool: finish: PATH=“/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/ooyy1102/.local/bin:/home/ooyy1102/bin:/sbin” ldconfig -n /usr/local/lib

Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:

  • add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
    during execution
  • add LIBDIR to the `LD_RUN_PATH’ environment variable
    during linking
  • use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
  • have your system administrator add LIBDIR to `/etc/ld.so.conf’

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

/usr/bin/mkdir -p ‘/usr/local/bin’
/bin/sh ./libtool --mode=install /usr/bin/install -c pcretest pcregrep ‘/usr/local/bin’
libtool: install: /usr/bin/install -c .libs/pcretest /usr/local/bin/pcretest
libtool: install: /usr/bin/install -c .libs/pcregrep /usr/local/bin/pcregrep
/usr/bin/mkdir -p ‘/usr/local/bin’
/usr/bin/install -c pcre-config ‘/usr/local/bin’
/usr/bin/mkdir -p ‘/usr/local/share/doc/pcre’
/usr/bin/install -c -m 644 doc/pcre.txt doc/pcre-config.txt doc/pcregrep.txt doc/pcretest.txt AUTHORS COPYING ChangeLog LICENCE NEWS README ‘/usr/local/share/doc/pcre’
/usr/bin/mkdir -p ‘/usr/local/share/doc/pcre/html’
/usr/bin/install -c -m 644 doc/html/NON-AUTOTOOLS-BUILD.txt doc/html/README.txt doc/html/index.html doc/html/pcre-config.html doc/html/pcre.html doc/html/pcre16.html doc/html/pcre32.html doc/html/pcre_assign_jit_stack.html doc/html/pcre_compile.html doc/html/pcre_compile2.html doc/html/pcre_config.html doc/html/pcre_copy_named_substring.html doc/html/pcre_copy_substring.html doc/html/pcre_dfa_exec.html doc/html/pcre_exec.html doc/html/pcre_free_study.html doc/html/pcre_free_substring.html doc/html/pcre_free_substring_list.html doc/html/pcre_fullinfo.html doc/html/pcre_get_named_substring.html doc/html/pcre_get_stringnumber.html doc/html/pcre_get_stringtable_entries.html doc/html/pcre_get_substring.html doc/html/pcre_get_substring_list.html doc/html/pcre_jit_exec.html doc/html/pcre_jit_stack_alloc.html doc/html/pcre_jit_stack_free.html doc/html/pcre_maketables.html doc/html/pcre_pattern_to_host_byte_order.html doc/html/pcre_refcount.html doc/html/pcre_study.html doc/html/pcre_utf16_to_host_byte_order.html doc/html/pcre_utf32_to_host_byte_order.html doc/html/pcre_version.html doc/html/pcreapi.html doc/html/pcrebuild.html doc/html/pcrecallout.html doc/html/pcrecompat.html doc/html/pcredemo.html doc/html/pcregrep.html ‘/usr/local/share/doc/pcre/html’
/usr/bin/install -c -m 644 doc/html/pcrejit.html doc/html/pcrelimits.html doc/html/pcrematching.html doc/html/pcrepartial.html doc/html/pcrepattern.html doc/html/pcreperform.html doc/html/pcreposix.html doc/html/pcreprecompile.html doc/html/pcresample.html doc/html/pcrestack.html doc/html/pcresyntax.html doc/html/pcretest.html doc/html/pcreunicode.html ‘/usr/local/share/doc/pcre/html’
/usr/bin/mkdir -p ‘/usr/local/share/doc/pcre/html’
/usr/bin/install -c -m 644 doc/html/pcrecpp.html ‘/usr/local/share/doc/pcre/html’
/usr/bin/mkdir -p ‘/usr/local/include’
/usr/bin/install -c -m 644 pcreposix.h pcrecpp.h pcre_scanner.h ‘/usr/local/include’
/usr/bin/mkdir -p ‘/usr/local/share/man/man1’
/usr/bin/install -c -m 644 doc/pcre-config.1 doc/pcregrep.1 doc/pcretest.1 ‘/usr/local/share/man/man1’
/usr/bin/mkdir -p ‘/usr/local/share/man/man3’
/usr/bin/install -c -m 644 doc/pcre.3 doc/pcre16.3 doc/pcre32.3 doc/pcre_assign_jit_stack.3 doc/pcre_compile.3 doc/pcre_compile2.3 doc/pcre_config.3 doc/pcre_copy_named_substring.3 doc/pcre_copy_substring.3 doc/pcre_dfa_exec.3 doc/pcre_exec.3 doc/pcre_free_study.3 doc/pcre_free_substring.3 doc/pcre_free_substring_list.3 doc/pcre_fullinfo.3 doc/pcre_get_named_substring.3 doc/pcre_get_stringnumber.3 doc/pcre_get_stringtable_entries.3 doc/pcre_get_substring.3 doc/pcre_get_substring_list.3 doc/pcre_jit_exec.3 doc/pcre_jit_stack_alloc.3 doc/pcre_jit_stack_free.3 doc/pcre_maketables.3 doc/pcre_pattern_to_host_byte_order.3 doc/pcre_refcount.3 doc/pcre_study.3 doc/pcre_utf16_to_host_byte_order.3 doc/pcre_utf32_to_host_byte_order.3 doc/pcre_version.3 doc/pcreapi.3 doc/pcrebuild.3 doc/pcrecallout.3 doc/pcrecompat.3 doc/pcredemo.3 doc/pcrejit.3 doc/pcrelimits.3 doc/pcrematching.3 doc/pcrepartial.3 doc/pcrepattern.3 ‘/usr/local/share/man/man3’
/usr/bin/install -c -m 644 doc/pcreperform.3 doc/pcreposix.3 doc/pcreprecompile.3 doc/pcresample.3 doc/pcrestack.3 doc/pcresyntax.3 doc/pcreunicode.3 doc/pcrecpp.3 ‘/usr/local/share/man/man3’
/usr/bin/mkdir -p ‘/usr/local/include’
/usr/bin/install -c -m 644 pcre.h pcrecpparg.h pcre_stringpiece.h ‘/usr/local/include’
/usr/bin/mkdir -p ‘/usr/local/lib/pkgconfig’
/usr/bin/install -c -m 644 libpcre.pc libpcreposix.pc libpcrecpp.pc ‘/usr/local/lib/pkgconfig’
make install-data-hook
make[3]: 进入目录“/usr/local/src/pcre-8.35”
ln -sf pcre_assign_jit_stack.3 /usr/local/share/man/man3/pcre16_assign_jit_stack.3
ln -sf pcre_compile.3 /usr/local/share/man/man3/pcre16_compile.3
ln -sf pcre_compile2.3 /usr/local/share/man/man3/pcre16_compile2.3
ln -sf pcre_config.3 /usr/local/share/man/man3/pcre16_config.3
ln -sf pcre_copy_named_substring.3 /usr/local/share/man/man3/pcre16_copy_named_substring.3
ln -sf pcre_copy_substring.3 /usr/local/share/man/man3/pcre16_copy_substring.3
ln -sf pcre_dfa_exec.3 /usr/local/share/man/man3/pcre16_dfa_exec.3
ln -sf pcre_exec.3 /usr/local/share/man/man3/pcre16_exec.3
ln -sf pcre_free_study.3 /usr/local/share/man/man3/pcre16_free_study.3
ln -sf pcre_free_substring.3 /usr/local/share/man/man3/pcre16_free_substring.3
ln -sf pcre_free_substring_list.3 /usr/local/share/man/man3/pcre16_free_substring_list.3
ln -sf pcre_fullinfo.3 /usr/local/share/man/man3/pcre16_fullinfo.3
ln -sf pcre_get_named_substring.3 /usr/local/share/man/man3/pcre16_get_named_substring.3
ln -sf pcre_get_stringnumber.3 /usr/local/share/man/man3/pcre16_get_stringnumber.3
ln -sf pcre_get_stringtable_entries.3 /usr/local/share/man/man3/pcre16_get_stringtable_entries.3
ln -sf pcre_get_substring.3 /usr/local/share/man/man3/pcre16_get_substring.3
ln -sf pcre_get_substring_list.3 /usr/local/share/man/man3/pcre16_get_substring_list.3
ln -sf pcre_jit_exec.3 /usr/local/share/man/man3/pcre16_jit_exec.3
ln -sf pcre_jit_stack_alloc.3 /usr/local/share/man/man3/pcre16_jit_stack_alloc.3
ln -sf pcre_jit_stack_free.3 /usr/local/share/man/man3/pcre16_jit_stack_free.3
ln -sf pcre_maketables.3 /usr/local/share/man/man3/pcre16_maketables.3
ln -sf pcre_pattern_to_host_byte_order.3 /usr/local/share/man/man3/pcre16_pattern_to_host_byte_order.3
ln -sf pcre_refcount.3 /usr/local/share/man/man3/pcre16_refcount.3
ln -sf pcre_study.3 /usr/local/share/man/man3/pcre16_study.3
ln -sf pcre_utf16_to_host_byte_order.3 /usr/local/share/man/man3/pcre16_utf16_to_host_byte_order.3
ln -sf pcre_version.3 /usr/local/share/man/man3/pcre16_version.3
ln -sf pcre_assign_jit_stack.3 /usr/local/share/man/man3/pcre32_assign_jit_stack.3
ln -sf pcre_compile.3 /usr/local/share/man/man3/pcre32_compile.3
ln -sf pcre_compile2.3 /usr/local/share/man/man3/pcre32_compile2.3
ln -sf pcre_config.3 /usr/local/share/man/man3/pcre32_config.3
ln -sf pcre_copy_named_substring.3 /usr/local/share/man/man3/pcre32_copy_named_substring.3
ln -sf pcre_copy_substring.3 /usr/local/share/man/man3/pcre32_copy_substring.3
ln -sf pcre_dfa_exec.3 /usr/local/share/man/man3/pcre32_dfa_exec.3
ln -sf pcre_exec.3 /usr/local/share/man/man3/pcre32_exec.3
ln -sf pcre_free_study.3 /usr/local/share/man/man3/pcre32_free_study.3
ln -sf pcre_free_substring.3 /usr/local/share/man/man3/pcre32_free_substring.3
ln -sf pcre_free_substring_list.3 /usr/local/share/man/man3/pcre32_free_substring_list.3
ln -sf pcre_fullinfo.3 /usr/local/share/man/man3/pcre32_fullinfo.3
ln -sf pcre_get_named_substring.3 /usr/local/share/man/man3/pcre32_get_named_substring.3
ln -sf pcre_get_stringnumber.3 /usr/local/share/man/man3/pcre32_get_stringnumber.3
ln -sf pcre_get_stringtable_entries.3 /usr/local/share/man/man3/pcre32_get_stringtable_entries.3
ln -sf pcre_get_substring.3 /usr/local/share/man/man3/pcre32_get_substring.3
ln -sf pcre_get_substring_list.3 /usr/local/share/man/man3/pcre32_get_substring_list.3
ln -sf pcre_jit_exec.3 /usr/local/share/man/man3/pcre32_jit_exec.3
ln -sf pcre_jit_stack_alloc.3 /usr/local/share/man/man3/pcre32_jit_stack_alloc.3
ln -sf pcre_jit_stack_free.3 /usr/local/share/man/man3/pcre32_jit_stack_free.3
ln -sf pcre_maketables.3 /usr/local/share/man/man3/pcre32_maketables.3
ln -sf pcre_pattern_to_host_byte_order.3 /usr/local/share/man/man3/pcre32_pattern_to_host_byte_order.3
ln -sf pcre_refcount.3 /usr/local/share/man/man3/pcre32_refcount.3
ln -sf pcre_study.3 /usr/local/share/man/man3/pcre32_study.3
ln -sf pcre_utf32_to_host_byte_order.3 /usr/local/share/man/man3/pcre32_utf32_to_host_byte_order.3
ln -sf pcre_version.3 /usr/local/share/man/man3/pcre32_version.3
make[3]: 离开目录“/usr/local/src/pcre-8.35”
make[2]: 离开目录“/usr/local/src/pcre-8.35”
make[1]: 离开目录“/usr/local/src/pcre-8.35”

[root@localhost pcre-8.35]# pcre-config --version
8.35

3、下载安装Nginx

下载 Nginx,下载地址:https://nginx.org/en/download.html

[root@localhost pcre-8.35]# pwd
/usr/local/src/pcre-8.35
[root@localhost pcre-8.35]# cd /usr/local/src/
[root@localhost src]# wget http://nginx.org/download/nginx-1.6.2.tar.gz

–2022-05-25 14:21:07-- http://nginx.org/download/nginx-1.6.2.tar.gz
正在解析主机 nginx.org (nginx.org)… 52.58.199.22, 3.125.197.172
正在连接 nginx.org (nginx.org)|52.58.199.22|:80… 已连接。
已发出 HTTP 请求,正在等待回应… 200 OK
长度:804164 (785K) [application/octet-stream]
正在保存至: “nginx-1.6.2.tar.gz”

100%[=============================================>] 804,164 355KB/s 用时 2.2s

2022-05-25 14:21:10 (355 KB/s) - 已保存 “nginx-1.6.2.tar.gz” [804164/804164])

[root@localhost src]# tar zxvf nginx-1.6.2.tar.gz

nginx-1.6.2/
nginx-1.6.2/auto/
nginx-1.6.2/conf/
nginx-1.6.2/contrib/
nginx-1.6.2/src/
nginx-1.6.2/configure
nginx-1.6.2/LICENSE
nginx-1.6.2/README
nginx-1.6.2/html/
nginx-1.6.2/man/
nginx-1.6.2/CHANGES.ru
nginx-1.6.2/CHANGES
nginx-1.6.2/man/nginx.8
nginx-1.6.2/html/50x.html
nginx-1.6.2/html/index.html
nginx-1.6.2/src/core/
nginx-1.6.2/src/event/
nginx-1.6.2/src/http/
nginx-1.6.2/src/mail/
nginx-1.6.2/src/misc/
nginx-1.6.2/src/os/
nginx-1.6.2/src/os/unix/
nginx-1.6.2/src/os/unix/ngx_aio_read_chain.c
nginx-1.6.2/src/os/unix/ngx_aio_read.c
nginx-1.6.2/src/os/unix/ngx_aio_write_chain.c
nginx-1.6.2/src/os/unix/ngx_aio_write.c
nginx-1.6.2/src/os/unix/ngx_atomic.h
nginx-1.6.2/src/os/unix/ngx_alloc.c
nginx-1.6.2/src/os/unix/ngx_alloc.h
nginx-1.6.2/src/os/unix/ngx_darwin_config.h
nginx-1.6.2/src/os/unix/ngx_channel.c
nginx-1.6.2/src/os/unix/ngx_channel.h
nginx-1.6.2/src/os/unix/ngx_daemon.c
nginx-1.6.2/src/os/unix/ngx_darwin.h
nginx-1.6.2/src/os/unix/ngx_darwin_sendfile_chain.c
nginx-1.6.2/src/os/unix/ngx_darwin_init.c
nginx-1.6.2/src/os/unix/ngx_file_aio_read.c
nginx-1.6.2/src/os/unix/ngx_errno.c
nginx-1.6.2/src/os/unix/ngx_errno.h
nginx-1.6.2/src/os/unix/ngx_freebsd.h
nginx-1.6.2/src/os/unix/ngx_files.c
nginx-1.6.2/src/os/unix/ngx_files.h
nginx-1.6.2/src/os/unix/ngx_freebsd_rfork_thread.c
nginx-1.6.2/src/os/unix/ngx_freebsd_config.h
nginx-1.6.2/src/os/unix/ngx_freebsd_init.c
nginx-1.6.2/src/os/unix/ngx_freebsd_sendfile_chain.c
nginx-1.6.2/src/os/unix/ngx_freebsd_rfork_thread.h
nginx-1.6.2/src/os/unix/ngx_gcc_atomic_sparc64.h
nginx-1.6.2/src/os/unix/ngx_gcc_atomic_amd64.h
nginx-1.6.2/src/os/unix/ngx_gcc_atomic_ppc.h
nginx-1.6.2/src/os/unix/ngx_solaris_sendfilev_chain.c
nginx-1.6.2/src/os/unix/ngx_gcc_atomic_x86.h
nginx-1.6.2/src/os/unix/ngx_linux.h
nginx-1.6.2/src/os/unix/ngx_linux_aio_read.c
nginx-1.6.2/src/os/unix/ngx_linux_config.h
nginx-1.6.2/src/os/unix/ngx_linux_init.c
nginx-1.6.2/src/os/unix/ngx_linux_sendfile_chain.c
nginx-1.6.2/src/os/unix/ngx_os.h
nginx-1.6.2/src/os/unix/ngx_posix_config.h
nginx-1.6.2/src/os/unix/ngx_posix_init.c
nginx-1.6.2/src/os/unix/ngx_process.c
nginx-1.6.2/src/os/unix/ngx_process.h
nginx-1.6.2/src/os/unix/ngx_process_cycle.c
nginx-1.6.2/src/os/unix/ngx_process_cycle.h
nginx-1.6.2/src/os/unix/ngx_pthread_thread.c
nginx-1.6.2/src/os/unix/ngx_readv_chain.c
nginx-1.6.2/src/os/unix/ngx_recv.c
nginx-1.6.2/src/os/unix/ngx_send.c
nginx-1.6.2/src/os/unix/ngx_setaffinity.c
nginx-1.6.2/src/os/unix/ngx_setaffinity.h
nginx-1.6.2/src/os/unix/ngx_setproctitle.c
nginx-1.6.2/src/os/unix/ngx_setproctitle.h
nginx-1.6.2/src/os/unix/ngx_shmem.c
nginx-1.6.2/src/os/unix/ngx_shmem.h
nginx-1.6.2/src/os/unix/ngx_socket.c
nginx-1.6.2/src/os/unix/ngx_socket.h
nginx-1.6.2/src/os/unix/ngx_solaris.h
nginx-1.6.2/src/os/unix/ngx_solaris_config.h
nginx-1.6.2/src/os/unix/ngx_solaris_init.c
nginx-1.6.2/src/os/unix/ngx_sunpro_atomic_sparc64.h
nginx-1.6.2/src/os/unix/ngx_sunpro_amd64.il
nginx-1.6.2/src/os/unix/ngx_sunpro_sparc64.il
nginx-1.6.2/src/os/unix/ngx_sunpro_x86.il
nginx-1.6.2/src/os/unix/ngx_thread.h
nginx-1.6.2/src/os/unix/ngx_time.c
nginx-1.6.2/src/os/unix/ngx_time.h
nginx-1.6.2/src/os/unix/ngx_udp_recv.c
nginx-1.6.2/src/os/unix/ngx_user.c
nginx-1.6.2/src/os/unix/ngx_user.h
nginx-1.6.2/src/os/unix/ngx_writev_chain.c
nginx-1.6.2/src/os/unix/rfork_thread.S
nginx-1.6.2/src/misc/ngx_google_perftools_module.c
nginx-1.6.2/src/misc/ngx_cpp_test_module.cpp
nginx-1.6.2/src/mail/ngx_mail_handler.c
nginx-1.6.2/src/mail/ngx_mail.c
nginx-1.6.2/src/mail/ngx_mail.h
nginx-1.6.2/src/mail/ngx_mail_auth_http_module.c
nginx-1.6.2/src/mail/ngx_mail_core_module.c
nginx-1.6.2/src/mail/ngx_mail_imap_handler.c
nginx-1.6.2/src/mail/ngx_mail_imap_module.c
nginx-1.6.2/src/mail/ngx_mail_imap_module.h
nginx-1.6.2/src/mail/ngx_mail_parse.c
nginx-1.6.2/src/mail/ngx_mail_pop3_handler.c
nginx-1.6.2/src/mail/ngx_mail_pop3_module.c
nginx-1.6.2/src/mail/ngx_mail_pop3_module.h
nginx-1.6.2/src/mail/ngx_mail_proxy_module.c
nginx-1.6.2/src/mail/ngx_mail_smtp_handler.c
nginx-1.6.2/src/mail/ngx_mail_smtp_module.c
nginx-1.6.2/src/mail/ngx_mail_smtp_module.h
nginx-1.6.2/src/mail/ngx_mail_ssl_module.c
nginx-1.6.2/src/mail/ngx_mail_ssl_module.h
nginx-1.6.2/src/http/modules/
nginx-1.6.2/src/http/ngx_http_cache.h
nginx-1.6.2/src/http/ngx_http.c
nginx-1.6.2/src/http/ngx_http.h
nginx-1.6.2/src/http/ngx_http_copy_filter_module.c
nginx-1.6.2/src/http/ngx_http_busy_lock.c
nginx-1.6.2/src/http/ngx_http_busy_lock.h
nginx-1.6.2/src/http/ngx_http_config.h
nginx-1.6.2/src/http/ngx_http_header_filter_module.c
nginx-1.6.2/src/http/ngx_http_core_module.c
nginx-1.6.2/src/http/ngx_http_core_module.h
nginx-1.6.2/src/http/ngx_http_file_cache.c
nginx-1.6.2/src/http/ngx_http_parse_time.c
nginx-1.6.2/src/http/ngx_http_parse.c
nginx-1.6.2/src/http/ngx_http_request_body.c
nginx-1.6.2/src/http/ngx_http_request.c
nginx-1.6.2/src/http/ngx_http_postpone_filter_module.c
nginx-1.6.2/src/http/ngx_http_request.h
nginx-1.6.2/src/http/ngx_http_spdy_module.c
nginx-1.6.2/src/http/ngx_http_script.c
nginx-1.6.2/src/http/ngx_http_script.h
nginx-1.6.2/src/http/ngx_http_spdy.c
nginx-1.6.2/src/http/ngx_http_spdy.h
nginx-1.6.2/src/http/ngx_http_spdy_filter_module.c
nginx-1.6.2/src/http/ngx_http_spdy_module.h
nginx-1.6.2/src/http/ngx_http_special_response.c
nginx-1.6.2/src/http/ngx_http_upstream.c
nginx-1.6.2/src/http/ngx_http_upstream.h
nginx-1.6.2/src/http/ngx_http_upstream_round_robin.c
nginx-1.6.2/src/http/ngx_http_upstream_round_robin.h
nginx-1.6.2/src/http/ngx_http_variables.c
nginx-1.6.2/src/http/ngx_http_variables.h
nginx-1.6.2/src/http/ngx_http_write_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_addition_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_access_module.c
nginx-1.6.2/src/http/modules/ngx_http_charset_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_auth_basic_module.c
nginx-1.6.2/src/http/modules/ngx_http_auth_request_module.c
nginx-1.6.2/src/http/modules/ngx_http_autoindex_module.c
nginx-1.6.2/src/http/modules/ngx_http_browser_module.c
nginx-1.6.2/src/http/modules/ngx_http_not_modified_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_chunked_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_dav_module.c
nginx-1.6.2/src/http/modules/ngx_http_degradation_module.c
nginx-1.6.2/src/http/modules/ngx_http_empty_gif_module.c
nginx-1.6.2/src/http/modules/ngx_http_fastcgi_module.c
nginx-1.6.2/src/http/modules/ngx_http_flv_module.c
nginx-1.6.2/src/http/modules/ngx_http_geo_module.c
nginx-1.6.2/src/http/modules/ngx_http_geoip_module.c
nginx-1.6.2/src/http/modules/ngx_http_gunzip_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_gzip_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_gzip_static_module.c
nginx-1.6.2/src/http/modules/ngx_http_headers_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_image_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_index_module.c
nginx-1.6.2/src/http/modules/ngx_http_limit_conn_module.c
nginx-1.6.2/src/http/modules/ngx_http_limit_req_module.c
nginx-1.6.2/src/http/modules/ngx_http_log_module.c
nginx-1.6.2/src/http/modules/ngx_http_map_module.c
nginx-1.6.2/src/http/modules/ngx_http_memcached_module.c
nginx-1.6.2/src/http/modules/ngx_http_mp4_module.c
nginx-1.6.2/src/http/modules/ngx_http_random_index_module.c
nginx-1.6.2/src/http/modules/ngx_http_proxy_module.c
nginx-1.6.2/src/http/modules/ngx_http_upstream_ip_hash_module.c
nginx-1.6.2/src/http/modules/ngx_http_range_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_realip_module.c
nginx-1.6.2/src/http/modules/ngx_http_referer_module.c
nginx-1.6.2/src/http/modules/ngx_http_rewrite_module.c
nginx-1.6.2/src/http/modules/ngx_http_scgi_module.c
nginx-1.6.2/src/http/modules/ngx_http_secure_link_module.c
nginx-1.6.2/src/http/modules/ngx_http_split_clients_module.c
nginx-1.6.2/src/http/modules/ngx_http_ssi_filter_module.c
nginx-1.6.2/src/http/modules/perl/
nginx-1.6.2/src/http/modules/ngx_http_ssi_filter_module.h
nginx-1.6.2/src/http/modules/ngx_http_ssl_module.c
nginx-1.6.2/src/http/modules/ngx_http_ssl_module.h
nginx-1.6.2/src/http/modules/ngx_http_static_module.c
nginx-1.6.2/src/http/modules/ngx_http_stub_status_module.c
nginx-1.6.2/src/http/modules/ngx_http_sub_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_upstream_keepalive_module.c
nginx-1.6.2/src/http/modules/ngx_http_upstream_least_conn_module.c
nginx-1.6.2/src/http/modules/ngx_http_userid_filter_module.c
nginx-1.6.2/src/http/modules/ngx_http_uwsgi_module.c
nginx-1.6.2/src/http/modules/ngx_http_xslt_filter_module.c
nginx-1.6.2/src/http/modules/perl/Makefile.PL
nginx-1.6.2/src/http/modules/perl/nginx.pm
nginx-1.6.2/src/http/modules/perl/nginx.xs
nginx-1.6.2/src/http/modules/perl/typemap
nginx-1.6.2/src/http/modules/perl/ngx_http_perl_module.c
nginx-1.6.2/src/http/modules/perl/ngx_http_perl_module.h
nginx-1.6.2/src/event/modules/
nginx-1.6.2/src/event/ngx_event_accept.c
nginx-1.6.2/src/event/ngx_event.c
nginx-1.6.2/src/event/ngx_event.h
nginx-1.6.2/src/event/ngx_event_openssl_stapling.c
nginx-1.6.2/src/event/ngx_event_busy_lock.c
nginx-1.6.2/src/event/ngx_event_busy_lock.h
nginx-1.6.2/src/event/ngx_event_connect.c
nginx-1.6.2/src/event/ngx_event_connect.h
nginx-1.6.2/src/event/ngx_event_mutex.c
nginx-1.6.2/src/event/ngx_event_openssl.c
nginx-1.6.2/src/event/ngx_event_openssl.h
nginx-1.6.2/src/event/ngx_event_pipe.c
nginx-1.6.2/src/event/ngx_event_pipe.h
nginx-1.6.2/src/event/ngx_event_posted.c
nginx-1.6.2/src/event/ngx_event_posted.h
nginx-1.6.2/src/event/ngx_event_timer.c
nginx-1.6.2/src/event/ngx_event_timer.h
nginx-1.6.2/src/event/modules/ngx_devpoll_module.c
nginx-1.6.2/src/event/modules/ngx_aio_module.c
nginx-1.6.2/src/event/modules/ngx_eventport_module.c
nginx-1.6.2/src/event/modules/ngx_epoll_module.c
nginx-1.6.2/src/event/modules/ngx_win32_select_module.c
nginx-1.6.2/src/event/modules/ngx_kqueue_module.c
nginx-1.6.2/src/event/modules/ngx_poll_module.c
nginx-1.6.2/src/event/modules/ngx_rtsig_module.c
nginx-1.6.2/src/event/modules/ngx_select_module.c
nginx-1.6.2/src/core/ngx_array.c
nginx-1.6.2/src/core/nginx.c
nginx-1.6.2/src/core/nginx.h
nginx-1.6.2/src/core/ngx_conf_file.c
nginx-1.6.2/src/core/ngx_array.h
nginx-1.6.2/src/core/ngx_buf.c
nginx-1.6.2/src/core/ngx_buf.h
nginx-1.6.2/src/core/ngx_connection.c
nginx-1.6.2/src/core/ngx_conf_file.h
nginx-1.6.2/src/core/ngx_config.h
nginx-1.6.2/src/core/ngx_murmurhash.c
nginx-1.6.2/src/core/ngx_file.c
nginx-1.6.2/src/core/ngx_connection.h
nginx-1.6.2/src/core/ngx_core.h
nginx-1.6.2/src/core/ngx_cpuinfo.c
nginx-1.6.2/src/core/ngx_crc.h
nginx-1.6.2/src/core/ngx_crc32.c
nginx-1.6.2/src/core/ngx_crc32.h
nginx-1.6.2/src/core/ngx_crypt.c
nginx-1.6.2/src/core/ngx_crypt.h
nginx-1.6.2/src/core/ngx_cycle.c
nginx-1.6.2/src/core/ngx_cycle.h
nginx-1.6.2/src/core/ngx_file.h
nginx-1.6.2/src/core/ngx_hash.c
nginx-1.6.2/src/core/ngx_hash.h
nginx-1.6.2/src/core/ngx_inet.c
nginx-1.6.2/src/core/ngx_inet.h
nginx-1.6.2/src/core/ngx_list.c
nginx-1.6.2/src/core/ngx_list.h
nginx-1.6.2/src/core/ngx_log.c
nginx-1.6.2/src/core/ngx_log.h
nginx-1.6.2/src/core/ngx_md5.c
nginx-1.6.2/src/core/ngx_md5.h
nginx-1.6.2/src/core/ngx_open_file_cache.c
nginx-1.6.2/src/core/ngx_murmurhash.h
nginx-1.6.2/src/core/ngx_open_file_cache.h
nginx-1.6.2/src/core/ngx_output_chain.c
nginx-1.6.2/src/core/ngx_palloc.c
nginx-1.6.2/src/core/ngx_palloc.h
nginx-1.6.2/src/core/ngx_parse.c
nginx-1.6.2/src/core/ngx_parse.h
nginx-1.6.2/src/core/ngx_proxy_protocol.c
nginx-1.6.2/src/core/ngx_proxy_protocol.h
nginx-1.6.2/src/core/ngx_queue.c
nginx-1.6.2/src/core/ngx_queue.h
nginx-1.6.2/src/core/ngx_radix_tree.c
nginx-1.6.2/src/core/ngx_radix_tree.h
nginx-1.6.2/src/core/ngx_rbtree.c
nginx-1.6.2/src/core/ngx_rbtree.h
nginx-1.6.2/src/core/ngx_regex.c
nginx-1.6.2/src/core/ngx_regex.h
nginx-1.6.2/src/core/ngx_resolver.c
nginx-1.6.2/src/core/ngx_resolver.h
nginx-1.6.2/src/core/ngx_sha1.h
nginx-1.6.2/src/core/ngx_shmtx.c
nginx-1.6.2/src/core/ngx_shmtx.h
nginx-1.6.2/src/core/ngx_slab.c
nginx-1.6.2/src/core/ngx_slab.h
nginx-1.6.2/src/core/ngx_spinlock.c
nginx-1.6.2/src/core/ngx_string.c
nginx-1.6.2/src/core/ngx_string.h
nginx-1.6.2/src/core/ngx_times.c
nginx-1.6.2/src/core/ngx_times.h
nginx-1.6.2/contrib/geo2nginx.pl
nginx-1.6.2/contrib/README
nginx-1.6.2/contrib/unicode2nginx/
nginx-1.6.2/contrib/vim/
nginx-1.6.2/contrib/vim/ftdetect/
nginx-1.6.2/contrib/vim/indent/
nginx-1.6.2/contrib/vim/syntax/
nginx-1.6.2/contrib/vim/syntax/nginx.vim
nginx-1.6.2/contrib/vim/indent/nginx.vim
nginx-1.6.2/contrib/vim/ftdetect/nginx.vim
nginx-1.6.2/contrib/unicode2nginx/koi-utf
nginx-1.6.2/contrib/unicode2nginx/win-utf
nginx-1.6.2/contrib/unicode2nginx/unicode-to-nginx.pl
nginx-1.6.2/conf/fastcgi.conf
nginx-1.6.2/conf/fastcgi_params
nginx-1.6.2/conf/koi-utf
nginx-1.6.2/conf/koi-win
nginx-1.6.2/conf/mime.types
nginx-1.6.2/conf/nginx.conf
nginx-1.6.2/conf/scgi_params
nginx-1.6.2/conf/uwsgi_params
nginx-1.6.2/conf/win-utf
nginx-1.6.2/auto/cc/
nginx-1.6.2/auto/have_headers
nginx-1.6.2/auto/define
nginx-1.6.2/auto/endianness
nginx-1.6.2/auto/feature
nginx-1.6.2/auto/have
nginx-1.6.2/auto/lib/
nginx-1.6.2/auto/os/
nginx-1.6.2/auto/headers
nginx-1.6.2/auto/include
nginx-1.6.2/auto/init
nginx-1.6.2/auto/install
nginx-1.6.2/auto/types/
nginx-1.6.2/auto/make
nginx-1.6.2/auto/modules
nginx-1.6.2/auto/nohave
nginx-1.6.2/auto/options
nginx-1.6.2/auto/sources
nginx-1.6.2/auto/stubs
nginx-1.6.2/auto/summary
nginx-1.6.2/auto/unix
nginx-1.6.2/auto/types/uintptr_t
nginx-1.6.2/auto/types/sizeof
nginx-1.6.2/auto/types/typedef
nginx-1.6.2/auto/types/value
nginx-1.6.2/auto/os/conf
nginx-1.6.2/auto/os/darwin
nginx-1.6.2/auto/os/freebsd
nginx-1.6.2/auto/os/linux
nginx-1.6.2/auto/os/solaris
nginx-1.6.2/auto/os/win32
nginx-1.6.2/auto/lib/geoip/
nginx-1.6.2/auto/lib/conf
nginx-1.6.2/auto/lib/google-perftools/
nginx-1.6.2/auto/lib/libatomic/
nginx-1.6.2/auto/lib/libgd/
nginx-1.6.2/auto/lib/libxslt/
nginx-1.6.2/auto/lib/md5/
nginx-1.6.2/auto/lib/make
nginx-1.6.2/auto/lib/openssl/
nginx-1.6.2/auto/lib/pcre/
nginx-1.6.2/auto/lib/perl/
nginx-1.6.2/auto/lib/sha1/
nginx-1.6.2/auto/lib/zlib/
nginx-1.6.2/auto/lib/test
nginx-1.6.2/auto/lib/zlib/makefile.bcc
nginx-1.6.2/auto/lib/zlib/conf
nginx-1.6.2/auto/lib/zlib/make
nginx-1.6.2/auto/lib/zlib/makefile.msvc
nginx-1.6.2/auto/lib/zlib/makefile.owc
nginx-1.6.2/auto/lib/zlib/patch.zlib.h
nginx-1.6.2/auto/lib/sha1/makefile.bcc
nginx-1.6.2/auto/lib/sha1/conf
nginx-1.6.2/auto/lib/sha1/make
nginx-1.6.2/auto/lib/sha1/makefile.msvc
nginx-1.6.2/auto/lib/sha1/makefile.owc
nginx-1.6.2/auto/lib/perl/conf
nginx-1.6.2/auto/lib/perl/make
nginx-1.6.2/auto/lib/pcre/makefile.bcc
nginx-1.6.2/auto/lib/pcre/conf
nginx-1.6.2/auto/lib/pcre/make
nginx-1.6.2/auto/lib/pcre/makefile.msvc
nginx-1.6.2/auto/lib/pcre/makefile.owc
nginx-1.6.2/auto/lib/openssl/makefile.bcc
nginx-1.6.2/auto/lib/openssl/conf
nginx-1.6.2/auto/lib/openssl/make
nginx-1.6.2/auto/lib/openssl/makefile.msvc
nginx-1.6.2/auto/lib/md5/makefile.bcc
nginx-1.6.2/auto/lib/md5/conf
nginx-1.6.2/auto/lib/md5/make
nginx-1.6.2/auto/lib/md5/makefile.msvc
nginx-1.6.2/auto/lib/md5/makefile.owc
nginx-1.6.2/auto/lib/libxslt/conf
nginx-1.6.2/auto/lib/libgd/conf
nginx-1.6.2/auto/lib/libatomic/conf
nginx-1.6.2/auto/lib/libatomic/make
nginx-1.6.2/auto/lib/google-perftools/conf
nginx-1.6.2/auto/lib/geoip/conf
nginx-1.6.2/auto/cc/clang
nginx-1.6.2/auto/cc/acc
nginx-1.6.2/auto/cc/bcc
nginx-1.6.2/auto/cc/ccc
nginx-1.6.2/auto/cc/conf
nginx-1.6.2/auto/cc/gcc
nginx-1.6.2/auto/cc/icc
nginx-1.6.2/auto/cc/msvc
nginx-1.6.2/auto/cc/name
nginx-1.6.2/auto/cc/owc
nginx-1.6.2/auto/cc/sunc
[root@localhost src]# cd nginx-1.6.2/
[root@localhost nginx-1.6.2]# ./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35

checking for OS

  • Linux 3.10.0-1160.el7.x86_64 x86_64
    checking for C compiler … found
  • using GNU C compiler
  • gcc version: 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
    checking for gcc -pipe switch … found
    checking for gcc builtin atomic operations … found
    checking for C99 variadic macros … found
    checking for gcc variadic macros … found
    checking for unistd.h … found
    checking for inttypes.h … found
    checking for limits.h … found
    checking for sys/filio.h … not found
    checking for sys/param.h … found
    checking for sys/mount.h … found
    checking for sys/statvfs.h … found
    checking for crypt.h … found
    checking for Linux specific features
    checking for epoll … found
    checking for EPOLLRDHUP … found
    checking for O_PATH … found
    checking for sendfile() … found
    checking for sendfile64() … found
    checking for sys/prctl.h … found
    checking for prctl(PR_SET_DUMPABLE) … found
    checking for sched_setaffinity() … found
    checking for crypt_r() … found
    checking for sys/vfs.h … found
    checking for nobody group … found
    checking for poll() … found
    checking for /dev/poll … not found
    checking for kqueue … not found
    checking for crypt() … not found
    checking for crypt() in libcrypt … found
    checking for F_READAHEAD … not found
    checking for posix_fadvise() … found
    checking for O_DIRECT … found
    checking for F_NOCACHE … not found
    checking for directio() … not found
    checking for statfs() … found
    checking for statvfs() … found
    checking for dlopen() … not found
    checking for dlopen() in libdl … found
    checking for sched_yield() … found
    checking for SO_SETFIB … not found
    checking for SO_ACCEPTFILTER … not found
    checking for TCP_DEFER_ACCEPT … found
    checking for TCP_KEEPIDLE … found
    checking for TCP_FASTOPEN … found
    checking for TCP_INFO … found
    checking for accept4() … found
    checking for int size … 4 bytes
    checking for long size … 8 bytes
    checking for long long size … 8 bytes
    checking for void * size … 8 bytes
    checking for uint64_t … found
    checking for sig_atomic_t … found
    checking for sig_atomic_t size … 4 bytes
    checking for socklen_t … found
    checking for in_addr_t … found
    checking for in_port_t … found
    checking for rlim_t … found
    checking for uintptr_t … uintptr_t found
    checking for system byte ordering … little endian
    checking for size_t size … 8 bytes
    checking for off_t size … 8 bytes
    checking for time_t size … 8 bytes
    checking for setproctitle() … not found
    checking for pread() … found
    checking for pwrite() … found
    checking for sys_nerr … found
    checking for localtime_r() … found
    checking for posix_memalign() … found
    checking for memalign() … found
    checking for mmap(MAP_ANON|MAP_SHARED) … found
    checking for mmap(“/dev/zero”, MAP_SHARED) … found
    checking for System V shared memory … found
    checking for POSIX semaphores … not found
    checking for POSIX semaphores in libpthread … found
    checking for struct msghdr.msg_control … found
    checking for ioctl(FIONBIO) … found
    checking for struct tm.tm_gmtoff … found
    checking for struct dirent.d_namlen … not found
    checking for struct dirent.d_type … found
    checking for sysconf(_SC_NPROCESSORS_ONLN) … found
    checking for openat(), fstatat() … found
    checking for getaddrinfo() … found
    checking for OpenSSL library … found
    checking for zlib library … found
    creating objs/Makefile

Configuration summary

  • using PCRE library: /usr/local/src/pcre-8.35
  • using system OpenSSL library
  • md5: using OpenSSL library
  • sha1: using OpenSSL library
  • using system zlib library

nginx path prefix: “/usr/local/webserver/nginx”
nginx binary file: “/usr/local/webserver/nginx/sbin/nginx”
nginx configuration prefix: “/usr/local/webserver/nginx/conf”
nginx configuration file: “/usr/local/webserver/nginx/conf/nginx.conf”
nginx pid file: “/usr/local/webserver/nginx/logs/nginx.pid”
nginx error log file: “/usr/local/webserver/nginx/logs/error.log”
nginx http access log file: “/usr/local/webserver/nginx/logs/access.log”
nginx http client request body temporary files: “client_body_temp”
nginx http proxy temporary files: “proxy_temp”
nginx http fastcgi temporary files: “fastcgi_temp”
nginx http uwsgi temporary files: “uwsgi_temp”
nginx http scgi temporary files: “scgi_temp”

make && make install

等待编译完成

[root@localhost nginx-1.6.2]# /usr/local/webserver/nginx/sbin/nginx -v
nginx version: nginx/1.6.2

4、配置Nginx

4.1 创建运行使用的账户www
[root@localhost nginx-1.6.2]# /usr/sbin/groupadd www 
[root@localhost nginx-1.6.2]# /usr/sbin/useradd -g www www
[root@localhost nginx-1.6.2]# pwd
/usr/local/src/nginx-1.6.2
4.2 配置Nginx配置文件
[root@localhost nginx-1.6.2]# cd /usr/local/webserver/nginx/conf/
[root@localhost conf]# ls
fastcgi.conf            koi-utf             nginx.conf           uwsgi_params
fastcgi.conf.default    koi-win             nginx.conf.default   uwsgi_params.default
fastcgi_params          mime.types          scgi_params          win-utf
fastcgi_params.default  mime.types.default  scgi_params.default
[root@localhost conf]# gedit nginx.conf

[root@localhost conf]# cp nginx.conf nginx.conf.bak
[root@localhost conf]# gedit nginx.conf

[root@localhost conf]# /usr/local/webserver/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/webserver/nginx/conf/nginx.conf test is successful
[root@localhost conf]# /usr/local/webserver/nginx/sbin/nginx
[root@localhost conf]# 
4.3 附nginx.conf文件内容(直接复制到文件编辑即可)
user www www;
worker_processes 2; #设置值和CPU核心数一致
error_log /usr/local/webserver/nginx/logs/nginx_error.log crit; #日志位置和日志级别
pid /usr/local/webserver/nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
events
{
  use epoll;
  worker_connections 65535;
}
http
{
  include mime.types;
  default_type application/octet-stream;
  log_format main  '$remote_addr - $remote_user [$time_local] "$request" '
               '$status $body_bytes_sent "$http_referer" '
               '"$http_user_agent" $http_x_forwarded_for';

#charset gb2312;
     
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 8m;
     
  sendfile on;
  tcp_nopush on;
  keepalive_timeout 60;
  tcp_nodelay on;
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 64k;
  fastcgi_buffers 4 64k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 128k;
  gzip on; 
  gzip_min_length 1k;
  gzip_buffers 4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_types text/plain application/x-javascript text/css application/xml;
  gzip_vary on;

  #limit_zone crawler $binary_remote_addr 10m;
 #下面是server虚拟主机的配置
 server
  {
    listen 80;#监听端口
    server_name localhost;#域名
    index index.html index.htm index.php;
    root /usr/local/webserver/nginx/html;#站点目录
      location ~ .*\.(php|php5)?$
    {
      #fastcgi_pass unix:/tmp/php-cgi.sock;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      include fastcgi.conf;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$
    {
      expires 30d;

  # access_log off;

    }
    location ~ .*\.(js|css)?$
    {
      expires 15d;

   # access_log off;

    }
    access_log off;

  }

}

5、配置站点主页

server
{
listen 80;#监听端口
server_name localhost;#域名
index index.html index.htm index.php;
root /usr/local/webserver/nginx/html;#站点目录
location ~ ..(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .
.(gif|jpg|jpeg|png|bmp|swf|ico)$
{
expires 30d;

只要把我们的网站放在

/usr/local/webserver/nginx/html

目录下就可以了。

在没安装PHP等环境的时候,只支持普通的html网页哦。

/usr/local/webserver/nginx/sbin/nginx -s reload            # 重新载入配置文件
/usr/local/webserver/nginx/sbin/nginx -s reopen            # 重启 Nginx
/usr/local/webserver/nginx/sbin/nginx -s stop              # 停止 Nginx

方式二:宝塔面板一键安装部署

安装脚本:

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec

具体可以看我之前的文章和视频哦:

https://www.toutiao.com/article/7098884541569401359/

Logo

更多推荐