zoukankan      html  css  js  c++  java
  • nginx安装-源码编译

    官方文档:http://nginx.org/en/docs/configure.html

    参考:http://jingyan.baidu.com/article/e2284b2b45f693e2e6118de5.html

    升级参考:http://urchin.blog.51cto.com/4356076/988860/  

             http://www.cnblogs.com/terrysun/archive/2012/11/22/2782472.html

    编译源码需要的组件

    1.zlib  http://www.zlib.net/

    2.pcre http://www.pcre.org/            正则表达式

    3.openssl  http://www.openssl.org/  可选

    4.nginx     http://nginx.org/en/download.html

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

    1.编译zlib (version 1.1.3 — 1.2.8)

    mkdir /usr/src/zlib 
    cd /usr/src/zlib
    wget  http://zlib.net/zlib-1.2.8.tar.gz
    tar xvf zlib-1.2.8.tar.gz

    cd /usr/src/zlib/zlib-1.2.8
    ./configure --static --prefix=/usr/src/zlib/zlib-1.2.8 make make install

    2.编译openssl 

     直接使用apt-get进行安装 
    sudo apt-get install openssl
    sudo apt-get install libssl-dev

    3.编译pcre (version 4.4 — 8.38)

    mkdir /usr/src/pcre
    wget  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
    tar xvf pcre2-8.38.tar.gz
    /configure --prefix=/usr/src/pcre/pcre-8.38

    make install

    4.编译ngnix

    复制代码
    mkdir /usr/src/nginx
    cd /usr/src/nginx
    wget http://nginx.org/download/nginx-1.9.14.tar.gz
    tar xvf nginx-1.9.14.tar.gz
    mv nginx-1.9.14 nginx
    ./configure --prefix=/usr/local/nginx/  --conf-path=/usr/local/nginx/nginx.conf --sbin-path=/usr/local/nginx/sbin/nginx --with-debug --with-openssl=/usr/src/openssl/openssl-1.0.2g --with-zlib=/usr/src/zlib/zlib-1.2.8 --with-pcre=/usr/src/pcre/pcre-8.38 --with-http_stub_status_module --with-http_gzip_static_module 
      
    make install
    复制代码

    生成的nginx在/usr/local/nginx/sbin下

    ./nginx -v 检测是否安装成功
    ./nginx 启动
    在地址栏输入: http://localhost 如果看到以下效果,说明正确安装了

  • 相关阅读:
    时间复杂度和空间复杂度的故事
    Go -- 并发编程的两种限速方法
    Go -- type 和断言 interface{}转换
    Go -- 实现二叉搜索树
    Go语言程序的状态监控
    Go -- 中开启gctrace
    Go --- GC优化经验
    Mysql 性能优化20个原则(4)
    Mysql 性能优化20个原则(3)
    查看 activex 组件的方法
  • 原文地址:https://www.cnblogs.com/zjxbetter/p/5387485.html
Copyright © 2011-2022 走看看