这是防火墙配置
[root@VM_104_85_centos ~]# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Tue Jan 3 10:30:26 2017
*filter
:INPUT ACCEPT [4:304]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [4:496]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibit
-A FORWARD -j REJECT --reject-with icmp-host-prohibit
COMMIT
# Completed on Tue Jan 3 10:30:26 2017
[root@VM_104_85_centos ~]#
查看防火墙开的端口,80已经不在了
[root@VM_104_85_centos ~]# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 863/vsftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 849/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 949/master
tcp 0 64 10.141.104.85:22 182.97.56.107:45288 ESTABLISHED 1215/sshd
tcp 0 0 10.141.104.85:48392 10.53.192.11:9988 ESTABLISHED 1038/secu-tcs-agent
Active UNIX domain sockets (servers and established)
3 个解决方案
#1
确认你的nginx服务已经启动了?ps查看一下
”nginx配置成功之后,无法用服务器的ip地址访问怎么办“
你做虚拟domain了?可以telnet IP 80,看看端口是否有响应
”nginx配置成功之后,无法用服务器的ip地址访问怎么办“
你做虚拟domain了?可以telnet IP 80,看看端口是否有响应
#2
开了
[root@VM_104_85_centos sbin]# ps aux | grep nginx
root 1294 0.0 0.0 24312 800 ? Ss 16:07 0:00 nginx: master process ./nginx
nobody 1295 0.0 0.1 24740 1392 ? S 16:07 0:00 nginx: worker process
root 1365 0.0 0.0 6384 700 pts/0 S+ 16:08 0:00 grep nginx
[root@VM_104_85_centos sbin]#
没有,我用的是云服务器,也需要配置虚拟?不知道为何,即使关闭防火墙还是无法访问
#3
还有selinux
https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/
https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/
#1
确认你的nginx服务已经启动了?ps查看一下
”nginx配置成功之后,无法用服务器的ip地址访问怎么办“
你做虚拟domain了?可以telnet IP 80,看看端口是否有响应
”nginx配置成功之后,无法用服务器的ip地址访问怎么办“
你做虚拟domain了?可以telnet IP 80,看看端口是否有响应
#2
开了
[root@VM_104_85_centos sbin]# ps aux | grep nginx
root 1294 0.0 0.0 24312 800 ? Ss 16:07 0:00 nginx: master process ./nginx
nobody 1295 0.0 0.1 24740 1392 ? S 16:07 0:00 nginx: worker process
root 1365 0.0 0.0 6384 700 pts/0 S+ 16:08 0:00 grep nginx
[root@VM_104_85_centos sbin]#
没有,我用的是云服务器,也需要配置虚拟?不知道为何,即使关闭防火墙还是无法访问
#3
还有selinux
https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/
https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/