**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 $PATHapi
[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:
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
./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
依赖关系解决
============================================================================================================================
软件包 架构 版本 仓库 大小
正在安装:
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
Configuration summary
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地址**