centos nginx

前端之家收集整理的这篇文章主要介绍了centos nginx前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.下载  http://Nginx.org/en/download.html

2.解压   tar -zxvf xxxx.tar.gz

3.安装依赖

yum install gcc-c++

yum install pcre-devel

yum install zlib-devel

4.安装

./configure --prefix=/opt/Nginx  --with-http_ssl_module

or

 sudo ./configure --prefix=/opt/Nginx  --with-openssl=/usr/bin/openssl

sudo make

sudo make install

5.服务

sudo vim /usr/lib/systemd/system/Nginx.service[Unit]Description=The Nginx HTTP and reverse proxy serverAfter=network.target remote-fs.target nss-lookup.target[Service]Type=forkingPIDFile=/opt/Nginx/logs/Nginx.pidExecStartPre=/usr/bin/rm -f /opt/Nginx/logs/Nginx.pidExecStartPre=/opt/Nginx/sbin/Nginx -tExecStart=/opt/Nginx/sbin/NginxExecReload=/bin/kill -s HUP $MAINPIDKillSignal=SIGQUITTimeoutStopSec=5KillMode=processPrivateTmp=true[Install]WantedBy=multi-user.target

猜你在找的CentOS相关文章