炼数成金_Tomcat第二课作业

学号:70017

作业内容:编译安装Nginx

1、安装谷歌性能分析的工具gperftools

# 安装依赖 gcc gcc-c++

[root@localhost src]# yum -y install gcc gcc-c++
已安装:
  gcc.x86_64 0:4.4.7-17.el6                                                              gcc-c++.x86_64 0:4.4.7-17.el6                                                             

作为依赖被安装:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6                  cpp.x86_64 0:4.4.7-17.el6            glibc-devel.x86_64 0:2.12-1.192.el6          glibc-headers.x86_64 0:2.12-1.192.el6       
  kernel-headers.x86_64 0:2.6.32-642.15.1.el6        libgomp.x86_64 0:4.4.7-17.el6        libstdc++-devel.x86_64 0:4.4.7-17.el6        mpfr.x86_64 0:2.4.1-6.el6                   
  ppl.x86_64 0:0.10.2-11.el6                        

完毕

# 解压缩gperftools

[root@localhost src]# ls
gperftools-2.4.tar.gz  nginx-1.6.3.tar.gz  nginx的扩展模块
[root@localhost src]# tar xf gperftools-2.4.tar.gz 
[root@localhost src]# cd gperftools-2.4
[root@localhost gperftools-2.4]# ls
aclocal.m4  ChangeLog  config.guess  configure     COPYING  doc             INSTALL     libtool    m4           Makefile.in  NEWS      README              src          TODO
AUTHORS     compile    config.sub    configure.ac  depcomp  gperftools.sln  install-sh  ltmain.sh  Makefile.am  missing      packages  README_windows.txt  test-driver  vsprojects
[root@localhost gperftools-2.4]#

# 编译安装gperftools

