我无法连接到我的
Ruby on Rails开发服务器:
当我在不同的连接上输入192.168.0.10:3000进入Web浏览器时,只需要超时.
我怀疑问题出在我的防火墙配置上,但我试图打开所有内容,但这似乎不起作用.
服务器在我的本地网络上,具有静态IP并且配置正确 – 我可以通过SSH连接到盒子,它可以连接到互联网进行更新.它正在运行CentOS 6.3,我按照这些说明安装了rails:http://itekblog.com/ruby-on-rails-on-centos-6-3-is-easy/
服务器正在运行:我可以使用wget localhost:3000下载“Welcome Aboard”页面
我认为应该监听所有接口:
[sandy@pops testproject4]$rails server => Booting WEBrick => Rails 3.2.8 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2012-08-18 18:29:04] INFO WEBrick 1.3.1 [2012-08-18 18:29:04] INFO ruby 1.8.7 (2011-06-30) [i386-linux] [2012-08-18 18:29:04] INFO WEBrick::HTTPServer#start: pid=9881 port=3000
我想我已经打开了所有端口
[sandy@pops testproject4]$sudo iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh REJECT all -- anywhere anywhere reject-with icmp-host-prohibited ACCEPT all -- anywhere anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) target prot opt source destination
任何帮助解决这个问题将非常感激
沙
看起来问题是由于当你添加了你打开的所有行时你使用iptables -A INPUT …它在REJECT all规则之后尽职尽责地将它添加到INPUT链的末尾.
由于iptables在第一场比赛中胜出,因此您接受所有规则永远不会匹配,因此端口3000被阻止.
您应该使用iptables -I …将规则插入到链中或特定位置的特定位置
iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
应该做你想做的事.
如果你想保存规则,那么重启后一切都会好的,做:
service iptables save
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。