How does CentOS VPS open port 80

  
                

If you are using a cloud server, the website will not open, so most of the vps port 80 is not open or blocked, so how does CentOS open vps 80 port? Need to open through the firewall, the specific with the small series to understand it.

CentOS firewall to open port 80

# /sbin /iptables -I INPUT -p tcp --dport 80 -j ACCEPT

# /sbin /iptables - I INPUT -p tcp --dport 22 -j ACCEPT

Then save:

#/etc/rc.d/init.d/iptables save

Note that you need to restart Service: Execute service iptabels save and service iptables restart

Port View Method:

vhost]# /etc/init.d/iptables status

Table: filter

Chain INPUT (policy ACCEPT)

num target prot opt ​​source destination

1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

Chain FORWARD (policy ACCEPT)

num target prot opt ​​source destination

Chain OUTPUT (policy ACCEPT)

num target prot opt ​​source destination

The above is the CentOS system vps open 80 port method introduced, many people do not know after opening port 80 View, this article also describes a method vps view port 80.

Copyright © Windows knowledge All Rights Reserved