Commit 2555e64530892ff614422d66749ca551cbbf3660
1 parent
d69e07cb
Exists in
rhitier-dev
New python3 apache conf
Showing
2 changed files
with
76 additions
and
0 deletions
Show diff stats
resources/apache.conf renamed to resources/apache-python2.conf
@@ -0,0 +1,76 @@ | @@ -0,0 +1,76 @@ | ||
1 | +# Apache virtual host conf file for Heliopropa web-app | ||
2 | +# | ||
3 | +# Will map a server name and an url to the wsgi script. | ||
4 | +# | ||
5 | +# Allows to use a python virtualenvironment thanks to two WSGIDaemonProcess | ||
6 | +# attributes: | ||
7 | +# python-home | ||
8 | +# python-path | ||
9 | + | ||
10 | + | ||
11 | +# Edit Configuration | ||
12 | +# | ||
13 | +Define flaskapp_path /home/richard/00DEV/SPACEWEATHERONLINE | ||
14 | +Define flaskapp_wsgiscript heliopropa.wsgi | ||
15 | +Define flaskapp_server_name heliopropa | ||
16 | +Define flaskapp_server_addr 127.0.0.1 | ||
17 | +Define flaskapp_subdir / | ||
18 | +Define flaskapp_user www-data | ||
19 | +Define flaskapp_group www-data | ||
20 | + | ||
21 | +# Warning: | ||
22 | +# -------- | ||
23 | +# | ||
24 | +# Stdout/Stderr wont be logged in per virtualhost log files. | ||
25 | +# | ||
26 | +# 1- Unsuccessfull tries to fix it: | ||
27 | +# | ||
28 | +# WSGIRestrictEmbedded On | ||
29 | +# WSGIRestrictStdout Off | ||
30 | +# | ||
31 | +# 2- what works is to comment out ErrorLog, TransferLog and CustomLog | ||
32 | +# and let apache log everything in global log files | ||
33 | +# | ||
34 | +# 3- However you should prefer to manage your own log system from inside web-app | ||
35 | +# | ||
36 | +# | ||
37 | +<VirtualHost ${flaskapp_server_addr}:443> | ||
38 | + # Add machine's IP address (use ifconfig command) | ||
39 | + ServerName ${flaskapp_server_name} | ||
40 | + # https stuf | ||
41 | + #SSLEngine on | ||
42 | + #SSLProtocol all -SSLv2 | ||
43 | + #SSLCertificateFile /etc/pki/tls/certs/localhost.crt | ||
44 | + #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key | ||
45 | + # Give an alias to to start your website url with | ||
46 | + DocumentRoot ${flaskapp_path} | ||
47 | + LogLevel warn | ||
48 | + LogFormat "%a %l %u %t \"%r\" %>s %b" | ||
49 | + # | ||
50 | + # Virtualhost log config doesnt show stdout/err see before | ||
51 | + # ErrorLog ${flaskapp_path}/flaskapp-error.log | ||
52 | + # TransferLog ${flaskapp_path}/flaskapp-access.log | ||
53 | + # CustomLog ${flaskapp_path}/flaskapp-custom.log combined | ||
54 | + | ||
55 | + # python-home is the virtual env path | ||
56 | + # python-path sets the PYTHON_PATH for modules import | ||
57 | + WSGIDaemonProcess ${flaskapp_server_name} \ | ||
58 | + user=${flaskapp_user} group=${flaskapp_user} \ | ||
59 | + processes=2 threads=5 \ | ||
60 | + python-home=${flaskapp_path}/venv \ | ||
61 | + python-path=${flaskapp_path} \ | ||
62 | + display-name=%{GROUP} | ||
63 | + WSGIScriptAlias /${flaskapp_subdir} ${flaskapp_path}/${flaskapp_wsgiscript} | ||
64 | + WSGIProcessGroup ${flaskapp_server_name} | ||
65 | + WSGIApplicationGroup %{GLOBAL} | ||
66 | + <Directory ${flaskapp_path}> | ||
67 | + # set permissions as per apache2.conf file | ||
68 | + Options -Indexes -MultiViews +FollowSymLinks | ||
69 | + AllowOverride All | ||
70 | + Require all granted | ||
71 | + </Directory> | ||
72 | +</VirtualHost> | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | +# vim: tabstop=4 sw=4 et tw=0 |