如何使此网络服务器只能由您的计算机和 server1.example.com 访问?
How to make this webserver only accessible to your machine and server1.example.com?
我设置了默认配置网络服务器。现在我无法让这个网络服务器只能由我的机器和 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
我设置了默认配置网络服务器。现在我无法让这个网络服务器只能由我的机器和 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