0

I want to set up a partly developed website from an EC2 instance. The site is being developed using Pyramid web framework. Is it possible to set up simple waitress server from EC2?

I tried these instructions for setting up a Apache server. But when I point my browser to the public DNS, I get the error that says "website is taking too long to respond".

tshepang
  • 12,111
  • 21
  • 91
  • 136
Ranjith Ramachandra
  • 10,399
  • 14
  • 59
  • 96
  • I tried instructions on http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/tutorials/modwsgi/index.html. Then I did `wget http://localhost/myapp`. I got an internal server error and the apache2 log says `ImportError: No module named pyramid.paster` – Ranjith Ramachandra Apr 17 '12 at 06:07

1 Answers1

2

First of all, I'd recommend using mod_wsgi. I think it's the easiest to set up. Ignoring that, waitress is a WSGI server. It can run on port 80 directly if you want to.

[server:main]
use = egg:waitress
host = 0.0.0.0
port = 80

Unfortunately, if you do this, you need to be root. A better approach is to set the waitress server on an unprivileged port such as 8000 and use a reverse proxy to forward requests to your site.

Look at the deployment recipes in the pyramid cookbook here:

http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/deployment/index.html

Michael Merickel
  • 23,153
  • 3
  • 54
  • 70
  • So, I have to do the steps and point my browser to the elastic ip/public DNS of the instance. I will try again and let you know. Thanks for the answering. – Ranjith Ramachandra Apr 17 '12 at 05:01
  • Hey, I tried the instructions (http://readthedocs.org/docs/pyramid/en/1.1-branch/tutorials/modwsgi/index.html) on a fresh instance and still I am not able to get it to work. I am still getting the same error that says that *The server at ec2-184-72-212-252.compute-1.amazonaws.com is taking too long to respond.* – Ranjith Ramachandra Apr 17 '12 at 05:44
  • I tried instructions on http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/tutorials/modwsgi/index.html. Then I did `wget http://localhost/myapp`. I got an internal server error and the apache2 log says `ImportError: No module named pyramid.paster` – Ranjith Ramachandra Apr 17 '12 at 06:08
  • You're linking tutorials from several old versions of Pyramid. Look at the 1.3 docs. Make sure what you're setting up actually makes sense. What ports are you configuring at each stage of the process, etc. WIth the little information we have to go on here I'm not sure SO is the best forum for answering your questions. – Michael Merickel Apr 17 '12 at 06:23
  • Hey turns out I was really stupid :). I had not enabled http access to my server at all. But that tutorial is really old and I had to do some extra stuff, but I think the research was worth it and everything is working fine. Thanks a lot man – Ranjith Ramachandra Apr 17 '12 at 06:51