yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
2.下载nginxwget -c https://nginx.org/download/nginx-1.19.0.tar.gz
3.解压缩tar -zxvf nginx-1.19.0.tar.gz
4.进入解压后目录cd nginx-1.19.0/
5.编译 带 http_ssl_module 参数./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_sub_module --with-http_gzip_static_module --with-pcre
6.安装make && make install
7.开机启动vim /etc/systemd/system/nginx.service
[Unit] Description=nginx After=network.target [Service] Type=forking ExecStart=/usr/local/nginx/sbin/nginx ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/usr/local/nginx/sbin/nginx -s quit PrivateTmp=true [Install] WantedBy=multi-user.target8.执行指令
chmod +x /etc/systemd/system/nginx.service systemctl enable nginx.service
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)