Centos7源码部署Nginx-1.17.10

1. 下载tar并解压
useradd nginx
mkdir -pv /var/tmp/nginx/{client,proxy,fcgi,uwsgi,scgi}

tar xf nginx-1.17.10.tar -C /opt
ln -s /opt/nginx-1.17.10 /opt/nginx

报错解析:
yum -y install openssl openssl-devel
yum install -y pcre-devel

  1. cd nginx
    编译配置:
./configure --prefix=/usr/local/nginx --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre --with-file-aio --with-http_secure_link_module --with-stream

make && make install

  1. 为了方便ln -s /usr/local/nginx/sbin/nginx /usr/sbin/nginx在这里插入图片描述
    成功!!!
  2. 设置开机自启动
    vim /etc/rc.d/rc.local
    Centos7源码部署Nginx-1.17.10_第1张图片
    chmod +x /etc/rc.d/rc.local

你可能感兴趣的:(nginx,linux)