Centos7 yum 安装Nginx:
1.添加Nginx Repository
1 |
yum install epel-release |
2.安装Nginx
1 |
yum install nginx |
3.启动Nginx服务:
1 |
systemctl start nginx |
如果开着防火墙,请运行如下命令:
1 2 3 |
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload |
4.访问IP地址:
1 |
http://IP/ |
如果能看到此页面则说明nginx运作正常!
5.开机自动启动Nginx
1 |
systemctl enable nginx |