zoukankan      html  css  js  c++  java
  • Centos6.5(Linux)安装Nginx

    1、安装nginx依赖的库pcre
          下载地址:http://sourceforge.net/projects/pcre/
       
    2、解压pcre 
          zip解压方式:unzip pcre-xxx
          tar解压方式:tar -xzvf pcre-xxx
       
    3、执行configure
          cd  prce-xxx
          ./configure 
          假设执行出错:You need a C++ compiler for C++ support
          则须要安装C++编译环境:yum install -y gcc gcc-c++
       
    4、安装和编译prce
          make && make install 
     
     
    5、解压nginx
          tar -xzvf nginx-xxx
       
    6、执行configure
          cd  nginx-xxx
          ./configure 
         假设执行出错:./configure: error: the HTTP gzip module requires the zlib library.
    You can either disable the module by using --without-http_gzip_module
    option, or install the zlib library into the system, or build the zlib library
    statically from the source with nginx by using --with-zlib=<path> option.
       则须要安装zlib库:yum install zlib-devel
       
    7、安装nginx
          make && make install


       
    8、启动nginx
          /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
          启动出错:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
        
       解决的方法:ldd /usr/local/nginx/sbin/nginx    =====>查看链接库是否正常
       
        linux-vdso.so.1 =>  (0x00007fff1e3ff000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ea5800000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000003eb0400000)
    libpcre.so.1 => not found
    libz.so.1 => /lib64/libz.so.1 (0x0000003ea6800000)
    libc.so.6 => /lib64/libc.so.6 (0x0000003ea5000000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003ea4c00000)
    libfreebl3.so => /lib64/libfreebl3.so (0x0000003eb1000000)
    libdl.so.2 => /lib64/libdl.so.2 (0x0000003ea5400000)

    9、ln -s libpcre.so.0.0.1 libpcre.so.1




    10、再次启动nginx 

            ./usr/local/nginx/sbin/nginx

    11、ps -ef | grep nginx

           查看nginx是否启动成功




    2. 安装Pcre
    • wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
    • tar -xzvf pcre-8.41.tar.gz
    • cd pcre-8.41
    • ./configure
    • make && make install

    3. 安装openssl

    4. 安装zlib
    5.安装ngxin




    错误解决方式:
    1. You need a C++ compiler for C++ support.
    yum install -y gcc gcc-c++

  • 相关阅读:
    全面分析C#方法中的ref和out
    SQL注入漏洞全接触入门篇
    如何使用四个语句来提高 SQL Server 的伸缩性
    5种提高SQL性能的方法
    SQL注入漏洞全接触高级篇
    网络游戏程序员须知 收包与发包
    SQL注入攻击的原理及其防范措施
    SQL注入漏洞全接触进阶篇
    C#委托的故事
    转眼又快一年了,最近没赚钱,在学习FLASH as3编程
  • 原文地址:https://www.cnblogs.com/mqxnongmin/p/10622792.html
Copyright © 2011-2022 走看看