Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Deploy Pyramid, Trac, Django via apache2 and modwsgi.

Project Description

Deployment using mod_wsgi and apache. Below instructions will tell you how to quickly deploy your pyramid app using libapache2-mod-wsgi-py3.

Install modwsgideploy


You can install modwsgideploy from PyPi:

pip install modwsgideploy


Run modwsgideploy

Go into your python application project folder and type in:



Here is a typical installation, from start to finish on Debian Linux. You might have to use you OS specific commands for installing apache.

The steps are: 1) Install apache and modwsgi 2) Setup virtual environment and install you web application written in pyramid,etc 3) Install modwsgideploy and run the modwsgideploy command above to generate all the configuration files. 4) Tweak apache/ .conf and .wsgi settings to fit your needs or use default settings. 5) Check if everything is running properly.

In this case I will install apache using tools available from my Linux operating system:

apt-get install apache2
apt-get install libapache2-mod-wsgi-py3
virtualenv -p python3 --no-site-packages /usr/local/pyramid/env_py3
source /usr/local/pyramid/env_py3/bin/activate
pip install modwsgideploy

Go into you app and run modwsgideploy command::

cd myapp

You should see an apache2 folder like this inside ‘myapp’:

|-- apache2
|   |-- .python-eggs
|   |-- README.txt
|   |-- myapp.conf
|   |-- myapp.wsgi
|   `-- test.wsgi
  1. Read the README.txt
  2. myapp.conf is a apache2 configuration file that you need to copy into your apache2 configuration folder after all the settings are set.
  3. myapp.wsgi is an modwsgi script that is called from myapp apache2 file
  4. test.wsgi is a test script that you can call to see if you modwsgi was properly installed and working.

Edit myapp.conf file to change any paths and/or apache configurations. Then copy to apache2 folder in /etc/apache2/sites-available/.

On Debian Linux operating system I copy this file to:

cp ./apache2/myapp.conf /etc/apache2/sites-available/

Enable the website. On my OS its:

a2ensite myapp.conf
/etc/init.d/apache restart



If you have a useful sample wsgi script or apache config that you would like to share, please sent it


If you need help or would like to discuss: Go To:

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(34.0 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Jun 24, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting