Recently I took the opportunity to configure my server for per-user hosting (to offer some free hosting to people who needed it). Doing this I had to configure mod_wsgi per-user as well. First, let me say that the documentation is excellent, but real world examples are always very helpful. Below is the output of a script which runs per-user on my server.
/etc/apache2/users/username.conf
<VirtualHost *>
ServerAdmin username@localhost
ServerName userdomain.com
ServerAlias userdomain.com www.userdomain.comWSGIScriptAlias / "/home/username/.wsgi/project_name"
WSGIDaemonProcess userdomain user=username threads=15 display-name=%{GROUP}
WSGIProcessGroup userdomainDocumentRoot "/home/username/project_name"
Alias /media/ "/home/username/project_name/media/"
<Directory "/home/username/project_name/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>Alias /admin-media/ "/usr/local/django-dev/django/contrib/admin/media/"
<Directory "/usr/local/django-dev/django/contrib/admin/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory><Directory "/home/username/project_name/">
Options +ExecCGI
Allow from all
</Directory>ErrorLog /home/username/logs/userdomain.com/error.log
CustomLog /home/username/logs/userdomain.com/access.log combined
</VirtualHost>
/home/username/.wsgi/project_name
1 2 3 4 5 6 7 8 9 10 11 12 13 | |