You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
7. Follow the instructions in `Setup an example project`_, and install the dependencies:
281
281
282
-
.. code:: text
283
-
284
-
sudo python3 -m pip install -r requirements.txt
285
-
286
-
8. Create a new systemd service for running Voilà in ``/usr/lib/systemd/system/voila.service``.
287
-
The service will ensure Voilà is automatically restarted on startup:
282
+
.. code:: text
288
283
289
-
.. code:: text
284
+
sudo python3 -m pip install -r requirements.txt
290
285
291
-
[Unit]
292
-
Description=Voila
286
+
8. Create a new systemd service for running Voilà in ``/usr/lib/systemd/system/voila.service``. The service will ensure Voilà is automatically restarted on startup:
In this example Voilà is started with ``voila --no-browser voila/notebooks/basics.ipynb`` to serve a single notebook.
307
306
You can edit the command to change this behavior and the notebooks Voilà is serving.
308
307
309
308
9. Enable and start the ``voila`` service:
310
309
311
-
.. code:: text
310
+
.. code:: text
312
311
313
-
sudo systemctl enable voila.service
314
-
sudo systemctl start voila.service
312
+
sudo systemctl enable voila.service
313
+
sudo systemctl start voila.service
315
314
316
315
.. note::
316
+
317
317
To check the logs for Voilà:
318
318
319
319
.. code:: text
@@ -328,45 +328,45 @@ Enable HTTPS with Let's Encrypt
328
328
329
329
1. Install ``certbot``:
330
330
331
-
.. code:: text
331
+
.. code:: text
332
332
333
-
sudo add-apt-repository ppa:certbot/certbot
334
-
sudo apt update
335
-
sudo apt install python-certbot-nginx
333
+
sudo add-apt-repository ppa:certbot/certbot
334
+
sudo apt update
335
+
sudo apt install python-certbot-nginx
336
336
337
337
2. Obtain the certificates from Let's Encrypt. The ``--nginx`` flag will edit the nginx configuration automatically:
338
338
339
-
.. code:: text
340
-
341
-
sudo certbot --nginx -d yourdomain.com
339
+
.. code:: text
340
+
341
+
sudo certbot --nginx -d yourdomain.com
342
342
343
343
3. ``/etc/nginx/sites-enabled/yourdomain.com`` should now contain a few more entries:
344
344
345
-
.. code :: text
346
-
347
-
$ cat /etc/nginx/sites-enabled/yourdomain.com
345
+
.. code :: text
348
346
349
-
...
350
-
listen 443 ssl; # managed by Certbot
351
-
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; # managed by Certbot
352
-
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; # managed by Certbot
353
-
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
354
-
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
355
-
...
347
+
$ cat /etc/nginx/sites-enabled/yourdomain.com
348
+
349
+
...
350
+
listen 443 ssl; # managed by Certbot
351
+
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; # managed by Certbot
352
+
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; # managed by Certbot
353
+
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
354
+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
355
+
...
356
356
357
357
4. Visit ``yourdomain.com`` to access the Voilà applications over HTTPS.
358
358
359
359
5. To automatically renew the certificates (they expire after 90 days), open the ``crontab`` file:
360
360
361
-
.. code :: text
361
+
.. code :: text
362
362
363
-
crontab -e
363
+
crontab -e
364
364
365
-
And add the following line:
365
+
And add the following line:
366
366
367
-
.. code :: text
367
+
.. code :: text
368
368
369
-
0 12 * * * /usr/bin/certbot renew --quiet
369
+
0 12 * * * /usr/bin/certbot renew --quiet
370
370
371
371
For more information, you can also follow `the guide on the nginx blog <https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/>`__.
0 commit comments