[root@localhost gperftools-2.4]# ./configure --prefix=/usr/local --enable-frame-pointers
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
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 to enable maintainer-specific portions of Makefiles... no
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 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 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 how to run the C preprocessor... gcc -E
checking for objcopy... objcopy
checking if objcopy supports -W... no
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
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 whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for 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 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 for inline... inline
checking for __attribute__... yes
checking for ANSI C header files... (cached) yes
checking for __int64... no
checking for struct mallinfo... yes
checking for Elf32_Versym... yes
checking for sbrk... yes
checking for geteuid... yes
checking for fork... yes
checking features.h usability... yes
checking features.h presence... yes
checking for features.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking sys/malloc.h usability... no
checking sys/malloc.h presence... no
checking for sys/malloc.h... no
checking malloc/malloc.h usability... no
checking malloc/malloc.h presence... no
checking for malloc/malloc.h... no
checking glob.h usability... yes
checking glob.h presence... yes
checking for glob.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking unwind.h usability... yes
checking unwind.h presence... yes
checking for unwind.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking conflict-signal.h usability... no
checking conflict-signal.h presence... no
checking for conflict-signal.h... no
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking linux/ptrace.h usability... yes
checking linux/ptrace.h presence... yes
checking for linux/ptrace.h... yes
checking sys/syscall.h usability... yes
checking sys/syscall.h presence... yes
checking for sys/syscall.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking valgrind.h usability... no
checking valgrind.h presence... no
checking for valgrind.h... no
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking for features.h... (cached) yes
checking whether cfree is declared... yes
checking whether posix_memalign is declared... yes
checking whether memalign is declared... yes
checking whether valloc is declared... yes
checking whether pvalloc is declared... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking if int32_t is the same type as intptr_t... no
checking ucontext.h usability... yes
checking ucontext.h presence... yes
checking for ucontext.h... yes
checking sys/ucontext.h usability... yes
checking sys/ucontext.h presence... yes
checking for sys/ucontext.h... yes
checking cygwin/signal.h usability... no
checking cygwin/signal.h presence... no
checking for cygwin/signal.h... no
checking how to access the program counter from a struct ucontext... uc_mcontext.gregs[REG_RIP]
checking libunwind.h usability... no
checking libunwind.h presence... no
checking for libunwind.h... no
checking for backtrace in -lunwind... no
checking for backtrace in -lexecinfo... no
checking for x86 without frame pointers... yes
checking if the compiler supports -Wno-unused-result... yes
checking printf format code for printing a size_t and ssize_t... l
checking for __builtin_stack_pointer()... no
checking for __builtin_expect()... yes
checking for __environ... yes
checking for __thread... yes
checking if __malloc_hook is declared volatile... no
checking if nanosleep requires any libraries... no
checking whether uname is declared... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to check for GCC pthread/shared inconsistencies... yes
checking whether -pthread is sufficient with -shared... yes
checking whether what we have so far is sufficient with -nostdlib... no
checking whether -lpthread saves the day... yes
checking whether pthread symbols are available in C++ without including pthread.h... no
checking whether the compiler implements namespaces... yes
checking what namespace STL code is in... std
checking for program_invocation_name... yes
checking for Linux SIGEV_THREAD_ID... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/gperftools/tcmalloc.h
config.status: creating src/windows/gperftools/tcmalloc.h
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
[root@localhost gperftools-2.4]#
./configure
[root@localhost gperftools-2.4]# make && make install
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src  -I./src   -DNO_TCMALLOC_SAMPLES -pthread -DNDEBUG -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -fno-builtin-calloc -fno-builtin-cfree -fno-builtin-memalign -fno-builtin-posix_memalign -fno-builtin-valloc -fno-builtin-pvalloc  -Wno-unused-result -fno-omit-frame-pointer  -g -O2 -MT src/libtcmalloc_minimal_la-tcmalloc.lo -MD -MP -MF src/.deps/libtcmalloc_minimal_la-tcmalloc.Tpo -c -o src/libtcmalloc_minimal_la-tcmalloc.lo `test -f 'src/tcmalloc.cc' || echo './'`src/tcmalloc.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -pthread -DNDEBUG -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -fno-builtin-calloc -fno-builtin-cfree -fno-builtin-memalign -fno-builtin-posix_memalign -fno-builtin-valloc -fno-builtin-pvalloc -Wno-unused-result -fno-omit-frame-pointer -g -O2 -MT src/libtcmalloc_minimal_la-tcmalloc.lo -MD -MP -MF src/.deps/libtcmalloc_minimal_la-tcmalloc.Tpo -c src/tcmalloc.cc  -fPIC -DPIC -o src/.libs/libtcmalloc_minimal_la-tcmalloc.o
......省略........
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/bin'
 /usr/bin/install -c src/pprof '/usr/local/bin'
