[Fixed]-How can I run two django projects through Apache webserver in Ubuntu 14.04?

1👍

Various things wrong. See comments below.

# Best to match trailing slashes on both arguments to be safe. If
# leave one off on one, can't remember which, the final filesystem
# path will not be formed correctly. Use have trailing slash on both
# or not on either.

Alias /static/ /home/abhay/django-project/yota_admin_module/yota/static/

# If you are needing to include /usr/local/lib/python2.7/site-packages then
# you must be doing something wrong. That should be included by default.
# If it is required, then your mod_wsgi is not compiled for that Python
# installation.

WSGIDaemonProcess yota_admin_module python-path=/home/abhay/django-project/yota_admin_module:/usr/local/lib/python2.7/site-packages

# You can't use WSGIProcessGroup unless you scoped it by a Directory
# of Location directive so it knows which Django instance it applied to.
# Better to use process-group option to WSGIScriptAlias instead so it
# knows for sure. Also force main interpreter context using
# application-group with value of %{GLOBAL}

WSGIScriptAlias / /home/abhay/django-project/yota_admin_module/yota_admin_module/wsgi.py \
    process-group=yota_admin_module application-group=%{GLOBAL}

<Directory /home/abhay/django-project/yota_admin_module/ >
       Require all granted
</Directory>

WSGIDaemonProcess yotasite python-path=/home/abhay/django-project/yotasite:/usr/local/lib/python2.7/site-packages

# You can't have both sites mounted at the root of the host. This second
# one will always be hidden by the first and never get any requests.
# If wanting to have both under same server name, you would need to have
# one at a sub URL. That for a sub URL must be first. That is before
# that for the root of the site.

WSGIScriptAlias / /home/abhay/django-project/yotasite/yotasite/wsgi.py \
    process-group=yotasite application-group=%{GLOBAL}

<Directory /home/abhay/django-project/yotasite/ >
       Require all granted
</Directory>

Leave a comment