想搭個服務器,但外面訪問不到,是防火墻的原因,把端口設置一下就行。
1.在/etc/sysconfig/iptables里添加
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT2.重啟iptables
[root@localhost ~]# /etc/init.d/iptables restart3.看下狀態
[root@localhost ~]# /etc/init.d/iptables status