Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup my server with apache on an amazon EC2 server, but right now it isn't working. In the configuration files,

In /etc/apache2, I have:


LoadModule wsgi_module modules/
WSGIPythonHome /home/ubuntu/www/env


WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=Wiz group=admin threads=4 python-path=/home/ubuntu/www/env/lib/python2.7/site-packages
WSGIScriptAlias /Visus /home/ubuntu/www/env/pyramid.wsgi

<Directory /home/ubuntu/www/env>
  WSGIProcessGroup pyramid
  Order allow,deny
  Allow from all

In my virtualenv, I have :


from pyramid.paster import get_app, setup_logging
ini_path = '/home/ubuntu/www/env/Wiz/production.ini'
application = get_app(ini_path, 'main')

And when I go to the base website, the default apache webpage comes up, saying the server is running, but when I go to, I get a 404, when I should get my app. What's going wrong?

share|improve this question

migrated from Aug 3 '12 at 14:17

This question came from our site for professional and enthusiast programmers.

That appears to be a relatively faithful transpose from the Pyramid docs, so am I correct to assume the missing characters 'W' and 'S' at the beginning of your modwsgi.conf are not actually missing in your config? – khoxsey Aug 3 '12 at 4:11
@khoxsey Oh yea, its there, just copy pasted wrong. – Wiz Aug 3 '12 at 4:23
Is you modwsgi.conf actually included somehow into the Apache configuration file. Add a syntax error into the file by adding a line with 'XXX' by itself and see if Apache complains when you start it. – Graham Dumpleton Aug 3 '12 at 5:38
And python-path=/home/ubuntu/www/env/lib/python2.7/site-packages should be redundant and WSGIPythonHome for that virtual environment should achieve the same thing. – Graham Dumpleton Aug 3 '12 at 5:39
@GrahamDumpleton oh wow, I tried that, and it never complained. How can I fix that? – Wiz Aug 3 '12 at 15:54
up vote 2 down vote accepted

From the comments it appears to me that your base setup is not working. In general, the Ubuntu model for managing Apache setups is to use the a2 tools (a2enmod, a2ensite, etc) rather than editing the base *.conf files. This can take a while to get used to, but works fine.

This page has a very good walkthrough for setting up pyramid to run on Ubuntu. It's for 11.04 but I see nothing in it incorrect for more recent versions. In particular, note how the only configuration changes for the Apache setup are in your new site config file. You don't touch the rest of the default Apache configuration.

Since you are using EC2, it's probably easiest to start up a fresh instance and follow the directions in that page. Don't forget to configure your Security Group settings to allow access to port 80.

share|improve this answer
Thank you sooo much! It worked like a charm! – Wiz Aug 3 '12 at 19:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.