iptables有80端口打开,但nmap显示它closures

我有一些麻烦得到一个Debiannetworking服务器打开端口80的HTTPstream量。 在我的iptables中,我使用以下命令打开了端口80:

iptables -A INPUT -p tcp --dport 80 -j ACCEPT iptables -A INPUT -p udp --dport 80 -j ACCEPT 

运行一个iptables -L,然后显示以下规则:

 Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere anywhere udp dpt:www ACCEPT tcp -- anywhere anywhere tcp dpt:www Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination 

但是,毕竟,我运行nmap -sS 127.0.0.1,发现端口80 仍然没有打开。 结果如下:

 Nmap scan report for localhost (127.0.0.1) Host is up (0.0000080s latency). Not shown: 995 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 111/tcp open rpcbind 3306/tcp open mysql 8080/tcp open http-proxy 

怎样才能在iptables中打开一个端口的规则,但仍然有相同的端口在Nmap中closures? 有没有人有任何想法?

netstat -lnp | grep 80的输出 netstat -lnp | grep 80 ,似乎你的apache服务器正在监听端口8080而不是默认的80。

另外,该行:

 8080/tcp open http-proxy 

从nmap输出证实了这一事实。

总之,80端口不是在你的机器上打开,因为Apache正在监听8080。