From 19d63ea6b9ead8bfa0ba7bfbc17154f6c9e333bc Mon Sep 17 00:00:00 2001 From: baskayj Date: Tue, 21 Dec 2021 18:56:14 +0100 Subject: [PATCH] Update 'Quick Guide to publishing websites on hal.elte.hu with Python3 backend' --- ...tes-on-hal.elte.hu-with-Python3-backend.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/Quick-Guide-to-publishing-websites-on-hal.elte.hu-with-Python3-backend.md b/Quick-Guide-to-publishing-websites-on-hal.elte.hu-with-Python3-backend.md index b8a1b10..9bc960e 100644 --- a/Quick-Guide-to-publishing-websites-on-hal.elte.hu-with-Python3-backend.md +++ b/Quick-Guide-to-publishing-websites-on-hal.elte.hu-with-Python3-backend.md @@ -11,12 +11,11 @@ It\'s also worth mentioning, that Flask has various \“AddOn\” modules, like Once you’re done, collect all Python packages needed in a `requirements.txt` with version number included. It should look something like this: ``` -1. Flask==2.0.2 -2. Flask-WTF==1.0.0 -3. . -4. . -5. . - +Flask==2.0.2 +Flask-WTF==1.0.0 +. +. +. ``` # Configuring Apache2 @@ -29,26 +28,26 @@ Since Flask’s built-in server is not fit for live traffic, you need another WS ## Creating `your_app.conf` This file contains the paths to all the important Files needed for Apache2 to run your Python3 scripts. The minimal config file for a Flask-app, with static files (Images, CSS) present looks like: ``` -1. -2. ServerAdmin username -3. DocumentRoot /var/www/html/your_app -4. -5. WSGIDaemonProcess your_app python-home=/var/www/html/your_app/your_app/venv python-path=/var/www/html/your_app/your_app:/var/www/html/your_app/your_app/venv/local/lib/python3.9/site-packages threads=5 -6. WSGIScriptAlias /your_app /var/www/html/your_app/your_app.wsgi -7. WSGIApplicationGroup %{GLOBAL} -8. -9. WSGIProcessGroup your_app -10. WSGIApplicationGroup %{GLOBAL} -11. Order deny,allow -12. Allow from all -13. -14. Alias /static /var/www/html/your_app/your_app/static -15. -16. Order allow,deny -17. Allow from all -18. -19. ErrorLog ${APACHE_LOG_DIR}/error.log -20. LogLevel warn -21. CustomLog ${APACHE_LOG_DIR}/access.log combined -22. + + ServerAdmin username + DocumentRoot /var/www/html/your_app + + WSGIDaemonProcess your_app python-home=/var/www/html/your_app/your_app/venv python-path=/var/www/html/your_app/your_app:/var/www/html/your_app/your_app/venv/local/lib/python3.9/site-packages threads=5 + WSGIScriptAlias /your_app /var/www/html/your_app/your_app.wsgi + WSGIApplicationGroup %{GLOBAL} + + WSGIProcessGroup your_app + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + + Alias /static /var/www/html/your_app/your_app/static + + Order allow,deny + Allow from all + + ErrorLog ${APACHE_LOG_DIR}/error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/access.log combined + ```