<div class="document">
<div class="section" id="ubuntu">
<h3>Installing Required Modules (Ubuntu)</h3>
<pre class="literal-block">sudo apt-get install libapache2-mod-wsgi
sudo a2enmod wsgi
</pre>
</div>
<div class="section" id="apache-httpd-conf">
<h3>Apache Configuration File (httpd.conf, etc.)</h3>
<pre class="literal-block"><VirtualHost *:80>
ServerName b.ytyng.com
DocumentRoot /data/htdocs/b.ytyng.com
ErrorLog /var/log/apache2/b.ytyng.com/error.log
CustomLog /var/log/apache2/b.ytyng.com/access.log combined
LogLevel warn
Alias /static /DJANGO-ROOT/static
Alias /static-admin /usr/local/lib/python2.7/dist-packages/django/contrib/admin/media
WSGIScriptAlias / /DJANGO-ROOT/wsgi/index.wsgi
WSGIDaemonProcess b.ytyng.com user=www-data group=www-data processes=1 threads=15 home=/ maximum-requests=1000 shutdown-timeout=30
WSGIProcessGroup b.ytyng.com
WSGIPassAuthorization On
</VirtualHost>
</pre>
</div>
<div class="section" id="index-wsgi">
<h3>index.wsgi</h3>
<pre class="literal-block"># -*- mode: Python; -*-
import os
import sys
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
if path not in sys.path:
sys.path.insert(0, path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
</pre>
</div>
</div>
Comments