zoukankan      html  css  js  c++  java
  • RHEL 7 安装 ngnix

    安装ngnix

    yum install -y make apr* autoconf automake curl curl-devel gcc gcc-c++ gtk+-devel zlib-devel pcre-devel

    wget http://nginx.org/download/nginx-1.7.2.tar.gz

    cd nginx-1.7.2

    ./configure --prefix=/usr/local/nginx

    make && make install

    启动 /usr/local/nginx/sbin/nginx

    停止 /usr/local/nginx/sbin/nginx -s stop

    记得开防火墙80。

    出问题看下面内容:

     ./configure: error: the HTTP rewrite module requires the PCRE library解决

        有时候,我们需要单独安装nginx,来处理大量的下载请求。

        安装nginx遇到的rewrite和HTTP cache错误解决办法:

        ./configure --prefix=/usr/local/nginx

        安装Nginx时报错

        ./configure: error: the HTTP rewrite module requires the PCRE library.

        安装pcre-devel解决问题

        yum -y install pcre-devel

        错误提示:./configure: error: the HTTP cache module requires md5 functions

        from OpenSSL library. You can either disable the module by using

        --without-http-cache option, or install the OpenSSL library into the system,

        or build the OpenSSL library statically from the source with nginx by using

        --with-http_ssl_module --with-openssl= options.

        解决办法:

        yum -y install openssl openssl-devel

        总结:

        yum -y install pcre-devel openssl openssl-devel

        ./configure --prefix=/usr/local/nginx

        make

        make install

    配置PHP-FPM/fast-cgi  

    yum -y install libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel openldap-devel mysql-devel libtool-ltdl-devel

    wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz

    tar zxvf libiconv-1.13.1.tar.gz

    cd  libiconv-1.13.1

    ./configure
    make && make install

    wget http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

    tar zxvf libmcrypt-2.5.8.tar.gz
    cd libmcrypt-2.5.8/
    ./configure
    make && make install
    /sbin/ldconfig

    wget
    http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.
    9.9.tar.gz
    tar zxvf mhash-0.9.9.9.tar.gz
    cd mhash-0.9.9.9/
    ./configure
    make
    make install
    cd ../

    ln -s /usr/local/lib/libmcrypt.* /usr/lib/ (是否为rpm 包安装)
    ln -s /usr/local/lib/libmhash.* /usr/lib/ (是否为rpm 包安装)

    http://nchc.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
    tar zxvf mcrypt-2.6.8.tar.gz
    cd mcrypt-2.6.8/
    /sbin/ldconfig
    ./configure
    make
    make install
    cd ../

    wget http://cn2.php.net/distributions/php-5.5.13.tar.gz
    cd php-5.5.13

    ./configure --with-mysql --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysql --with-mysqli=/usr/bin/mysql_config --with-iconv=/usr/local --with-freetype-dir --with-jpeg-dir
    --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --
    enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --
    enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pdo-mysql --without-pear --enable-fastcgi --enable-force-cgi-redirect --enable-fpm

    make && make install

  • 相关阅读:
    合并二叉树
    剑指 Offer 68
    剑指 Offer 42. 连续子数组的最大和
    C语言 递归实现迷宫寻路问题
    C语言数据结构 统计英文文字每个“单词”出现次数
    C语言 双链表的频度排序管理
    C语言 插入排序使链表递增
    c语言 简单的天数计算器
    数据结构 链表的头插法逆置
    C语言 删除指定的单词
  • 原文地址:https://www.cnblogs.com/jjp816/p/4436452.html
Copyright © 2011-2022 走看看