diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 55 |
1 files changed, 9 insertions, 46 deletions
| @@ -30,59 +30,22 @@ Pin-Priority: 10 | |||
| 30 | Then: | 30 | Then: |
| 31 | 31 | ||
| 32 | ``` | 32 | ``` |
| 33 | # apt install git nginx-light uwsgi uwsgi-plugin-python3 mat2 --no-install-recommends | 33 | # apt install uwsgi uwsgi-plugin-python3 git mat2 |
| 34 | # apt install nginx-light # if you prefer nginx | ||
| 35 | # apt install apache2 libapache2-mod-proxy-uwsgi # if you prefer Apache2 | ||
| 34 | # cd /var/www/ | 36 | # cd /var/www/ |
| 35 | # git clone https://0xacab.org/jvoisin/mat2-web.git | 37 | # git clone https://0xacab.org/jvoisin/mat2-web.git |
| 36 | # mkdir ./mat2-web/uploads/ | 38 | # mkdir ./mat2-web/uploads/ |
| 37 | # chown -R www-data:www-data ./mat2-web | 39 | # chown -R www-data:www-data ./mat2-web |
| 38 | ``` | 40 | ``` |
| 39 | 41 | ||
| 40 | Since uwsgi isn't fun to configure, feel free to slap this into your | 42 | Since uwsgi isn't fun to configure, feel free to copy [this file](https://0xacab.org/jvoisin/mat2-web/tree/master/config/uwsgi.config) |
| 41 | `/etc/uwsgi/apps-enabled/mat2-web.ini`: | 43 | to `/etc/uwsgi/apps-enabled/mat2-web.ini` and [this one](https://0xacab.org/jvoisin/mat2-web/tree/master/config/nginx.config) |
| 44 | to `/etc/nginx/site-enabled/mat2-web`. | ||
| 42 | 45 | ||
| 43 | ```ini | 46 | Nginx is the recommended web engine, but you can also use Apache if you prefer, |
| 44 | [uwsgi] | 47 | by copying [this file](https://0xacab.org/jvoisin/mat2-web/tree/master/config/apache2.config) |
| 45 | module=main | 48 | to your `/etc/apache2/sites-enabled/mat2-web` file. |
| 46 | chdir = /var/www/mat2-web/ | ||
| 47 | callable = app | ||
| 48 | wsgi-file = main.py | ||
| 49 | master = true | ||
| 50 | workers = 1 | ||
| 51 | |||
| 52 | uid = www-data | ||
| 53 | gid = www-data | ||
| 54 | |||
| 55 | # kill stalled processes | ||
| 56 | harakiri = 30 | ||
| 57 | die-on-term = true | ||
| 58 | |||
| 59 | socket = mat2-web.sock | ||
| 60 | chmod-socket = 774 | ||
| 61 | plugins = python3 | ||
| 62 | ``` | ||
| 63 | |||
| 64 | and this into your `/etc/nginx/site-enabled/mat2-web`: | ||
| 65 | |||
| 66 | ```nginx | ||
| 67 | location / { try_files $uri @yourapplication; } | ||
| 68 | location @yourapplication { | ||
| 69 | include uwsgi_params; | ||
| 70 | uwsgi_pass unix:/var/www/mat2-web/mat2-web.sock; | ||
| 71 | } | ||
| 72 | ``` | ||
| 73 | |||
| 74 | Nginx is the recommended web engine, but you can also use Apache if you prefer: | ||
| 75 | |||
| 76 | ``` | ||
| 77 | apt install apache2 libapache2-mod-proxy-uwsgi | ||
| 78 | ``` | ||
| 79 | |||
| 80 | and add this to your `/etc/apache2/sites-enabled/mat2-web` in the `virtualhost` block: | ||
| 81 | |||
| 82 | ```Apache | ||
| 83 | ProxyPass / unix:/var/www/mat2-web/mat2-web.sock|uwsgi://localhost/ | ||
| 84 | |||
| 85 | ``` | ||
| 86 | 49 | ||
| 87 | Finally, restart `uwsgi` and your web server: | 50 | Finally, restart `uwsgi` and your web server: |
| 88 | 51 | ||