for la in libtcmalloc_minimal.la libtcmalloc_minimal_debug.la libtcmalloc.la libtcmalloc_debug.la libtcmalloc_and_profiler.la; do lib=".libs/`basename $la .la`.a"; [ ! -f "$lib" ] || : "$lib"; done
 /bin/mkdir -p '/usr/local/share/doc/gperftools-2.4'
 /usr/bin/install -c -m 644 AUTHORS COPYING ChangeLog INSTALL NEWS README README_windows.txt TODO doc/index.html doc/designstyle.css doc/pprof_remote_servers.html doc/tcmalloc.html doc/overview.gif doc/pageheap.gif doc/spanmap.gif doc/threadheap.gif doc/t-test1.times.txt doc/tcmalloc-opspercpusec.vs.threads.1024.bytes.png doc/tcmalloc-opspercpusec.vs.threads.128.bytes.png doc/tcmalloc-opspercpusec.vs.threads.131072.bytes.png doc/tcmalloc-opspercpusec.vs.threads.16384.bytes.png doc/tcmalloc-opspercpusec.vs.threads.2048.bytes.png doc/tcmalloc-opspercpusec.vs.threads.256.bytes.png doc/tcmalloc-opspercpusec.vs.threads.32768.bytes.png doc/tcmalloc-opspercpusec.vs.threads.4096.bytes.png doc/tcmalloc-opspercpusec.vs.threads.512.bytes.png doc/tcmalloc-opspercpusec.vs.threads.64.bytes.png doc/tcmalloc-opspercpusec.vs.threads.65536.bytes.png doc/tcmalloc-opspercpusec.vs.threads.8192.bytes.png doc/tcmalloc-opspersec.vs.size.1.threads.png doc/tcmalloc-opspersec.vs.size.12.threads.png doc/tcmalloc-opspersec.vs.size.16.threads.png doc/tcmalloc-opspersec.vs.size.2.threads.png doc/tcmalloc-opspersec.vs.size.20.threads.png doc/tcmalloc-opspersec.vs.size.3.threads.png doc/tcmalloc-opspersec.vs.size.4.threads.png doc/tcmalloc-opspersec.vs.size.5.threads.png doc/tcmalloc-opspersec.vs.size.8.threads.png doc/overview.dot doc/pageheap.dot '/usr/local/share/doc/gperftools-2.4'
 /usr/bin/install -c -m 644 doc/spanmap.dot doc/threadheap.dot doc/heapprofile.html doc/heap-example1.png doc/heap_checker.html doc/cpuprofile.html doc/cpuprofile-fileformat.html doc/pprof-test-big.gif doc/pprof-test.gif doc/pprof-vsnprintf-big.gif doc/pprof-vsnprintf.gif '/usr/local/share/doc/gperftools-2.4'
 /bin/mkdir -p '/usr/local/include/google'
 /usr/bin/install -c -m 644 src/google/heap-checker.h src/google/heap-profiler.h src/google/malloc_extension.h src/google/malloc_extension_c.h src/google/malloc_hook.h src/google/malloc_hook_c.h src/google/profiler.h src/google/stacktrace.h src/google/tcmalloc.h '/usr/local/include/google'
 /bin/mkdir -p '/usr/local/share/man/man1'
 /usr/bin/install -c -m 644 doc/pprof.1 '/usr/local/share/man/man1'
 /bin/mkdir -p '/usr/local/include/gperftools'
 /usr/bin/install -c -m 644 src/gperftools/tcmalloc.h '/usr/local/include/gperftools'
 /bin/mkdir -p '/usr/local/include/gperftools'
 /usr/bin/install -c -m 644 src/gperftools/stacktrace.h src/gperftools/malloc_hook.h src/gperftools/malloc_hook_c.h src/gperftools/malloc_extension.h src/gperftools/malloc_extension_c.h src/gperftools/heap-profiler.h src/gperftools/heap-checker.h src/gperftools/profiler.h '/usr/local/include/gperftools'
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 libtcmalloc.pc libtcmalloc_minimal.pc libtcmalloc_debug.pc libtcmalloc_minimal_debug.pc libprofiler.pc '/usr/local/lib/pkgconfig'
make[1]: Leaving directory `/usr/local/src/gperftools-2.4'
[root@localhost gperftools-2.4]# echo $?
[root@localhost sbin]# cd /usr/local/bin/
[root@localhost bin]# ls
pprof
[root@localhost bin]# cd /usr/local/include/
[root@localhost include]# ls
google  gperftools
[root@localhost include]# cd /usr/local/lib
[root@localhost lib]# ls
libprofiler.a         libtcmalloc_and_profiler.a         libtcmalloc_debug.la        libtcmalloc_minimal_debug.a         libtcmalloc_minimal.so        pkgconfig
libprofiler.la        libtcmalloc_and_profiler.la        libtcmalloc_debug.so        libtcmalloc_minimal_debug.la        libtcmalloc_minimal.so.4
libprofiler.so        libtcmalloc_and_profiler.so        libtcmalloc_debug.so.4      libtcmalloc_minimal_debug.so        libtcmalloc_minimal.so.4.2.6
libprofiler.so.0      libtcmalloc_and_profiler.so.4      libtcmalloc_debug.so.4.2.6  libtcmalloc_minimal_debug.so.4      libtcmalloc.so
libprofiler.so.0.4.5  libtcmalloc_and_profiler.so.4.2.6  libtcmalloc.la              libtcmalloc_minimal_debug.so.4.2.6  libtcmalloc.so.4
libtcmalloc.a         libtcmalloc_debug.a
make && make install

2、安装Nginx-1.6.3

# 解压缩并加入nginx-http-concat模块

[root@localhost src]# ls
gperftools-2.4  gperftools-2.4.tar.gz  nginx-1.6.3.tar.gz  nginx的扩展模块
[root@localhost src]# tar xf nginx-1.6.3.tar.gz
[root@localhost src]# ls
gperftools-2.4  gperftools-2.4.tar.gz  nginx-1.6.3  nginx-1.6.3.tar.gz  nginx的扩展模块
[root@localhost src]# cp -r nginx的扩展模块/nginx-http-concat nginx-1.6.3/
[root@localhost src]# cd nginx-1.6.3
[root@localhost nginx-1.6.3]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  nginx-http-concat  README  src

# 编译安装Nginx

[root@localhost nginx-1.6.3]# yum -y install pcre pcre-devel openssl openssl-devel
已加载插件:fastestmirror
设置安装进程
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
包 pcre-7.8-7.el6.x86_64 已安装并且是最新版本
包 openssl-1.0.1e-48.el6_8.4.x86_64 已安装并且是最新版本
解决依赖关系
--> 执行事务检查
---> Package openssl-devel.x86_64 0:1.0.1e-48.el6_8.4 will be 安装
--> 处理依赖关系 zlib-devel,它被软件包 openssl-devel-1.0.1e-48.el6_8.4.x86_64 需要
--> 处理依赖关系 krb5-devel,它被软件包 openssl-devel-1.0.1e-48.el6_8.4.x86_64 需要
---> Package pcre-devel.x86_64 0:7.8-7.el6 will be 安装
--> 执行事务检查
---> Package krb5-devel.x86_64 0:1.10.3-57.el6 will be 安装
--> 处理依赖关系 libselinux-devel,它被软件包 krb5-devel-1.10.3-57.el6.x86_64 需要
--> 处理依赖关系 libcom_err-devel,它被软件包 krb5-devel-1.10.3-57.el6.x86_64 需要
--> 处理依赖关系 keyutils-libs-devel,它被软件包 krb5-devel-1.10.3-57.el6.x86_64 需要
---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be 安装
--> 执行事务检查
---> Package keyutils-libs-devel.x86_64 0:1.4-5.el6 will be 安装
---> Package libcom_err-devel.x86_64 0:1.41.12-22.el6 will be 安装
---> Package libselinux-devel.x86_64 0:2.0.94-7.el6 will be 安装
--> 处理依赖关系 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 libsepol-devel.x86_64 0:2.0.41-4.el6 will be 安装
--> 完成依赖关系计算

依赖关系解决

====================================================================================================================================================================================
 软件包                                            架构                                 版本                                            仓库                                   大小
====================================================================================================================================================================================
正在安装:
 openssl-devel                                     x86_64                               1.0.1e-48.el6_8.4                               updates                               1.2 M
 pcre-devel                                        x86_64                               7.8-7.el6                                       base                                  320 k
为依赖而安装:
 keyutils-libs-devel                               x86_64                               1.4-5.el6                                       base                                   29 k
 krb5-devel                                        x86_64                               1.10.3-57.el6                                   base                                  504 k
 libcom_err-devel                                  x86_64                               1.41.12-22.el6                                  base                                   33 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
 zlib-devel                                        x86_64                               1.2.3-29.el6                                    base                                   44 k

事务概要
====================================================================================================================================================================================
Install       8 Package(s)

总下载量:2.3 M
Installed size: 5.9 M
下载软件包:
(1/8): keyutils-libs-devel-1.4-5.el6.x86_64.rpm                                                                                                              |  29 kB     00:00     
(2/8): krb5-devel-1.10.3-57.el6.x86_64.rpm                                                                                                                   | 504 kB     00:00     
(3/8): libcom_err-devel-1.41.12-22.el6.x86_64.rpm                                                                                                            |  33 kB     00:00     
(4/8): libselinux-devel-2.0.94-7.el6.x86_64.rpm                                                                                                              | 137 kB     00:00     
(5/8): libsepol-devel-2.0.41-4.el6.x86_64.rpm                                                                                                                |  64 kB     00:00     
(6/8): openssl-devel-1.0.1e-48.el6_8.4.x86_64.rpm                                                                                                            | 1.2 MB     00:01     
(7/8): pcre-devel-7.8-7.el6.x86_64.rpm                                                                                                                       | 320 kB     00:00     
(8/8): zlib-devel-1.2.3-29.el6.x86_64.rpm                                                                                                                    |  44 kB     00:00     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                                1.3 MB/s | 2.3 MB     00:01     
运行 rpm_check_debug 
执行事务测试
事务测试成功
执行事务
  正在安装   : zlib-devel-1.2.3-29.el6.x86_64                                                                                                                                   1/8 
  正在安装   : libcom_err-devel-1.41.12-22.el6.x86_64                                                                                                                           2/8 
  正在安装   : libsepol-devel-2.0.41-4.el6.x86_64                                                                                                                               3/8 
  正在安装   : libselinux-devel-2.0.94-7.el6.x86_64                                                                                                                             4/8 
  正在安装   : keyutils-libs-devel-1.4-5.el6.x86_64                                                                                                                             5/8 
  正在安装   : krb5-devel-1.10.3-57.el6.x86_64                                                                                                                                  6/8 
  正在安装   : openssl-devel-1.0.1e-48.el6_8.4.x86_64                                                                                                                           7/8 
  正在安装   : pcre-devel-7.8-7.el6.x86_64                                                                                                                                      8/8 
  Verifying  : keyutils-libs-devel-1.4-5.el6.x86_64                                                                                                                             1/8 
  Verifying  : libsepol-devel-2.0.41-4.el6.x86_64                                                                                                                               2/8 
  Verifying  : libcom_err-devel-1.41.12-22.el6.x86_64                                                                                                                           3/8 
  Verifying  : openssl-devel-1.0.1e-48.el6_8.4.x86_64                                                                                                                           4/8 
  Verifying  : libselinux-devel-2.0.94-7.el6.x86_64                                                                                                                             5/8 
  Verifying  : zlib-devel-1.2.3-29.el6.x86_64                                                                                                                                   6/8 
  Verifying  : krb5-devel-1.10.3-57.el6.x86_64                                                                                                                                  7/8 
  Verifying  : pcre-devel-7.8-7.el6.x86_64                                                                                                                                      8/8 

已安装:
  openssl-devel.x86_64 0:1.0.1e-48.el6_8.4                                                       pcre-devel.x86_64 0:7.8-7.el6                                                      

作为依赖被安装:
  keyutils-libs-devel.x86_64 0:1.4-5.el6       krb5-devel.x86_64 0:1.10.3-57.el6       libcom_err-devel.x86_64 0:1.41.12-22.el6       libselinux-devel.x86_64 0:2.0.94-7.el6      
  libsepol-devel.x86_64 0:2.0.41-4.el6         zlib-devel.x86_64 0:1.2.3-29.el6       

完毕!
安装依赖
# 创建nginx用户组
[root@localhost nginx-1.6.3]# groupadd -r nginx
[root@localhost nginx-1.6.3]# useradd -g nginx -r -M -s /sbin/nologin nginx

[root@localhost nginx-1.6.3]# ./configure \
> --prefix=/usr/local/nginx/1.6.3 \
> --user=nginx \
> --group=nginx \
> --http-log-path=/log/access.log \
> --error-log-path=/log/error.log \
> --with-http_ssl_module \
> --with-http_stub_status_module \
> --with-http_gzip_static_module \
> --add-module=nginx-http-concat \
> --with-google_perftools_module
checking for OS
 + Linux 2.6.32-642.15.1.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-17) (GCC) 
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for O_PATH ... 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 sched_setaffinity() ... 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 SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... not found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in nginx-http-concat
 + ngx_http_concat_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... not found
checking for OpenSSL library ... found
checking for zlib library ... found
checking for Google perftools ... found
creating objs/Makefile

Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx/1.6.3"
  nginx binary file: "/usr/local/nginx/1.6.3/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx/1.6.3/conf"
  nginx configuration file: "/usr/local/nginx/1.6.3/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/1.6.3/logs/nginx.pid"
  nginx error log file: "/log/error.log"
  nginx http access log file: "/log/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"
预编译./configure
[root@localhost nginx-1.6.3]# make && install
make -f objs/Makefile
make[1]: Entering directory `/usr/local/src/nginx-1.6.3'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
        -o objs/src/core/nginx.o \
        src/core/nginx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
        -o objs/src/core/ngx_log.o \
        src/core/ngx_log.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
        -o objs/src/core/ngx_palloc.o \
        src/core/ngx_palloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
        -o objs/src/core/ngx_array.o \
        src/core/ngx_array.c
