简体   繁体   中英

Rails 3.1 App just visible on local machine

I've made a Rails 3.1 App and deployed it in production-mode on a local fedora 16 server. On the server I can access the Application successfully.

Now when I'm trying to access the application from another machine in the local network it fails.

Webrick says on startup

Rails 3.1.0 application starting in production on http://0.0.0.0:3000

Pinging this machine works.

I also edited /etc/sysconfig/iptables adding

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT

and restarted iptables without any success.

Is there something I missed?

What web server are you using? With apache you need to make sure you're 'listening' to the URL and ports. This is set up in config files. Local host is set up by default, so if you havent set it up for either a URL or IP then you need to do so.

/etc/hosts.allow

  #
  # /etc/hosts.allow
  #
  sshd: ALL: ALLOW
  httpd: ALL: ALLOW
  ruby: ALL: ALLOW
  WEBrick: ALL: ALLOW
  webrick: ALL: ALLOW
  # End of file

尝试在端口80上运行

$ rails s -p 80

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM