linux 下安装 Niginx

    技术2022-07-11  109

    一、安装 Nignix

    安装 gcc 和 gcc-c++

    yum install -y gcc yum install -y gcc-c++

    安装 pcre 库

    cd /opt wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz tar -zxvf pcre-8.33.tar.gz cd pcre-8.33 ./configure make && make install

    安装SSL库

    cd /opt wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1j.tar.gz tar -zxvf openssl-1.0.1j.tar.gz cd openssl-1.0.1j ./config make && make install

    安装zlib库

    cd /opt wget http://zlib.net/zlib-1.2.11.tar.gz tar -zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure make && make install

    安装nginx(本安装为1.8.0版本)

    cd /opt wget http://nginx.org/download/nginx-1.8.0.tar.gz tar -zxvf nginx-1.8.0.tar.gz cd nginx-1.8.0

    二、Nginx 操作命令

    进入 nginx 目录

    cd /usr/local/nginx/sbin

    启动nginx服务

    ./nginx

    停止nginx服务

    ./nginx –s stop

    重启nginx服务

    ./nginx –s reload

    强制关闭nginx服务

    pkill nginx
    Processed: 0.019, SQL: 10