0

I am starting to create a RESTful API that is built on Ruby on Rails. I would like my other applications (which are hosted on the same server) to be able to use this API. I had the idea that if the API is only available locally, I won't have to deal with the authentication logic since it won't be publicly accessible. I have never done this sort of thing before, so I don't even know if what I am asking for is possible (or if this is even a good idea).

How can I host this application so that my REST API is only locally accessible?

Andrew
  • 227,796
  • 193
  • 515
  • 708
  • 2
    You could start your rails app on a different port like 8082 or something and then use firewall like iptables to prevent anyone from accessing the port externally, maybe? – Upgradingdave Apr 12 '12 at 22:31

1 Answers1

0

You can do one of the following:

  • Set the webserver to listen on loopback only

    • If you need to give access to the local network then configure your firewall to forward ports accordingly
  • Set the webserver to listen only on the private network interface (not public)

cpuguy83
  • 5,794
  • 4
  • 18
  • 24