美文网首页
编译安装Nginx

编译安装Nginx

作者: 凤凤思密达萌萌哒 | 来源:发表于2020-05-07 09:32 被阅读0次

    1、停止原有的web服务器
    2、编译安装
    安装依赖包

    # yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd-devel
    

    添加用户

    # useradd nginx
    

    解压编译

    # tar xvzf nginx-1.17.10.tar
    # cd nginx-1.17.10
    # ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
    # make && make install
    

    启动

    # /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    

    查看启动状态

    # ps aux | grep nginx
    # netstat -lntp | grep 80
    

    3、浏览主页是否可以访问

    links 127.0.0.1 //如果显示Welcome to nginx!则说明服务正常

    相关文章

      网友评论

          本文标题:编译安装Nginx

          本文链接:https://www.haomeiwen.com/subject/whkoghtx.html