So I am on:
- Ubuntu 14.04.3 LTS
- Apache/2.4.7
- Latest mod-wsgi-3.4 built from source
- Python 3.4 virtualenv
- Django 1.86
I have 2 django projects at different locations:
- /home/admin/myproject/
- /home/boba/bobaproject/
So the directories are under different users.
I am trying to serve myproject at www.example.com and serve boba at www.example.com/boba
I followed https://gun.io/blog/how-to-install-multiple-django-sites-on-the-same-server/ and setup my Apache config file:
<VirtualHost *:80>
ServerAdmin a@b.com
ServerName example.com
DocumentRoot /var/www/example.com/public_html
WSGIScriptAlias /boba /home/boba/bobaproject/website/wsgi.py
WSGIDaemonProcess boba python-path=/home/boba/bobaproject:/home/boba/bobaproject/bbenv/lib/python3.4/site-packages
WSGIProcessGroup boba
<Directory /home/boba/bobaproject/website>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static /home/boba/bobaproject/static
<Directory /home/boba/bobaproject/static>
Require all granted
</Directory>
WSGIScriptAlias / /home/admin/myproject/myproject/wsgi.py
WSGIDaemonProcess myproject python-path=/home/admin/myproject:/home/admin/myproject/myprojectenv/lib/python3.4/site-packages
WSGIProcessGroup myproject
<Directory /home/admin/myproject/myproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static /home/admin/myproject/static
<Directory /home/admin/myproject/static>
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
But I am getting only myproject at both www.example.com and www.example.com/boba Individually both site configs do work if I remove the other. Together they dont.
My order of declaring the wsgi applications seem to be correct with myproject which is served by the basic url declared later. boba is first
Also each wsgi application has its own WSGIProcessGroup. What could be going wrong here?
I keep getting this in the Apache error logs, not sure if its relevant:
[Sat Nov 14 16:46:35.305968 2015] [:error] [pid 31518:tid 139634209957760] AssertionError:
[Sat Nov 14 16:46:35.366063 2015] [:error] [pid 31518:tid 139634209957760] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
[Sat Nov 14 16:46:35.366107 2015] [:error] [pid 31518:tid 139634209957760] Traceback (most recent call last):
[Sat Nov 14 16:46:35.366123 2015] [:error] [pid 31518:tid 139634209957760] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown
[Sat Nov 14 16:46:35.366705 2015] [:error] [pid 31518:tid 139634209957760] assert tlock is not None
[Sat Nov 14 16:46:35.366726 2015] [:error] [pid 31518:tid 139634209957760] AssertionError:
[Sat Nov 14 22:16:36.244778 2015] [:warn] [pid 31724:tid 140082293180288] mod_wsgi: Compiled for Python/3.4.0.
[Sat Nov 14 22:16:36.244939 2015] [:warn] [pid 31724:tid 140082293180288] mod_wsgi: Runtime using Python/3.4.3.
[Sat Nov 14 22:16:36.255767 2015] [mpm_worker:notice] [pid 31724:tid 140082293180288] AH00292: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/3.4.3 configured -- resuming normal operations
[Sat Nov 14 22:16:36.255818 2015] [core:notice] [pid 31724:tid 140082293180288] AH00094: Command line: '/usr/sbin/apache2'
Thanks for any help.