0

I have been experimenting with Python as a server side language. In particular, I am looking at microframeworks (because that seems to be the cool thing these days).

I took a stab at using several frameworks. The following example I am using uses itty.

$ python hello_world.py
itty starting up (using wsgiref)...                                                                                    
Listening on http://0.0.0.0:5000
Use Ctrl-C to quit.

This works perfectly fine. I hit http://0.0.0.0:5000 and it works. But now I am having trouble understanding how to do the same thing on my web host. I can hit my website (e.g. foo.com) perfectly fine, but after I run hello_world.py, I am unable to hit the corresponding URL (i.e. foo.com:5000).

How do I hit the URL with a corresponding port? Can I do it without specifying port (e.g. bar.foo.com => foo.com:5000)?

Should I even be forwarding the port? Is there another way for me to accomplish my goal (i.e., hit the webpage generated by Python)?

How do I even tell if I have the permission to make these changes? My webhost is 1and1, if that helps.

If I am not able to accomplish this on my webhost, how can I do it on a server where I have more control (e.g. an EC2 instance)? (I'm also unsure, but I think this question might be relevant)

I have minimal working knowledge of ports and routing, so any knowledge or resources are very much appreciated.

Community
  • 1
  • 1
Phil
  • 6,686
  • 2
  • 19
  • 25
  • if it listens on localhost:8080, it will never be reachable from the outside (unless there's some crazy port redirection). You might want to lookup how to configure the app to run on 0.0.0.0:8080 – Martin Samson Aug 29 '12 at 18:46
  • @MartinSamson: I configured it to run differently, but still can't hit the URL :/ updating my question accordingly. – Phil Aug 29 '12 at 18:52
  • Usually web hosts use firewalls for your security, and these ports - `5000` or `8080` - are not open by default. – MostafaR Aug 29 '12 at 19:00
  • If you don't mind trying another host, Google App Engine is worth a look. It's free for low volume use. – John Y Aug 29 '12 at 20:23

0 Answers0