Update 'Quick Guide to publishing websites on hal.elte.hu with Python3 backend'

master
baskayj 4 years ago
parent
commit
19d63ea6b9
  1. 55
      Quick-Guide-to-publishing-websites-on-hal.elte.hu-with-Python3-backend.md

55
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: 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 Flask==2.0.2
2. Flask-WTF==1.0.0 Flask-WTF==1.0.0
3. . .
4. . .
5. . .
``` ```
# Configuring Apache2 # 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` ## 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: 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. <VirtualHost *:80> <VirtualHost *:80>
2. ServerAdmin username ServerAdmin username
3. DocumentRoot /var/www/html/your_app 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 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 WSGIScriptAlias /your_app /var/www/html/your_app/your_app.wsgi
7. WSGIApplicationGroup %{GLOBAL} WSGIApplicationGroup %{GLOBAL}
8. <Directory /var/www/html/your_app/your_app/> <Directory /var/www/html/your_app/your_app/>
9. WSGIProcessGroup your_app WSGIProcessGroup your_app
10. WSGIApplicationGroup %{GLOBAL} WSGIApplicationGroup %{GLOBAL}
11. Order deny,allow Order deny,allow
12. Allow from all Allow from all
13. </Directory> </Directory>
14. Alias /static /var/www/html/your_app/your_app/static Alias /static /var/www/html/your_app/your_app/static
15. <Directory /var/www/html/your_app/your_app/static/> <Directory /var/www/html/your_app/your_app/static/>
16. Order allow,deny Order allow,deny
17. Allow from all Allow from all
18. </Directory> </Directory>
19. ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
20. LogLevel warn LogLevel warn
21. CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
22. </VirtualHost> </VirtualHost>
``` ```

Loading…
Cancel
Save