From bcccc7da576e0fe65da35db436abfb6ef16b7327 Mon Sep 17 00:00:00 2001 From: Fabian Schlager Date: Tue, 18 Nov 2014 14:39:54 +0100 Subject: [PATCH] Add setup guide for apache2 with mod_wsgi --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 975fd64..b36cf8f 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,51 @@ Reload Nginx sudo service nginx reload +### Apache + mod_wsgi Setup + + sudo apt-get install -y apache2 libapache2-mod-wsgi + +Create a virtual host configuration in /etc/apache2/sites-available/realms_vhost: + + + ServerName wiki.example.org + + WSGIDaemonProcess realms_wsgi display-name=%{GROUP} + WSGIProcessGroup realms_wsgi + WSGIScriptAlias / /var/www/my-realms-dir/wsgi.py + + Alias /static /full/path/to/realms/static + + +Create /var/www/my-realms-dir/wsgi.py + + import os + import site + + # Uncomment the following lines if you are using a virtual environment + + # ---------------------------------- + # Enter path to your virtualenv's site-packages directory + # VENV_SITE_DIR = ".venv/lib/python2.7/site-packages" + # PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) + # site.addsitedir(os.path.abspath(os.path.join(PROJECT_ROOT, VENV_SITE_DIR))) + # ---------------------------------- + + from realms import create_app + application = create_app() + +Enable the virtual host + + sudo a2ensite realms_vhost + +Test your configuration + + apache2ctl configtest + +Reload apache + + sudo service apache2 reload + ### Mysql Setup sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev