Linux 如何使此Web服务器仅可供您的计算机和server1.example.com访问?

Linux 如何使此Web服务器仅可供您的计算机和server1.example.com访问?,linux,web-services,centos,Linux,Web Services,Centos,我设置了一个默认配置Web服务器。现在我不能让这个Web服务器只对我的机器和server1.example.com进行访问 # 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:

我设置了一个默认配置Web服务器。现在我不能让这个Web服务器只对我的机器和server1.example.com进行访问

# 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

那么,你的剧本呢?你会犯什么错误?