summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorjvoisin2019-02-23 13:27:33 +0100
committerjvoisin2019-02-23 13:27:33 +0100
commit1b0333fdd5175d6a45d1929218e0aac3db884139 (patch)
tree2438036e7c3c9159ecd80c06aa1d8fd336509819 /README.md
parent489fc7f2b5ef3d4be0f74e405a4200c6ffc12fc3 (diff)
Improve the deployment configuration
Diffstat (limited to 'README.md')
-rw-r--r--README.md55
1 files changed, 9 insertions, 46 deletions
diff --git a/README.md b/README.md
index edaf8f6..f122ef7 100644
--- a/README.md
+++ b/README.md
@@ -30,59 +30,22 @@ Pin-Priority: 10
30Then: 30Then:
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
40Since uwsgi isn't fun to configure, feel free to slap this into your 42Since 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`: 43to `/etc/uwsgi/apps-enabled/mat2-web.ini` and [this one](https://0xacab.org/jvoisin/mat2-web/tree/master/config/nginx.config)
44to `/etc/nginx/site-enabled/mat2-web`.
42 45
43```ini 46Nginx is the recommended web engine, but you can also use Apache if you prefer,
44[uwsgi] 47by copying [this file](https://0xacab.org/jvoisin/mat2-web/tree/master/config/apache2.config)
45module=main 48to your `/etc/apache2/sites-enabled/mat2-web` file.
46chdir = /var/www/mat2-web/
47callable = app
48wsgi-file = main.py
49master = true
50workers = 1
51
52uid = www-data
53gid = www-data
54
55# kill stalled processes
56harakiri = 30
57die-on-term = true
58
59socket = mat2-web.sock
60chmod-socket = 774
61plugins = python3
62```
63
64and this into your `/etc/nginx/site-enabled/mat2-web`:
65
66```nginx
67location / { try_files $uri @yourapplication; }
68location @yourapplication {
69 include uwsgi_params;
70 uwsgi_pass unix:/var/www/mat2-web/mat2-web.sock;
71}
72```
73
74Nginx is the recommended web engine, but you can also use Apache if you prefer:
75
76```
77apt install apache2 libapache2-mod-proxy-uwsgi
78```
79
80and add this to your `/etc/apache2/sites-enabled/mat2-web` in the `virtualhost` block:
81
82```Apache
83ProxyPass / unix:/var/www/mat2-web/mat2-web.sock|uwsgi://localhost/
84
85```
86 49
87Finally, restart `uwsgi` and your web server: 50Finally, restart `uwsgi` and your web server:
88 51