我设置了默认配置的Web服务器。现在,我不能仅使本机和server1.example.com访问此Web服务器。
# chkconfig httpd on
# service httpd start
echo “This is a test.? > /var/www/html/index.html
# iptables -I INPUT -m state –state NEW -m tcp port 80 -j ACCEPT
我的脚本出了点问题。
最佳答案
您在脚本中错过了tcp和-dport:
# iptables -I INPUT -m state –state NEW -m tcp port 80 -j ACCEPT
您需要尝试以下操作:
# iptables -I INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
关于linux - 如何使此Web服务器仅对您的计算机和server1.example.com可用?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30544343/