1.安装依赖包
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2.下载并解压安装包
//创建一个文件夹
cd /usr/local
mkdir nginx
cd nginx
//下载tar包
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
3.安装nginx
//进入nginx目录
cd /usr/local/nginx
//进入目录
cd nginx-1.13.7
//执行命令
./configure
//执行make命令
make
//执行make install命令
make install
4.查看开放的端口号
firewall-cmd --list-all
5.设置开放的端口号80
firewall-cmd --add-service=http –permanent
sudo firewall-cmd --add-port=80/tcp --permanent
6.重启防火墙
firewall-cmd –reload