CENTOS7安装NGINX

mac2022-06-30  284

CENTOS7安装NGINX

1)安装所需环境

yum install gcc-c++

yum install -y pcre pcre-devel

yum install -y zlib zlib-devel

yum install -y openssl openssl-devel

2)官网下载NGINX

浏览器打开:https://nginx.org/en/download.html

查看最新的稳定版本号

wget -c https://nginx.org/download/nginx-1.6.1.tar.gz

解压 :

tar -zxvf nginx-1.16.1.tar.gzcd nginx-1.16.1

3)编译安装

./configure

makemake install

4)NIGNX启动、停止命令

cd /usr/local/nginx/sbin/./nginx ./nginx -s stop./nginx -s quit./nginx -s reload

5)检查是否成功

6)设置开机自启动

vi /etc/rc.local

增加一行 /usr/local/nginx/sbin/nginx设置执行权限:

chmod 755 /etc/rc.local

转载于:https://www.cnblogs.com/hnxxcxg/p/11399566.html


最新回复(0)