0

I have a normal rails server already deployed and is running on a ubuntu machine with port 80 for http service.

For the saving cost reason, I would like to run an internal python server on the same ubuntu machine at different port say 8888 and let the rails app call the api that python server expose.

I did this experiment on my local development machine and it worked fine. That is, I have my rails server run at localhost:3000 and python server run at localhost:8888. The rails server can call python api with no issue. However in production environment, I am struggling to make it work.

Any suggestion how should I set up the python server on production so that it can be access by rails server?

sovanlandy
  • 1,700
  • 2
  • 19
  • 24
  • Have you checked your firewall/iptables? – Fabián Heredia Montiel Jul 15 '14 at 03:42
  • Ideally, I would like to make it accessible by the rails application in the machine and not public. Following your suggestion, I check my iptable rules with [ sudo iptables -L ]. i don't see port 8888 open to tcp but only port 80 of rails. I tried to open it up for tcp with command [ sudo iptables -A INPUT -p tcp --dport 8888 -j ACCEPT ]. It is however still not accessible. – sovanlandy Jul 15 '14 at 03:56
  • Not necessarily public, just that localhost was allowed to do input and output on that port.(Check http://serverfault.com/a/247180/105425 ) If you run your python service elsewhere, does it work? – Fabián Heredia Montiel Jul 15 '14 at 03:59
  • Thanks for the link! I'm working on it. – sovanlandy Jul 15 '14 at 04:10

0 Answers0