This files are meant to enable WSGI support on a Debian or Ubuntu.
-
Install wsgi apache module
~$ sudo apt-get install libapache2-mod-wsgi-py3 ~$ a2enmod wsgi
-
Download wsgi template
~$ cd /usr/local/vesta/data/templates/web /web$ wget https://gitlab.com/neyder/vestacp-wsgi/-/archive/master/vestacp-wsgi-master.tar.gz \ -O- | sudo tar xzvf - --strip-components=1
-
Create new package or set wsgi as apache template in the existing package
-
Add new user and assing him package with wsgi template
-
Add new domain and check the result
-
This is for Python3.
-
Upgrade your mod_wsgi to 4.6 + (libapache2-mod-wsgi-py3 provides version 4.3)
-
You should create a venv in private dir inside your web domain.
-
Your project should be alogside venv named as domain_name.
private ├── name.domain.tld └── venv
-
wsgi.py script is inside PROJECTAPP directory
private/
└── name.domain.tld
├── manage.py
└── PROJECTAPP
└── wsgi.py
- you can rename PROJECTAPP with
~$ sudo sed -i 's/PROJECTAPP/{change_this}/' conf/web/name.domain.tld.apache2.conf
~$ sudo sed -i 's/PROJECTAPP/{change_this}/' conf/web/name.domain.tld.apache2.ssl.conf
- this was tested using a django project.