feat(doc): ajout de la doc d install apache

pull/63/head
François Poulain 2022-04-12 19:43:56 +02:00
parent b541f8eee8
commit f2cb301e0e
1 changed files with 44 additions and 6 deletions

View File

@ -14,7 +14,7 @@ GvoT est un logiciel libre pour organiser des votations à large échelle.
On a Debian-based host - running at least Debian Buster:
```
```bash
$ sudo apt install python3 virtualenv git make
$ git clone https://forge.cliss21.org/cliss21/gvot
$ cd gvot/
@ -110,6 +110,8 @@ check that everything is working fine with:
### Web server
#### NginX with uWSGI
Here is an example deployment using NGINX - as the Web server - and uWSGI - as
the application server.
@ -122,7 +124,7 @@ to your uWSGI configuration (from
In the `server` block of your NGINX configuration, add the following blocks and
set the path to your application instance and to the uWSGI socket:
```
```nginx
location / {
include uwsgi_params;
uwsgi_pass unix:<uwsgi_socket_path>;
@ -142,14 +144,50 @@ location = /favicon.ico {
}
```
#### Apache with modpython
Here is an example deployment using Apache as the Web server.
The WSGI configuration doesn't require a special configuration, except that we
are using Python 3 and a virtual environment. See e.g. [Django's docs](
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/)
for more details.
```apache
WSGIProcessGroup gvot
WSGIDaemonProcess gvot python-home=<app_instance_path>/venv/ python-path=<app_instance_path>/
WSGIScriptAlias / <app_instance_path>/gvot/wsgi.py process-group=gvot
<Directory <app_instance_path>/gvot/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static/ <app_instance_path>/var/static/
<Directory <app_instance_path>/var/static/>
Require all granted
</Directory>
Alias /media/ <app_instance_path>/var/media/
<Directory <app_instance_path>/var/media/>
Require all granted
</Directory>
Alias /favicon.ico <app_instance_path>/var/static/favicon/favicon.ico
```
### Emails
In a production setup, you will need to add cron jobs in order to flush mail
queues:
```
* * * * * (/path/venv/bin/python /path/manage.py send_mail >> /path/var/log/cron_mail.log 2>&1)
0,20,40 * * * * (/path/venv/bin/python /path/manage.py retry_deferred >> /path/var/log/cron_mail_deferred.log 2>&1)
0 0 * * * (/path/venv/bin/python /path/manage.py purge_mail_log 7 >> /path/var/log/cron_mail_purge.log 2>&1)
```cron
* * * * * (<app_instance_path>/venv/bin/python <app_instance_path>/manage.py send_mail >> <app_instance_path>/var/log/cron_mail.log 2>&1)
0,20,40 * * * * (<app_instance_path>/venv/bin/python <app_instance_path>/manage.py retry_deferred >> <app_instance_path>/var/log/cron_mail_deferred.log 2>&1)
0 0 * * * (<app_instance_path>/venv/bin/python <app_instance_path>/manage.py purge_mail_log 7 >> <app_instance_path>/var/log/cron_mail_purge.log 2>&1)
```
See