Os 7 源码安装nginx

    技术2024-06-29  68

    下载源码包:

    [root@localhost ~]# wget http://nginx.org/download/nginx-1.12.2.tar.gz

    安装依赖包:

    [root@localhost ~]# yum -y install gcc gcc-c++ pcre-devel zlib-devel

    解压安装nginx:

    [root@localhost ~]# tar zxf nginx-1.12.2.tar.gz [root@localhost ~]# cd nginx-1.12.2 [root@localhost nginx-1.12.2]# ./configure [root@localhost nginx-1.12.2]# make && make install

    开启nginx:

    [root@localhost nginx-1.12.2]# /usr/local/nginx/sbin/nginx

    测试:

    [root@localhost ~]# curl 192.168.136.251
    Processed: 0.012, SQL: 9