......省略......
cc -o objs/nginx \
    objs/src/core/nginx.o \
    objs/src/core/ngx_log.o \
    objs/src/core/ngx_palloc.o \
    objs/src/core/ngx_array.o \
    objs/src/core/ngx_list.o \
    objs/src/core/ngx_hash.o \
    objs/src/core/ngx_buf.o \
    objs/src/core/ngx_queue.o \
    objs/src/core/ngx_output_chain.o \
    objs/src/core/ngx_string.o \
    objs/src/core/ngx_parse.o \
    objs/src/core/ngx_inet.o \
    objs/src/core/ngx_file.o \
    objs/src/core/ngx_crc32.o \
    objs/src/core/ngx_murmurhash.o \
    objs/src/core/ngx_md5.o \
    objs/src/core/ngx_rbtree.o \
    objs/src/core/ngx_radix_tree.o \
    objs/src/core/ngx_slab.o \
    objs/src/core/ngx_times.o \
    objs/src/core/ngx_shmtx.o \
    objs/src/core/ngx_connection.o \
    objs/src/core/ngx_cycle.o \
    objs/src/core/ngx_spinlock.o \
    objs/src/core/ngx_cpuinfo.o \
    objs/src/core/ngx_conf_file.o \
    objs/src/core/ngx_resolver.o \
    objs/src/core/ngx_open_file_cache.o \
    objs/src/core/ngx_crypt.o \
    objs/src/core/ngx_proxy_protocol.o \
    objs/src/event/ngx_event.o \
    objs/src/event/ngx_event_timer.o \
    objs/src/event/ngx_event_posted.o \
    objs/src/event/ngx_event_busy_lock.o \
    objs/src/event/ngx_event_accept.o \
    objs/src/event/ngx_event_connect.o \
    objs/src/event/ngx_event_pipe.o \
    objs/src/os/unix/ngx_time.o \
    objs/src/os/unix/ngx_errno.o \
    objs/src/os/unix/ngx_alloc.o \
    objs/src/os/unix/ngx_files.o \
    objs/src/os/unix/ngx_socket.o \
    objs/src/os/unix/ngx_recv.o \
    objs/src/os/unix/ngx_readv_chain.o \
    objs/src/os/unix/ngx_udp_recv.o \
    objs/src/os/unix/ngx_send.o \
    objs/src/os/unix/ngx_writev_chain.o \
    objs/src/os/unix/ngx_channel.o \
    objs/src/os/unix/ngx_shmem.o \
    objs/src/os/unix/ngx_process.o \
    objs/src/os/unix/ngx_daemon.o \
    objs/src/os/unix/ngx_setaffinity.o \
    objs/src/os/unix/ngx_setproctitle.o \
    objs/src/os/unix/ngx_posix_init.o \
    objs/src/os/unix/ngx_user.o \
    objs/src/os/unix/ngx_process_cycle.o \
    objs/src/os/unix/ngx_linux_init.o \
    objs/src/event/modules/ngx_epoll_module.o \
    objs/src/os/unix/ngx_linux_sendfile_chain.o \
    objs/src/event/ngx_event_openssl.o \
    objs/src/event/ngx_event_openssl_stapling.o \
    objs/src/core/ngx_regex.o \
    objs/src/http/ngx_http.o \
    objs/src/http/ngx_http_core_module.o \
    objs/src/http/ngx_http_special_response.o \
    objs/src/http/ngx_http_request.o \
    objs/src/http/ngx_http_parse.o \
    objs/src/http/ngx_http_header_filter_module.o \
    objs/src/http/ngx_http_write_filter_module.o \
    objs/src/http/ngx_http_copy_filter_module.o \
    objs/src/http/modules/ngx_http_log_module.o \
    objs/src/http/ngx_http_request_body.o \
    objs/src/http/ngx_http_variables.o \
    objs/src/http/ngx_http_script.o \
    objs/src/http/ngx_http_upstream.o \
    objs/src/http/ngx_http_upstream_round_robin.o \
    objs/src/http/ngx_http_parse_time.o \
    objs/src/http/modules/ngx_http_static_module.o \
    objs/src/http/modules/ngx_http_index_module.o \
    objs/src/http/modules/ngx_http_chunked_filter_module.o \
    objs/src/http/modules/ngx_http_range_filter_module.o \
    objs/src/http/modules/ngx_http_headers_filter_module.o \
    objs/src/http/modules/ngx_http_not_modified_filter_module.o \
    objs/src/http/ngx_http_busy_lock.o \
    objs/src/http/ngx_http_file_cache.o \
    objs/src/http/modules/ngx_http_gzip_filter_module.o \
    objs/src/http/ngx_http_postpone_filter_module.o \
    objs/src/http/modules/ngx_http_ssi_filter_module.o \
    objs/src/http/modules/ngx_http_charset_filter_module.o \
    objs/src/http/modules/ngx_http_userid_filter_module.o \
    objs/src/http/modules/ngx_http_gzip_static_module.o \
    objs/src/http/modules/ngx_http_autoindex_module.o \
    objs/src/http/modules/ngx_http_auth_basic_module.o \
    objs/src/http/modules/ngx_http_access_module.o \
    objs/src/http/modules/ngx_http_limit_conn_module.o \
    objs/src/http/modules/ngx_http_limit_req_module.o \
    objs/src/http/modules/ngx_http_geo_module.o \
    objs/src/http/modules/ngx_http_map_module.o \
    objs/src/http/modules/ngx_http_split_clients_module.o \
    objs/src/http/modules/ngx_http_referer_module.o \
    objs/src/http/modules/ngx_http_rewrite_module.o \
    objs/src/http/modules/ngx_http_ssl_module.o \
    objs/src/http/modules/ngx_http_proxy_module.o \
    objs/src/http/modules/ngx_http_fastcgi_module.o \
    objs/src/http/modules/ngx_http_uwsgi_module.o \
    objs/src/http/modules/ngx_http_scgi_module.o \
    objs/src/http/modules/ngx_http_memcached_module.o \
    objs/src/http/modules/ngx_http_empty_gif_module.o \
    objs/src/http/modules/ngx_http_browser_module.o \
    objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
    objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
    objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
    objs/src/http/modules/ngx_http_stub_status_module.o \
    objs/src/misc/ngx_google_perftools_module.o \
    objs/addon/nginx-http-concat/ngx_http_concat_module.o \
    objs/ngx_modules.o \
    -lpthread -lcrypt -lpcre -lssl -lcrypto -ldl -lz -lprofiler
