Nginx程序部署及啓動

**Nginx程序部署及啓動html

如下全部操做爲centos6.7環境
1、安裝Nginx所需的pcre庫
Pcre:中文perl兼容正則表達式,官方網站:http://www.pcre.org/
安裝pcre庫是爲了使nginx支持HTTP Rewrite模塊linux

安裝過程:
1)安裝Pcre軟件
[root@localhost ~]# mkdir tools #建立一個工具目錄
[root@localhost ~]# ll
drwxr-xr-x. 2 root root 6 4月 24 15:49 tools
[root@localhost ~]#
[root@localhost ~]# mv pcre-8.42.tar.gz tools/
[root@localhost ~]# cd tools/
[root@localhost tools]# ll
總用量 2036
-rw-r--r--. 1 root root 2081413 7月 24 01:12 pcre-8.42.tar.gz
[root@localhost tools]#
[root@localhost tools]# tar zxf pcre-8.42.tar.gz #解壓pcre包
[root@localhost tools]# ll
總用量 2040
drwxr-xr-x. 7 1169 1169 4096 3月 20 18:53 pcre-8.42
-rw-r--r--. 1 root root 2081413 7月 24 01:12 pcre-8.42.tar.gz
[root@localhost tools]#
[root@localhost tools]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
--2018-07-24 01:30:08-- ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
=> 「pcre-8.40.tar.gz」
正在解析主機 ftp.csx.cam.ac.uk... 131.111.8.115
正在鏈接 ftp.csx.cam.ac.uk|131.111.8.115|:21... 已鏈接。
正在以 anonymous 登陸 ... 登陸成功!
==> SYST ... 完成。 ==> PWD ... 完成。
==> TYPE I ... 完成。 ==> CWD (1) /pub/software/programming/pcre ... 完成。
==> SIZE pcre-8.40.tar.gz ... 2065161
==> PASV ... 完成。 ==> RETR pcre-8.40.tar.gz ... 完成。
長度:2065161 (2.0M) (非正式數據)nginx

