zoukankan      html  css  js  c++  java
  • Linux下nginx安装与配置

    • 部分Linux发布版的默认安装已经集成了nginx,查看方法ls /usr/local,若已有nginx文件夹说明已集成。
    • nginx依赖库pcre与zlib,且pcre依赖于gcc与gcc-c++,因此安装步骤为:
    1. 安装gcc与gcc-c++库
    2. 安装pcre库
    3. 安装zlib库
    4. 安装nginx
    • 详细安装过程

        1. 安装gcc与gcc-c++

    yum install gcc gcc-c++

        2. 安装pcre库

        官方下载地址:http://sourceforge.net/projects/pcre/files/

    unzip pcre-8.36.zip
    ./configure
    make
    make install

        3. 安装zlib库

        官网:http://www.zlib.net/,首页即有下载链接。

    tar -zxvf zlib-1.2.8.tar.gz
    ./configure
    make
    make install

        4. 安装nginx

        官方下载地址:http://nginx.org/en/download.html

    tar -zxvf nginx-1.8.0.tar.gz
    ./configure
    make
    make install

        5. 启动nginx

    cd /usr/local/nginx/sbin
    ./nginx

    看到如下界面则表示安装成功:

       

    备注:若启动时提示

    ./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

        是因为未给动态链接库创建链接,执行如下命令即可

    32位系统  ln -s /usr/local/lib/libpcre.so.1 /lib
    64位系统  ln -s /usr/local/lib/libpcre.so.1 /lib64
  • 相关阅读:
    8.17 纯css画一个着重号图标
    8.16 val()和html()的问题
    8.14 git??sourceTree??
    7.27-8.10 Problems
    To be a better me
    【LeetCode刷题】Set and bitset
    【LeetCode刷题】求平方根
    【LeetCode刷题】爬楼梯问题
    大学四年就这样,么了~
    硬件综合实习——51单片机四则运算带括号计算器
  • 原文地址:https://www.cnblogs.com/juzii/p/4536238.html
Copyright © 2011-2022 走看看