服务部署到服务器后,无法访问,首先关闭防火墙,命令:
1:查看防火状态
systemctl status firewalld
service iptables status
2:暂时关闭防火墙
systemctl stop firewalld
service iptables stop
3:永久关闭防火墙
systemctl disable firewalld
chkconfig iptables off
4:重启防火墙
systemctl enable firewalld
service iptables restart
5:永久关闭后重启
//暂时还没有试过
chkconfig iptables on
2.下载安装nginx
原文链接:http://www.cnblogs.com/zhensha/p/10994704.html
1.安装
设置安装源(最新稳定版):
vi /etc/yum.repos.d/nginx.repo
在nginx.repo编辑写入以下内容并保存
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
安装:
yum install -y nginx
2.启动nginx
systemctl start nginx
3.重启nginx
systemctl restart nginx
4.设置nginx开机自启动
systemctl enable nginx
5.修改配置文件(修改配置文件后需要重启)
vi /etc/nginx/nginx.conf