This repository contains an example configuration of EvaP. To set up an instance of EvaP on an Ubuntu server, follow these steps:
- Update the system (
apt update -y; apt upgrade -y). - Install Python (
apt install python3 python3-venv). - Install and enable Apache, Postgres, and Redis (
apt install apache2 libapache2-mod-wsgi-py3 postgresql redis,service apache2 start; service postgresql start; service redis-server start). - Create Postgres
evapuser and database (insudo -u postgres psqlruncreate user evap password 'evap' createdb; create database evap owner evap;). - Create system
evapuser (useradd -m evap) and run the following insudo -i -u evap:- (You probably want to clone the
evap-deploymentrepository at this point). - Make a virtual environment and enter it (
python3 -m venv venv; . venv/bin/activate). - Install
evap(pip install evap[psycopg-binary]). Note: Instead of usingevapfrom PyPI, you can also install EvaP through a wheel by usingpip install evap-0.0.0-py-none-any.whl[psycopg-binary]. - Set up settings (see
productionsettings.template.py) and set theDJANGO_SETTINGS_MODULEshell variable accordingly (for exampleexport DJANGO_SETTINGS_MODULE="productionsettings"). - Set up wsgi (see
wsgi.template.py). - Run
python3 -m evap collectstaticandpython3 -m evap migrate.
- (You probably want to clone the
- Make the directory of the EvaP installation accessible to Apache (for example by
chown -R evap:www-data /home/evap). - Configure Apache:
- Set up two sites based on
apache/evap.confandapache/maintenance.conf. - Run
a2enmod rewrite,a2enmod headers, anda2enmod wsgi. - Disable the default site and enable the
evapsite. - Restart Apache.
- Set up two sites based on
EvaP should now be available according to your Apache configuration.
The repository also contains:
maintenance_mode.sh: Enable or disable the maintenance mode.update_production.sh: Make a backup, update the installedevappackage, and refresh caches etc.load_production.sh: Load a backup made byupdate_production.sh.