1

I have an unmanged vps. I have 3 django sites sitename_dev, sitename_staging, sitename_live which are run using a virtual env. All 3 are default django instances with no changes made. I have configured my apache as follows.

in /etc/apache2/conf-available/wsgi.conf

#from virtual env
LoadModule wsgi_module "/path/to/virtualenv/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
WSGIPythonHome "/path/to/virtualenv"

# dev site
Include /path/to/sitename_dev.conf

#staging
#Include /path/to/sitename_staging.conf

in path/to/sitename_dev.conf

WSGIScriptAlias /sitename_dev /path/to/sitename_dev/sitename_dev/wsgi.py
WSGIPythonPath /path/to/sitename_dev

<Directory /path/to/sitename_dev/sitename_dev>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

in path/to/sitename_staging.conf

WSGIScriptAlias /sitename_staging /path/to/sitename_staging/sitename_staging/wsgi.py
WSGIPythonPath /path/to/sitename_staging

<Directory /path/to/sitename_staging/sitename_staging>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

With this config my.ip/sitename_dev/ opens. But if I uncomment the staging site line, to include the staging site in /etc/apache2/conf-available/wsgi.conf, both my.ip/sitename_dev and my.ip/sitename_staging give 500 error. How can i run 3 sites as subdirectories ?

specs: OS: ubuntu 16.4 LTS server: apache2 2.4.18 python version of virtual env & wsgi: 3.6

Tuhin
  • 11
  • 3

0 Answers0