From 2555e64530892ff614422d66749ca551cbbf3660 Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Fri, 10 Jun 2022 16:41:14 +0200 Subject: [PATCH] New python3 apache conf --- resources/apache-python2.conf | 16 ++++++++++++++++ resources/apache-python3.conf | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ resources/apache.conf | 16 ---------------- 3 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 resources/apache-python2.conf create mode 100644 resources/apache-python3.conf delete mode 100644 resources/apache.conf diff --git a/resources/apache-python2.conf b/resources/apache-python2.conf new file mode 100644 index 0000000..5693846 --- /dev/null +++ b/resources/apache-python2.conf @@ -0,0 +1,16 @@ + + ServerAdmin myriam.bouchemit@irap.omp.eu + ServerName heliopropa.cdpp.eu + + WSGIDaemonProcess heliopropa + WSGIProcessGroup heliopropa + WSGIScriptAlias / /var/www/eu.cdpp.heliopropa/web/run.wsgi + WSGIScriptReloading On + + + WSGIProcessGroup heliopropa + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + + \ No newline at end of file diff --git a/resources/apache-python3.conf b/resources/apache-python3.conf new file mode 100644 index 0000000..c15fa46 --- /dev/null +++ b/resources/apache-python3.conf @@ -0,0 +1,76 @@ +# Apache virtual host conf file for Heliopropa web-app +# +# Will map a server name and an url to the wsgi script. +# +# Allows to use a python virtualenvironment thanks to two WSGIDaemonProcess +# attributes: +# python-home +# python-path + + +# Edit Configuration +# +Define flaskapp_path /home/richard/00DEV/SPACEWEATHERONLINE +Define flaskapp_wsgiscript heliopropa.wsgi +Define flaskapp_server_name heliopropa +Define flaskapp_server_addr 127.0.0.1 +Define flaskapp_subdir / +Define flaskapp_user www-data +Define flaskapp_group www-data + +# Warning: +# -------- +# +# Stdout/Stderr wont be logged in per virtualhost log files. +# +# 1- Unsuccessfull tries to fix it: +# +# WSGIRestrictEmbedded On +# WSGIRestrictStdout Off +# +# 2- what works is to comment out ErrorLog, TransferLog and CustomLog +# and let apache log everything in global log files +# +# 3- However you should prefer to manage your own log system from inside web-app +# +# + + # Add machine's IP address (use ifconfig command) + ServerName ${flaskapp_server_name} + # https stuf + #SSLEngine on + #SSLProtocol all -SSLv2 + #SSLCertificateFile /etc/pki/tls/certs/localhost.crt + #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key + # Give an alias to to start your website url with + DocumentRoot ${flaskapp_path} + LogLevel warn + LogFormat "%a %l %u %t \"%r\" %>s %b" + # + # Virtualhost log config doesnt show stdout/err see before + # ErrorLog ${flaskapp_path}/flaskapp-error.log + # TransferLog ${flaskapp_path}/flaskapp-access.log + # CustomLog ${flaskapp_path}/flaskapp-custom.log combined + + # python-home is the virtual env path + # python-path sets the PYTHON_PATH for modules import + WSGIDaemonProcess ${flaskapp_server_name} \ + user=${flaskapp_user} group=${flaskapp_user} \ + processes=2 threads=5 \ + python-home=${flaskapp_path}/venv \ + python-path=${flaskapp_path} \ + display-name=%{GROUP} + WSGIScriptAlias /${flaskapp_subdir} ${flaskapp_path}/${flaskapp_wsgiscript} + WSGIProcessGroup ${flaskapp_server_name} + WSGIApplicationGroup %{GLOBAL} + + # set permissions as per apache2.conf file + Options -Indexes -MultiViews +FollowSymLinks + AllowOverride All + Require all granted + + + + + +# vim: tabstop=4 sw=4 et tw=0 diff --git a/resources/apache.conf b/resources/apache.conf deleted file mode 100644 index 5693846..0000000 --- a/resources/apache.conf +++ /dev/null @@ -1,16 +0,0 @@ - - ServerAdmin myriam.bouchemit@irap.omp.eu - ServerName heliopropa.cdpp.eu - - WSGIDaemonProcess heliopropa - WSGIProcessGroup heliopropa - WSGIScriptAlias / /var/www/eu.cdpp.heliopropa/web/run.wsgi - WSGIScriptReloading On - - - WSGIProcessGroup heliopropa - WSGIApplicationGroup %{GLOBAL} - Order deny,allow - Allow from all - - \ No newline at end of file -- libgit2 0.21.2