make[1]: Leaving directory `/usr/local/src/nginx-1.6.3'
make -f objs/Makefile manpage
make[1]: Entering directory `/usr/local/src/nginx-1.6.3'
sed -e "s|%%PREFIX%%|/usr/local/nginx/1.6.3|" \
        -e "s|%%PID_PATH%%|/usr/local/nginx/1.6.3/logs/nginx.pid|" \
        -e "s|%%CONF_PATH%%|/usr/local/nginx/1.6.3/conf/nginx.conf|" \
        -e "s|%%ERROR_LOG_PATH%%|/log/error.log|" \
        < man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/usr/local/src/nginx-1.6.3'
make -f objs/Makefile install
make[1]: Entering directory `/usr/local/src/nginx-1.6.3'
test -d '/usr/local/nginx/1.6.3' || mkdir -p '/usr/local/nginx/1.6.3'
test -d '/usr/local/nginx/1.6.3/sbin'         || mkdir -p '/usr/local/nginx/1.6.3/sbin'
test ! -f '/usr/local/nginx/1.6.3/sbin/nginx'         || mv '/usr/local/nginx/1.6.3/sbin/nginx'             '/usr/local/nginx/1.6.3/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx/1.6.3/sbin/nginx'
test -d '/usr/local/nginx/1.6.3/conf'         || mkdir -p '/usr/local/nginx/1.6.3/conf'
cp conf/koi-win '/usr/local/nginx/1.6.3/conf'
cp conf/koi-utf '/usr/local/nginx/1.6.3/conf'
cp conf/win-utf '/usr/local/nginx/1.6.3/conf'
test -f '/usr/local/nginx/1.6.3/conf/mime.types'         || cp conf/mime.types '/usr/local/nginx/1.6.3/conf'
cp conf/mime.types '/usr/local/nginx/1.6.3/conf/mime.types.default'
test -f '/usr/local/nginx/1.6.3/conf/fastcgi_params'         || cp conf/fastcgi_params '/usr/local/nginx/1.6.3/conf'
cp conf/fastcgi_params         '/usr/local/nginx/1.6.3/conf/fastcgi_params.default'
test -f '/usr/local/nginx/1.6.3/conf/fastcgi.conf'         || cp conf/fastcgi.conf '/usr/local/nginx/1.6.3/conf'
cp conf/fastcgi.conf '/usr/local/nginx/1.6.3/conf/fastcgi.conf.default'
test -f '/usr/local/nginx/1.6.3/conf/uwsgi_params'         || cp conf/uwsgi_params '/usr/local/nginx/1.6.3/conf'
cp conf/uwsgi_params         '/usr/local/nginx/1.6.3/conf/uwsgi_params.default'
test -f '/usr/local/nginx/1.6.3/conf/scgi_params'         || cp conf/scgi_params '/usr/local/nginx/1.6.3/conf'
cp conf/scgi_params         '/usr/local/nginx/1.6.3/conf/scgi_params.default'
test -f '/usr/local/nginx/1.6.3/conf/nginx.conf'         || cp conf/nginx.conf '/usr/local/nginx/1.6.3/conf/nginx.conf'
cp conf/nginx.conf '/usr/local/nginx/1.6.3/conf/nginx.conf.default'
test -d '/usr/local/nginx/1.6.3/logs'         || mkdir -p '/usr/local/nginx/1.6.3/logs'
test -d '/log' ||         mkdir -p '/log'
test -d '/usr/local/nginx/1.6.3/html'         || cp -R html '/usr/local/nginx/1.6.3'
test -d '/log' ||         mkdir -p '/log'
make[1]: Leaving directory `/usr/local/src/nginx-1.6.3'
make && make install

# 加入gperftools库文件

[root@localhost sbin]# cat /etc/ld.so.conf.d/gperftools.conf
/usr/local/lib
[root@localhost sbin]# ldconfig 
[root@localhost sbin]# /usr/local/nginx/1.6.3/sbin/nginx 
[root@localhost sbin]# netstat -lnpt |grep nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      3617/nginx
[root@localhost sbin]# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:0C:29:20:27:55  
          inet addr:192.168.1.235  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe20:2755/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:59399 errors:0 dropped:0 overruns:0 frame:0
          TX packets:953 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3840144 (3.6 MiB)  TX bytes:141390 (138.0 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

# 网页验证

posted @ 2017-03-20 13:47  牵丝木偶  阅读(114)  评论(0)    收藏  举报