37% [=======================> ] 782,544 242K/s eta(英國中部時41% [=========================> ] 859,656 246K/s eta(英國中部時45% [============================> ] 938,196 253K/s eta(英國中部時49% [==============================> ] 1,012,452 259K/s eta(英國中部時52% [================================> ] 1,086,708 264K/s eta(英國中部時56% [===================================> ] 1,169,532 277K/s eta(英國中部時60% [=====================================> ] 1,242,360 289K/s eta(英國中部時64% [=======================================> ] 1,322,328 296K/s eta(英國中部時67% [==========================================> ] 1,399,440 296K/s eta(英國中部時71% [============================================> ] 1,467,984 315K/s eta(英國中部時74% [==============================================> ] 1,546,524 315K/s eta(英國中部時78% [=================================================> ] 1,625,064 320K/s eta(英國中部時81% [===================================================> ] 1,692,180 323K/s eta(英國中部時85% [=====================================================> ] 1,759,296 322K/s eta(英國中部時88% [=======================================================> ] 1,827,840 322K/s eta(英國中部時92% [==========================================================> ] 1,909,236 324K/s eta(英國中部時95% [============================================================> ] 1,982,064 328K/s eta(英國中部時100%[===============================================================>] 2,065,161 327K/s eta(英國中部時100%[===============================================================>] 2,065,161 327K/s in 6.9s 正則表達式

2018-07-24 01:30:18 (291 KB/s) - 「pcre-8.40.tar.gz」 已保存 [2065161]windows

[root@localhost tools]# ll
總用量 4060
drwxr-xr-x. 7 1169 1169 4096 3月 20 18:53 pcre-8.42
-rw-r--r--. 1 root root 2081413 7月 24 01:12 pcre-8.42.tar.gz
[root@localhost tools]#
[root@localhost tools]# cd pcre-8.42centos

如下是經典錯誤:

[root@localhost pcre-8.42]# ./configure
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/ pcre-8.42':
configure: error: no acceptable C compiler found in $PATH
api

解決辦法:

[root@localhost pcre-8.42]# *yum -y install gcc #安裝gcc工具**
[root@localhost pcre-8.42]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /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... /bin/grep
checking for egrep... /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-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /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... 1966080
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-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 a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
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.42 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瀏覽器

[root@localhost pcre-8.42]# echo $? #確認上一條命令「./configure」執行是否成功
0
[root@localhost pcre-8.42]#
[root@localhost pcre-8.42]# make && make install #編譯安裝
rm -f pcre_chartables.c
ln -s ./pcre_chartables.c.dist pcre_chartables.c
make all-am
make[1]: Entering directory /root/tools/pcre-8.42'<br/>CC libpcre_la-pcre_byte_order.lo<br/>CC libpcre_la-pcre_compile.lo<br/>CC libpcre_la-pcre_config.lo<br/>CC libpcre_la-pcre_dfa_exec.lo<br/>CC libpcre_la-pcre_exec.lo<br/>CC libpcre_la-pcre_fullinfo.lo<br/>CC libpcre_la-pcre_get.lo<br/>CC libpcre_la-pcre_globals.lo<br/>CC libpcre_la-pcre_jit_compile.lo<br/>CC libpcre_la-pcre_maketables.lo<br/>CC libpcre_la-pcre_newline.lo<br/>CC libpcre_la-pcre_ord2utf8.lo<br/>CC libpcre_la-pcre_refcount.lo<br/>CC libpcre_la-pcre_string_utils.lo<br/>CC libpcre_la-pcre_study.lo<br/>CC libpcre_la-pcre_tables.lo<br/>CC libpcre_la-pcre_ucd.lo<br/>CC libpcre_la-pcre_valid_utf8.lo<br/>CC libpcre_la-pcre_version.lo<br/>CC libpcre_la-pcre_xclass.lo<br/>CC libpcre_la-pcre_chartables.lo<br/>CCLD libpcre.la<br/>CC libpcreposix_la-pcreposix.lo<br/>CCLD libpcreposix.la<br/>CXX libpcrecpp_la-pcrecpp.lo<br/>CXX libpcrecpp_la-pcre_scanner.lo<br/>CXX libpcrecpp_la-pcre_stringpiece.lo<br/>CXXLD libpcrecpp.la<br/>CC pcretest-pcretest.o<br/>CC pcretest-pcre_printint.o<br/>CCLD pcretest<br/>CC pcregrep-pcregrep.o<br/>CCLD pcregrep<br/>CXX pcrecpp_unittest-pcrecpp_unittest.o<br/>CXXLD pcrecpp_unittest<br/>CXX pcre_scanner_unittest-pcre_scanner_unittest.o<br/>CXXLD pcre_scanner_unittest<br/>CXX pcre_stringpiece_unittest-pcre_stringpiece_unittest.o<br/>CXXLD pcre_stringpiece_unittest<br/>make[1]: Leaving directory/root/tools/pcre-8.42'
make install-am
make[1]: Entering directory /root/tools/pcre-8.42'<br/>make[1]: Warning: File/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/limits.h' has modification time 6.4e+06 s in the future
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[2]: Entering directory /root/tools/pcre-8.42'<br/>make[2]: Warning: File/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h' has modification time 6.4e+06 s in the future
CC pcretest-pcretest.o
CC pcretest-pcre_printint.o
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
CCLD pcretest
CC pcregrep-pcregrep.o
CCLD pcregrep
CXX libpcrecpp_la-pcrecpp.lo
CXX libpcrecpp_la-pcre_scanner.lo
CXX libpcrecpp_la-pcre_stringpiece.lo
CXXLD libpcrecpp.la
/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.10 /usr/local/lib/libpcre.so.1.2.10
libtool: install: (cd /usr/local/lib && { ln -s -f libpcre.so.1.2.10 libpcre.so.1 || { rm -f libpcre.so.1 && ln -s libpcre.so.1.2.10 libpcre.so.1; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libpcre.so.1.2.10 libpcre.so || { rm -f libpcre.so && ln -s libpcre.so.1.2.10 libpcre.so; }; })
libtool: install: /usr/bin/install -c .libs/libpcre.lai /usr/local/lib/libpcre.la
libtool: warning: relinking 'libpcreposix.la'
libtool: install: (cd /root/tools/pcre-8.42; /bin/sh "/root/tools/pcre-8.42/libtool" --silent --tag CC --mode=relink gcc -fvisibility=hidden -g -O2 -version-info 0:6: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.6T /usr/local/lib/libpcreposix.so.0.0.6
libtool: install: (cd /usr/local/lib && { ln -s -f libpcreposix.so.0.0.6 libpcreposix.so.0 || { rm -f libpcreposix.so.0 && ln -s libpcreposix.so.0.0.6 libpcreposix.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libpcreposix.so.0.0.6 libpcreposix.so || { rm -f libpcreposix.so && ln -s libpcreposix.so.0.0.6 libpcreposix.so; }; })
libtool: install: /usr/bin/install -c .libs/libpcreposix.lai /usr/local/lib/libpcreposix.la
libtool: warning: relinking 'libpcrecpp.la'
libtool: install: (cd /root/tools/pcre-8.42; /bin/sh "/root/tools/pcre-8.42/libtool" --silent --tag CXX --mode=relink g++ -fvisibility=hidden -fvisibility-inlines-hidden -O2 -version-info 0:1: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.1T /usr/local/lib/libpcrecpp.so.0.0.1
libtool: install: (cd /usr/local/lib && { ln -s -f libpcrecpp.so.0.0.1 libpcrecpp.so.0 || { rm -f libpcrecpp.so.0 && ln -s libpcrecpp.so.0.0.1 libpcrecpp.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libpcrecpp.so.0.0.1 libpcrecpp.so || { rm -f libpcrecpp.so && ln -s libpcrecpp.so.0.0.1 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/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/lib架構

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

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.

/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
/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c pcre-config '/usr/local/bin'
/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'
/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'
/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'
/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 pcreposix.h pcrecpp.h pcre_scanner.h '/usr/local/include'
/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'
/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'
/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 pcre.h pcrecpparg.h pcre_stringpiece.h '/usr/local/include'
/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]: Entering directory /root/tools/pcre-8.42'<br/>ln -sf pcre_assign_jit_stack.3 /usr/local/share/man/man3/pcre16_assign_jit_stack.3<br/>ln -sf pcre_compile.3 /usr/local/share/man/man3/pcre16_compile.3<br/>ln -sf pcre_compile2.3 /usr/local/share/man/man3/pcre16_compile2.3<br/>ln -sf pcre_config.3 /usr/local/share/man/man3/pcre16_config.3<br/>ln -sf pcre_copy_named_substring.3 /usr/local/share/man/man3/pcre16_copy_named_substring.3<br/>ln -sf pcre_copy_substring.3 /usr/local/share/man/man3/pcre16_copy_substring.3<br/>ln -sf pcre_dfa_exec.3 /usr/local/share/man/man3/pcre16_dfa_exec.3<br/>ln -sf pcre_exec.3 /usr/local/share/man/man3/pcre16_exec.3<br/>ln -sf pcre_free_study.3 /usr/local/share/man/man3/pcre16_free_study.3<br/>ln -sf pcre_free_substring.3 /usr/local/share/man/man3/pcre16_free_substring.3<br/>ln -sf pcre_free_substring_list.3 /usr/local/share/man/man3/pcre16_free_substring_list.3<br/>ln -sf pcre_fullinfo.3 /usr/local/share/man/man3/pcre16_fullinfo.3<br/>ln -sf pcre_get_named_substring.3 /usr/local/share/man/man3/pcre16_get_named_substring.3<br/>ln -sf pcre_get_stringnumber.3 /usr/local/share/man/man3/pcre16_get_stringnumber.3<br/>ln -sf pcre_get_stringtable_entries.3 /usr/local/share/man/man3/pcre16_get_stringtable_entries.3<br/>ln -sf pcre_get_substring.3 /usr/local/share/man/man3/pcre16_get_substring.3<br/>ln -sf pcre_get_substring_list.3 /usr/local/share/man/man3/pcre16_get_substring_list.3<br/>ln -sf pcre_jit_exec.3 /usr/local/share/man/man3/pcre16_jit_exec.3<br/>ln -sf pcre_jit_stack_alloc.3 /usr/local/share/man/man3/pcre16_jit_stack_alloc.3<br/>ln -sf pcre_jit_stack_free.3 /usr/local/share/man/man3/pcre16_jit_stack_free.3<br/>ln -sf pcre_maketables.3 /usr/local/share/man/man3/pcre16_maketables.3<br/>ln -sf pcre_pattern_to_host_byte_order.3 /usr/local/share/man/man3/pcre16_pattern_to_host_byte_order.3<br/>ln -sf pcre_refcount.3 /usr/local/share/man/man3/pcre16_refcount.3<br/>ln -sf pcre_study.3 /usr/local/share/man/man3/pcre16_study.3<br/>ln -sf pcre_utf16_to_host_byte_order.3 /usr/local/share/man/man3/pcre16_utf16_to_host_byte_order.3<br/>ln -sf pcre_version.3 /usr/local/share/man/man3/pcre16_version.3<br/>ln -sf pcre_assign_jit_stack.3 /usr/local/share/man/man3/pcre32_assign_jit_stack.3<br/>ln -sf pcre_compile.3 /usr/local/share/man/man3/pcre32_compile.3<br/>ln -sf pcre_compile2.3 /usr/local/share/man/man3/pcre32_compile2.3<br/>ln -sf pcre_config.3 /usr/local/share/man/man3/pcre32_config.3<br/>ln -sf pcre_copy_named_substring.3 /usr/local/share/man/man3/pcre32_copy_named_substring.3<br/>ln -sf pcre_copy_substring.3 /usr/local/share/man/man3/pcre32_copy_substring.3<br/>ln -sf pcre_dfa_exec.3 /usr/local/share/man/man3/pcre32_dfa_exec.3<br/>ln -sf pcre_exec.3 /usr/local/share/man/man3/pcre32_exec.3<br/>ln -sf pcre_free_study.3 /usr/local/share/man/man3/pcre32_free_study.3<br/>ln -sf pcre_free_substring.3 /usr/local/share/man/man3/pcre32_free_substring.3<br/>ln -sf pcre_free_substring_list.3 /usr/local/share/man/man3/pcre32_free_substring_list.3<br/>ln -sf pcre_fullinfo.3 /usr/local/share/man/man3/pcre32_fullinfo.3<br/>ln -sf pcre_get_named_substring.3 /usr/local/share/man/man3/pcre32_get_named_substring.3<br/>ln -sf pcre_get_stringnumber.3 /usr/local/share/man/man3/pcre32_get_stringnumber.3<br/>ln -sf pcre_get_stringtable_entries.3 /usr/local/share/man/man3/pcre32_get_stringtable_entries.3<br/>ln -sf pcre_get_substring.3 /usr/local/share/man/man3/pcre32_get_substring.3<br/>ln -sf pcre_get_substring_list.3 /usr/local/share/man/man3/pcre32_get_substring_list.3<br/>ln -sf pcre_jit_exec.3 /usr/local/share/man/man3/pcre32_jit_exec.3<br/>ln -sf pcre_jit_stack_alloc.3 /usr/local/share/man/man3/pcre32_jit_stack_alloc.3<br/>ln -sf pcre_jit_stack_free.3 /usr/local/share/man/man3/pcre32_jit_stack_free.3<br/>ln -sf pcre_maketables.3 /usr/local/share/man/man3/pcre32_maketables.3<br/>ln -sf pcre_pattern_to_host_byte_order.3 /usr/local/share/man/man3/pcre32_pattern_to_host_byte_order.3<br/>ln -sf pcre_refcount.3 /usr/local/share/man/man3/pcre32_refcount.3<br/>ln -sf pcre_study.3 /usr/local/share/man/man3/pcre32_study.3<br/>ln -sf pcre_utf32_to_host_byte_order.3 /usr/local/share/man/man3/pcre32_utf32_to_host_byte_order.3<br/>ln -sf pcre_version.3 /usr/local/share/man/man3/pcre32_version.3<br/>make[3]: Leaving directory/root/tools/pcre-8.42'
make[2]: warning: Clock skew detected. Your build may be incomplete.
make[2]: Leaving directory /root/tools/pcre-8.42'<br/>make[1]: warning: Clock skew detected. Your build may be incomplete.<br/>make[1]: Leaving directory/root/tools/pcre-8.42'
[root@localhost pcre-8.42]#
[root@localhost pcre-8.42]# echo $?
0
[root@localhost pcre-8.42]#

2、安裝Nginx軟件
Nginx官方網站:http://nginx.org/
選擇nginx版本最好穩定型,新版本通常有bug,穩定版本(Stable version)
[root@broadtech-1 tools]# wget http://nginx.org/download/nginx-1.14.0.tar.gz #下載nginx安裝包
--2018-04-06 10:16:26-- http://nginx.org/download/nginx-1.14.0.tar.gz
Resolving nginx.org... 95.211.80.227, 206.251.255.63, 2001:1af8:4060:a004:21::e3, ...
Connecting to nginx.org|95.211.80.227|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1016272 (992K) [application/octet-stream]
Saving to: 「nginx-1.14.0.tar.gz」

100%[===============================================================>] 1,016,272 577K/s in 1.7s

2018-04-06 10:16:29 (577 KB/s) - 「nginx-1.14.0.tar.gz」 saved [1016272/1016272]

[root@broadtech-1 tools]# ll
total 3044
-rw-r--r--. 1 root root 1016272 Apr 17 2018 nginx-1.14.0.tar.gz
drwxr-xr-x. 9 1169 1169 12288 Apr 6 10:04 pcre-8.42
-rw-r--r--. 1 root root 2081413 Apr 6 10:00 pcre-8.42.tar.gz
[root@broadtech-1 tools]#
[root@broadtech-1 tools]# tar zxf nginx-1.14.0.tar.gz #解壓nginx安裝包
[root@broadtech-1 nginx-1.14.0]# useradd nginx -s /bin/nologin -M #建立nginx用戶賬號
[root@broadtech-1 nginx-1.14.0]# tail -1 /etc/group #查看建立的賬號
nginx:x:501:
[root@broadtech-1 nginx-1.14.0]#
[root@CentOS-A-server nginx-1.14.0]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.14.0 --with-http_stub_status_module --with-http_ssl_module
checking for OS

  • Linux 2.6.32-573.el6.x86_64 x86_64
    checking for C compiler ... found
  • using GNU C compiler
  • gcc version: 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
    checking for gcc -pipe switch ... found
    checking for -Wl,-E switch ... found
    checking for gcc builtin atomic operations ... found
    checking for C99 variadic macros ... found
    checking for gcc variadic macros ... found
    checking for gcc builtin 64 bit byteswap ... 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 EPOLLEXCLUSIVE ... not found
    checking for O_PATH ... not found
    checking for sendfile() ... found
    checking for sendfile64() ... found
    checking for sys/prctl.h ... found
    checking for prctl(PR_SET_DUMPABLE) ... found
    checking for prctl(PR_SET_KEEPCAPS) ... found
    checking for capabilities ... found
    checking for crypt_r() ... found
    checking for sys/vfs.h ... 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 sched_setaffinity() ... found
    checking for SO_SETFIB ... not found
    checking for SO_REUSEPORT ... found
    checking for SO_ACCEPTFILTER ... not found
    checking for SO_BINDANY ... not found
    checking for IP_TRANSPARENT ... found
    checking for IP_BINDANY ... not found
    checking for IP_BIND_ADDRESS_NO_PORT ... not found
    checking for IP_RECVDSTADDR ... not found
    checking for IP_SENDSRCADDR ... not found
    checking for IP_PKTINFO ... found
    checking for IPV6_RECVPKTINFO ... found
    checking for TCP_DEFER_ACCEPT ... found
    checking for TCP_KEEPIDLE ... found
    checking for TCP_FASTOPEN ... not found
    checking for TCP_INFO ... found
    checking for accept4() ... found
    checking for eventfd() ... 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 uint32_t ... found
    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 AF_INET6 ... found
    checking for setproctitle() ... not found
    checking for pread() ... found
    checking for pwrite() ... found
    checking for pwritev() ... found
    checking for sys_nerr ... found
    checking for localtime_r() ... found
    checking for clock_gettime(CLOCK_MONOTONIC) ... not found
    checking for clock_gettime(CLOCK_MONOTONIC) in librt ... 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 sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
    checking for openat(), fstatat() ... found
    checking for getaddrinfo() ... found
    checking for PCRE library ... found
    checking for PCRE JIT support ... found
    checking for OpenSSL library ... not found
    checking for OpenSSL library in /usr/local/ ... not found
    checking for OpenSSL library in /usr/pkg/ ... not found
    checking for OpenSSL library in /opt/local/ ... not found
如下是經典錯誤,提示須要安裝ssl

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.

--------------------------------------------------

[root@CentOS-A-server nginx-1.14.0]#

解決辦法:安裝ssl包
[root@CentOS-A-server nginx-1.14.0]# yum -y install openssl*
已加載插件:fastestmirror, security
設置安裝進程
Loading mirror speeds from cached hostfile

  • base: mirrors.163.com
  • extras: mirrors.cn99.com
  • updates: mirrors.aliyun.com
    解決依賴關係
    --> 執行事務檢查
    ---> Package openssl.x86_64 0:1.0.1e-42.el6 will be 升級
    ---> Package openssl.x86_64 0:1.0.1e-57.el6 will be an update
    ---> Package openssl-devel.x86_64 0:1.0.1e-57.el6 will be 安裝
    --> 處理依賴關係 krb5-devel,它被軟件包 openssl-devel-1.0.1e-57.el6.x86_64 須要
    ---> Package openssl-perl.x86_64 0:1.0.1e-57.el6 will be 安裝
    --> 處理依賴關係 perl(WWW::Curl::Easy),它被軟件包 openssl-perl-1.0.1e-57.el6.x86_64 須要
    ---> Package openssl-static.x86_64 0:1.0.1e-57.el6 will be 安裝
    ---> Package openssl098e.x86_64 0:0.9.8e-20.el6.centos.1 will be 安裝
    --> 執行事務檢查
    ---> Package krb5-devel.x86_64 0:1.10.3-65.el6 will be 安裝
    --> 處理依賴關係 libkadm5(x86-64) = 1.10.3-65.el6,它被軟件包 krb5-devel-1.10.3-65.el6.x86_64 須要
    --> 處理依賴關係 krb5-libs = 1.10.3-65.el6,它被軟件包 krb5-devel-1.10.3-65.el6.x86_64 須要
    --> 處理依賴關係 libselinux-devel,它被軟件包 krb5-devel-1.10.3-65.el6.x86_64 須要
    --> 處理依賴關係 libcom_err-devel,它被軟件包 krb5-devel-1.10.3-65.el6.x86_64 須要
    --> 處理依賴關係 keyutils-libs-devel,它被軟件包 krb5-devel-1.10.3-65.el6.x86_64 須要
    ---> Package perl-WWW-Curl.x86_64 0:4.09-4.el6 will be 安裝
    --> 執行事務檢查
    ---> Package keyutils-libs-devel.x86_64 0:1.4-5.el6 will be 安裝
    ---> Package krb5-libs.x86_64 0:1.10.3-42.el6 will be 升級
    --> 處理依賴關係 krb5-libs = 1.10.3-42.el6,它被軟件包 krb5-workstation-1.10.3-42.el6.x86_64 須要
    ---> Package krb5-libs.x86_64 0:1.10.3-65.el6 will be an update
    ---> Package libcom_err-devel.x86_64 0:1.41.12-24.el6 will be 安裝
    --> 處理依賴關係 libcom_err = 1.41.12-24.el6,它被軟件包 libcom_err-devel-1.41.12-24.el6.x86_64 須要
    ---> Package libkadm5.x86_64 0:1.10.3-65.el6 will be 安裝
    ---> Package libselinux-devel.x86_64 0:2.0.94-7.el6 will be 安裝
    --> 處理依賴關係 libselinux = 2.0.94-7.el6,它被軟件包 libselinux-devel-2.0.94-7.el6.x86_64 須要
    --> 處理依賴關係 libsepol-devel >= 2.0.32-1,它被軟件包 libselinux-devel-2.0.94-7.el6.x86_64 須要
    --> 處理依賴關係 pkgconfig(libsepol),它被軟件包 libselinux-devel-2.0.94-7.el6.x86_64 須要
    --> 執行事務檢查
    ---> Package krb5-workstation.x86_64 0:1.10.3-42.el6 will be 升級
    ---> Package krb5-workstation.x86_64 0:1.10.3-65.el6 will be an update
    ---> Package libcom_err.x86_64 0:1.41.12-22.el6 will be 升級
    --> 處理依賴關係 libcom_err = 1.41.12-22.el6,它被軟件包 libss-1.41.12-22.el6.x86_64 須要
    --> 處理依賴關係 libcom_err = 1.41.12-22.el6,它被軟件包 e2fsprogs-libs-1.41.12-22.el6.x86_64 須要
    --> 處理依賴關係 libcom_err = 1.41.12-22.el6,它被軟件包 e2fsprogs-1.41.12-22.el6.x86_64 須要
    ---> Package libcom_err.x86_64 0:1.41.12-24.el6 will be an update
    ---> Package libselinux.x86_64 0:2.0.94-5.8.el6 will be 升級
    --> 處理依賴關係 libselinux = 2.0.94-5.8.el6,它被軟件包 libselinux-utils-2.0.94-5.8.el6.x86_64 須要
    ---> Package libselinux.x86_64 0:2.0.94-7.el6 will be an update
    ---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be 安裝
    --> 執行事務檢查
    ---> Package e2fsprogs.x86_64 0:1.41.12-22.el6 will be 升級
    ---> Package e2fsprogs.x86_64 0:1.41.12-24.el6 will be an update
    ---> Package e2fsprogs-libs.x86_64 0:1.41.12-22.el6 will be 升級
    ---> Package e2fsprogs-libs.x86_64 0:1.41.12-24.el6 will be an update
    ---> Package libselinux-utils.x86_64 0:2.0.94-5.8.el6 will be 升級
    ---> Package libselinux-utils.x86_64 0:2.0.94-7.el6 will be an update
    ---> Package libss.x86_64 0:1.41.12-22.el6 will be 升級
    ---> Package libss.x86_64 0:1.41.12-24.el6 will be an update
    --> 完成依賴關係計算

依賴關係解決

============================================================================================================================
軟件包 架構 版本 倉庫 大小

正在安裝:
openssl-devel x86_64 1.0.1e-57.el6 base 1.2 M
openssl-perl x86_64 1.0.1e-57.el6 base 57 k
openssl-static x86_64 1.0.1e-57.el6 base 1.0 M
openssl098e x86_64 0.9.8e-20.el6.centos.1 base 762 k
正在升級:
openssl x86_64 1.0.1e-57.el6 base 1.5 M
爲依賴而安裝:
keyutils-libs-devel x86_64 1.4-5.el6 base 29 k
krb5-devel x86_64 1.10.3-65.el6 base 504 k
libcom_err-devel x86_64 1.41.12-24.el6 base 33 k
libkadm5 x86_64 1.10.3-65.el6 base 143 k
libselinux-devel x86_64 2.0.94-7.el6 base 137 k
libsepol-devel x86_64 2.0.41-4.el6 base 64 k
perl-WWW-Curl x86_64 4.09-4.el6 base 47 k
爲依賴而更新:
e2fsprogs x86_64 1.41.12-24.el6 base 554 k
e2fsprogs-libs x86_64 1.41.12-24.el6 base 121 k
krb5-libs x86_64 1.10.3-65.el6 base 675 k
krb5-workstation x86_64 1.10.3-65.el6 base 814 k
libcom_err x86_64 1.41.12-24.el6 base 38 k
libselinux x86_64 2.0.94-7.el6 base 109 k
libselinux-utils x86_64 2.0.94-7.el6 base 82 k
libss x86_64 1.41.12-24.el6 base 42 k

事務概要
Install 11 Package(s)
Upgrade 9 Package(s)

總下載量:7.8 M
下載軟件包:
(1/20): e2fsprogs-1.41.12-24.el6.x86_64.rpm | 554 kB 00:00
(2/20): e2fsprogs-libs-1.41.12-24.el6.x86_64.rpm | 121 kB 00:00
(3/20): keyutils-libs-devel-1.4-5.el6.x86_64.rpm | 29 kB 00:00
(4/20): krb5-devel-1.10.3-65.el6.x86_64.rpm | 504 kB 00:00
(5/20): krb5-libs-1.10.3-65.el6.x86_64.rpm | 675 kB 00:00
(6/20): krb5-workstation-1.10.3-65.el6.x86_64.rpm | 814 kB 00:01
(7/20): libcom_err-1.41.12-24.el6.x86_64.rpm | 38 kB 00:00
(8/20): libcom_err-devel-1.41.12-24.el6.x86_64.rpm | 33 kB 00:00
(9/20): libkadm5-1.10.3-65.el6.x86_64.rpm | 143 kB 00:00
(10/20): libselinux-2.0.94-7.el6.x86_64.rpm | 109 kB 00:00
(11/20): libselinux-devel-2.0.94-7.el6.x86_64.rpm | 137 kB 00:00
(12/20): libselinux-utils-2.0.94-7.el6.x86_64.rpm | 82 kB 00:00
(13/20): libsepol-devel-2.0.41-4.el6.x86_64.rpm | 64 kB 00:00
(14/20): libss-1.41.12-24.el6.x86_64.rpm | 42 kB 00:00
(15/20): openssl-1.0.1e-57.el6.x86_64.rpm | 1.5 MB 00:00
http://mirrors.163.com/centos/6.10/os/x86_64/Packages/openssl-devel-1.0.1e-57.el6.x86_64.rpm: [Errno 12] Timeout on http://211.162.61.205/files/5081000004654E86/mirrors.163.com/centos/6/os/x86_64/Packages/openssl-devel-1.0.1e-57.el6.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
嘗試其餘鏡像。
(16/20): openssl-devel-1.0.1e-57.el6.x86_64.rpm | 1.2 MB 00:01
(17/20): openssl-perl-1.0.1e-57.el6.x86_64.rpm | 57 kB 00:00
(18/20): openssl-static-1.0.1e-57.el6.x86_64.rpm | 1.0 MB 00:01
(19/20): openssl098e-0.9.8e-20.el6.centos.1.x86_64.rpm | 762 kB 00:00
(20/20): perl-WWW-Curl-4.09-4.el6.x86_64.rpm | 47 kB 00:00

總計 65 kB/s | 7.8 MB 02:03
運行 rpm_check_debug
執行事務測試
事務測試成功
執行事務
正在升級 : libcom_err-1.41.12-24.el6.x86_64 1/29
正在升級 : libselinux-2.0.94-7.el6.x86_64 2/29
正在升級 : krb5-libs-1.10.3-65.el6.x86_64 3/29
正在升級 : openssl-1.0.1e-57.el6.x86_64 4/29
正在安裝 : libkadm5-1.10.3-65.el6.x86_64 5/29
正在升級 : libss-1.41.12-24.el6.x86_64 6/29
正在安裝 : libcom_err-devel-1.41.12-24.el6.x86_64 7/29
正在升級 : e2fsprogs-libs-1.41.12-24.el6.x86_64 8/29
正在安裝 : libsepol-devel-2.0.41-4.el6.x86_64 9/29
正在安裝 : libselinux-devel-2.0.94-7.el6.x86_64 10/29
正在安裝 : keyutils-libs-devel-1.4-5.el6.x86_64 11/29
正在安裝 : krb5-devel-1.10.3-65.el6.x86_64 12/29
正在安裝 : openssl-devel-1.0.1e-57.el6.x86_64 13/29
正在安裝 : perl-WWW-Curl-4.09-4.el6.x86_64 14/29
正在安裝 : openssl-perl-1.0.1e-57.el6.x86_64 15/29
正在安裝 : openssl-static-1.0.1e-57.el6.x86_64 16/29
正在升級 : e2fsprogs-1.41.12-24.el6.x86_64 17/29
正在升級 : krb5-workstation-1.10.3-65.el6.x86_64 18/29
正在安裝 : openssl098e-0.9.8e-20.el6.centos.1.x86_64 19/29
正在升級 : libselinux-utils-2.0.94-7.el6.x86_64 20/29
清理 : krb5-workstation-1.10.3-42.el6.x86_64 21/29
清理 : e2fsprogs-1.41.12-22.el6.x86_64 22/29
清理 : openssl-1.0.1e-42.el6.x86_64 23/29
清理 : krb5-libs-1.10.3-42.el6.x86_64 24/29
清理 : e2fsprogs-libs-1.41.12-22.el6.x86_64 25/29
清理 : libss-1.41.12-22.el6.x86_64 26/29
清理 : libselinux-utils-2.0.94-5.8.el6.x86_64 27/29
清理 : libselinux-2.0.94-5.8.el6.x86_64 28/29
清理 : libcom_err-1.41.12-22.el6.x86_64 29/29
Verifying : perl-WWW-Curl-4.09-4.el6.x86_64 1/29
Verifying : krb5-devel-1.10.3-65.el6.x86_64 2/29
Verifying : openssl-perl-1.0.1e-57.el6.x86_64 3/29
Verifying : krb5-libs-1.10.3-65.el6.x86_64 4/29
Verifying : krb5-workstation-1.10.3-65.el6.x86_64 5/29
Verifying : libcom_err-devel-1.41.12-24.el6.x86_64 6/29
Verifying : keyutils-libs-devel-1.4-5.el6.x86_64 7/29
Verifying : openssl098e-0.9.8e-20.el6.centos.1.x86_64 8/29
Verifying : libss-1.41.12-24.el6.x86_64 9/29
Verifying : openssl-devel-1.0.1e-57.el6.x86_64 10/29
Verifying : e2fsprogs-libs-1.41.12-24.el6.x86_64 11/29
Verifying : libcom_err-1.41.12-24.el6.x86_64 12/29
Verifying : libsepol-devel-2.0.41-4.el6.x86_64 13/29
Verifying : libselinux-utils-2.0.94-7.el6.x86_64 14/29
Verifying : openssl-1.0.1e-57.el6.x86_64 15/29
Verifying : libkadm5-1.10.3-65.el6.x86_64 16/29
Verifying : libselinux-2.0.94-7.el6.x86_64 17/29
Verifying : libselinux-devel-2.0.94-7.el6.x86_64 18/29
Verifying : openssl-static-1.0.1e-57.el6.x86_64 19/29
Verifying : e2fsprogs-1.41.12-24.el6.x86_64 20/29
Verifying : libss-1.41.12-22.el6.x86_64 21/29
Verifying : libselinux-utils-2.0.94-5.8.el6.x86_64 22/29
Verifying : openssl-1.0.1e-42.el6.x86_64 23/29
Verifying : e2fsprogs-1.41.12-22.el6.x86_64 24/29
Verifying : krb5-libs-1.10.3-42.el6.x86_64 25/29
Verifying : krb5-workstation-1.10.3-42.el6.x86_64 26/29
Verifying : libselinux-2.0.94-5.8.el6.x86_64 27/29
Verifying : libcom_err-1.41.12-22.el6.x86_64 28/29
Verifying : e2fsprogs-libs-1.41.12-22.el6.x86_64 29/29

已安裝:
openssl-devel.x86_64 0:1.0.1e-57.el6 openssl-perl.x86_64 0:1.0.1e-57.el6 openssl-static.x86_64 0:1.0.1e-57.el6
openssl098e.x86_64 0:0.9.8e-20.el6.centos.1

做爲依賴被安裝:
keyutils-libs-devel.x86_64 0:1.4-5.el6 krb5-devel.x86_64 0:1.10.3-65.el6 libcom_err-devel.x86_64 0:1.41.12-24.el6
libkadm5.x86_64 0:1.10.3-65.el6 libselinux-devel.x86_64 0:2.0.94-7.el6 libsepol-devel.x86_64 0:2.0.41-4.el6
perl-WWW-Curl.x86_64 0:4.09-4.el6

更新完畢:
openssl.x86_64 0:1.0.1e-57.el6

做爲依賴被升級:
e2fsprogs.x86_64 0:1.41.12-24.el6 e2fsprogs-libs.x86_64 0:1.41.12-24.el6 krb5-libs.x86_64 0:1.10.3-65.el6
krb5-workstation.x86_64 0:1.10.3-65.el6 libcom_err.x86_64 0:1.41.12-24.el6 libselinux.x86_64 0:2.0.94-7.el6
libselinux-utils.x86_64 0:2.0.94-7.el6 libss.x86_64 0:1.41.12-24.el6

完畢!
[root@CentOS-A-server nginx-1.14.0]#
[root@CentOS-A-server nginx-1.14.0]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.14.0 --with-http_stub_status_module --with-http_ssl_module
checking for OS

  • Linux 2.6.32-573.el6.x86_64 x86_64
    checking for C compiler ... found
  • using GNU C compiler
  • gcc version: 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
    checking for gcc -pipe switch ... found
    checking for -Wl,-E switch ... found
    checking for gcc builtin atomic operations ... found
    checking for C99 variadic macros ... found
    checking for gcc variadic macros ... found
    checking for gcc builtin 64 bit byteswap ... 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 EPOLLEXCLUSIVE ... not found
    checking for O_PATH ... not found
    checking for sendfile() ... found
    checking for sendfile64() ... found
    checking for sys/prctl.h ... found
    checking for prctl(PR_SET_DUMPABLE) ... found
    checking for prctl(PR_SET_KEEPCAPS) ... found
    checking for capabilities ... found
    checking for crypt_r() ... found
    checking for sys/vfs.h ... 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 sched_setaffinity() ... found
    checking for SO_SETFIB ... not found
    checking for SO_REUSEPORT ... found
    checking for SO_ACCEPTFILTER ... not found
    checking for SO_BINDANY ... not found
    checking for IP_TRANSPARENT ... found
    checking for IP_BINDANY ... not found
    checking for IP_BIND_ADDRESS_NO_PORT ... not found
    checking for IP_RECVDSTADDR ... not found
    checking for IP_SENDSRCADDR ... not found
    checking for IP_PKTINFO ... found
    checking for IPV6_RECVPKTINFO ... found
    checking for TCP_DEFER_ACCEPT ... found
    checking for TCP_KEEPIDLE ... found
    checking for TCP_FASTOPEN ... not found
    checking for TCP_INFO ... found
    checking for accept4() ... found
    checking for eventfd() ... 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 uint32_t ... found
    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 AF_INET6 ... found
    checking for setproctitle() ... not found
    checking for pread() ... found
    checking for pwrite() ... found
    checking for pwritev() ... found
    checking for sys_nerr ... found
    checking for localtime_r() ... found
    checking for clock_gettime(CLOCK_MONOTONIC) ... not found
    checking for clock_gettime(CLOCK_MONOTONIC) in librt ... 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 sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
    checking for openat(), fstatat() ... found
    checking for getaddrinfo() ... found
    checking for PCRE library ... found
    checking for PCRE JIT support ... found
    checking for OpenSSL library ... found
    checking for zlib library ... found
    creating objs/Makefile

Configuration summary

  • using system PCRE library
  • using system OpenSSL library
  • using system zlib library

    nginx path prefix: "/application/nginx-1.14.0"
    nginx binary file: "/application/nginx-1.14.0/sbin/nginx"
    nginx modules path: "/application/nginx-1.14.0/modules"
    nginx configuration prefix: "/application/nginx-1.14.0/conf"
    nginx configuration file: "/application/nginx-1.14.0/conf/nginx.conf"
    nginx pid file: "/application/nginx-1.14.0/logs/nginx.pid"
    nginx error log file: "/application/nginx-1.14.0/logs/error.log"
    nginx http access log file: "/application/nginx-1.14.0/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"

[root@CentOS-A-server nginx-1.14.0]# echo $?
0
[root@CentOS-A-server nginx-1.14.0]# make && make install
[root@CentOS-A-server nginx]# find / -name nginx-1.14.0 #查找安裝的nginx-1.14.0
/root/nginx/nginx-1.14.0
/application/nginx-1.14.0 #安裝完成的nginx-1.14.0
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# ln -s /application/nginx-1.14.0/ /application/nginx #製做軟連接
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# ll /application/
總用量 4
lrwxrwxrwx. 1 root root 26 7月 25 03:59 nginx -> /application/nginx-1.14.0/ #已製做完成的連接
drwxr-xr-x. 6 root root 4096 7月 25 03:48 nginx-1.14.0
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# ll /application/nginx/
總用量 16
drwxr-xr-x. 2 root root 4096 7月 25 03:48 conf
drwxr-xr-x. 2 root root 4096 7月 25 03:48 html
drwxr-xr-x. 2 root root 4096 7月 25 03:48 logs
drwxr-xr-x. 2 root root 4096 7月 25 03:48 sbin
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# /application/nginx/sbin/nginx -t #「-t」檢查語法
/application/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# find / -name libpcre.so.1 #查找libpcre.so.1文件
/usr/local/lib/libpcre.so.1
/root/nginx/pcre-8.40/.libs/libpcre.so.1
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# vi /etc/ld.so.conf #編輯庫文件,將/usr/local/lib/加到庫文件裏
[root@CentOS-A-server nginx]# cat /etc/ld.so.conf
include ld.so.conf.d/.conf
/usr/local/lib/
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# ldconfig #讓庫修改生效
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# /application/nginx/sbin/nginx -t #再次檢查語法
nginx: the configuration file /application/nginx-1.14.0/conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.14.0/conf/nginx.conf test is successful
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# /application/nginx/sbin/nginx #啓動nginx服務
[root@CentOS-A-server nginx]# lsof -i tcp:80 #查看nginx端口是否啓動
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 16711 root 6u IPv4 64414 0t0 TCP
:http (LISTEN)
nginx 16712 nginx 6u IPv4 64414 0t0 TCP *:http (LISTEN)
[root@CentOS-A-server nginx]#
[root@CentOS-A-server nginx]# service iptables stop #關閉防火牆
iptables:將鏈設置爲政策 ACCEPT:filter [肯定]
iptables:清除防火牆規則: [肯定]
iptables:正在卸載模塊: [肯定]
[root@CentOS-A-server nginx]#

在瀏覽器輸入服務端IP地址
Nginx程序部署及啓動**

相關文章
相關標籤/搜索