diff --git a/server_configurations/apache2/README.md b/server_configurations/apache2/README.md index 54f99ce..ddb3cb7 100644 --- a/server_configurations/apache2/README.md +++ b/server_configurations/apache2/README.md @@ -1,5 +1,5 @@ ## Configuration apache -Plusieurs configurations sont disponibles : +Deux configurations sont disponibles : ### Cas 1 @@ -13,9 +13,12 @@ La configuration apache permet de proxyfier les url disponibles sur le port appl Utiliser la configuration apache **mreport_conf1.conf** et l'inclure dans la configuration du virtualhost apache2 eg: -Adapter tous les chemins pointant vers le dossier report de votre installation exemple : +Editer la variable MREPORT_LOCATION qui pointe vers le répertoire mreport : -``Include /home/mreport/server_configurations/apache2/mreport_conf1.conf`` +``` + Define MREPORT_LOCATION /home/mreport + Include ${MREPORT_LOCATION}/server_configurations/apache2/mreport_conf2.conf +``` Cette configuration inclue les configurations nécessaires dans conf/common et conf/flask. @@ -27,8 +30,9 @@ Le frontend est uniquement servi par apache Utiliser la configuration apache **mreport_conf2.conf** et l'inclure dans la configuration du virtualhost apache2 eg: -Adapter tous les chemins pointant vers le dossier report de votre installation exemple : +Editer la variable MREPORT_LOCATION qui pointe vers le répertoire mreport : -``Include /home/mreport/server_configurations/apache2/mreport_conf2.conf`` - -Cette configuration inclue les configurations nécessaires dans conf/common et conf/noflask. +``` + Define MREPORT_LOCATION /home/mreport + Include ${MREPORT_LOCATION}/server_configurations/apache2/mreport_conf2.conf +``` diff --git a/server_configurations/apache2/conf/common/api.conf b/server_configurations/apache2/conf/common/api.conf deleted file mode 100644 index a7a3774..0000000 --- a/server_configurations/apache2/conf/common/api.conf +++ /dev/null @@ -1,5 +0,0 @@ -ProxyPreserveHost On - - ProxyPass "http://127.0.0.1:5000/api/" - ProxyPassReverse "http://127.0.0.1:5000/api/" - \ No newline at end of file diff --git a/server_configurations/apache2/conf/common/static.conf b/server_configurations/apache2/conf/common/static.conf deleted file mode 100644 index 79cee75..0000000 --- a/server_configurations/apache2/conf/common/static.conf +++ /dev/null @@ -1,4 +0,0 @@ -Alias /static "/home/spelhate/home/mreport/frontend/static" - - Require all granted - \ No newline at end of file diff --git a/server_configurations/apache2/conf/flask/admin.conf b/server_configurations/apache2/conf/flask/admin.conf deleted file mode 100644 index 8f38b6e..0000000 --- a/server_configurations/apache2/conf/flask/admin.conf +++ /dev/null @@ -1,4 +0,0 @@ - - ProxyPass "http://127.0.0.1:5000/admin/" - ProxyPassReverse "http://127.0.0.1:5000/admin/" - \ No newline at end of file diff --git a/server_configurations/apache2/conf/flask/mreport.conf b/server_configurations/apache2/conf/flask/mreport.conf deleted file mode 100644 index 6cf2c67..0000000 --- a/server_configurations/apache2/conf/flask/mreport.conf +++ /dev/null @@ -1,4 +0,0 @@ - - ProxyPass "http://127.0.0.1:5000/mreport/" - ProxyPassReverse "http://127.0.0.1:5000/mreport/" - \ No newline at end of file diff --git a/server_configurations/apache2/conf/noflask/admin.conf b/server_configurations/apache2/conf/noflask/admin.conf deleted file mode 100644 index 6c11a13..0000000 --- a/server_configurations/apache2/conf/noflask/admin.conf +++ /dev/null @@ -1,6 +0,0 @@ -Alias /admin /home/spelhate/home/mreport/frontend/templates - - DirectorySlash On - Require all granted - DirectoryIndex admin.html - \ No newline at end of file diff --git a/server_configurations/apache2/conf/noflask/mreport.conf b/server_configurations/apache2/conf/noflask/mreport.conf deleted file mode 100644 index 34dd60f..0000000 --- a/server_configurations/apache2/conf/noflask/mreport.conf +++ /dev/null @@ -1,18 +0,0 @@ -# Create pseudo /main.html page and use it -# in directory index and fallbackResource -# by this way it's possible to server /main.html -# with urls like /report/, /mreport/report1/, /mreport/report1/dataid... - -AliasMatch "^/main\.html$" "/home/spelhate/home/mreport/frontend/templates/index.html" - -Alias "/mreport" "/home/spelhate/home/mreport/backend/reports" - - - Require all granted - DirectoryIndex /main.html - FallbackResource /main.html - - FallbackResource disabled - - - diff --git a/server_configurations/apache2/mreport_conf1.conf b/server_configurations/apache2/mreport_conf1.conf index e7c0c56..f3e0d8a 100644 --- a/server_configurations/apache2/mreport_conf1.conf +++ b/server_configurations/apache2/mreport_conf1.conf @@ -1,2 +1,20 @@ -Include /home/spelhate/home/mreport/server_configurations/apache2/conf/common/*.conf -Include /home/spelhate/home/mreport/server_configurations/apache2/conf/flask/*.conf +ProxyPreserveHost On + + ProxyPass "http://127.0.0.1:5000/api/" + ProxyPassReverse "http://127.0.0.1:5000/api/" + + +Alias /static "${MREPORT_LOCATION}/frontend/static" + + Require all granted + + + + ProxyPass "http://127.0.0.1:5000/admin/" + ProxyPassReverse "http://127.0.0.1:5000/admin/" + + + + ProxyPass "http://127.0.0.1:5000/mreport/" + ProxyPassReverse "http://127.0.0.1:5000/mreport/" + diff --git a/server_configurations/apache2/mreport_conf2.conf b/server_configurations/apache2/mreport_conf2.conf index 34650e9..c343ba6 100644 --- a/server_configurations/apache2/mreport_conf2.conf +++ b/server_configurations/apache2/mreport_conf2.conf @@ -1,2 +1,36 @@ -Include /home/spelhate/home/mreport/server_configurations/apache2/conf/common/*.conf -Include /home/spelhate/home/mreport/server_configurations/apache2/conf/noflask/*.conf +ProxyPreserveHost On + + ProxyPass "http://127.0.0.1:5000/api/" + ProxyPassReverse "http://127.0.0.1:5000/api/" + + +Alias /static "${MREPORT_LOCATION}/frontend/static" + + Require all granted + + +Alias /admin "${MREPORT_LOCATION}/frontend/templates" + + DirectorySlash On + Require all granted + DirectoryIndex admin.html + + +# Create pseudo /main.html page and use it +# in directory index and fallbackResource +# by this way it's possible to server /main.html +# with urls like /report/, /mreport/report1/, /mreport/report1/dataid... + +AliasMatch "^/main\.html$" "${MREPORT_LOCATION}/frontend/templates/index.html" + +Alias "/mreport" "${MREPORT_LOCATION}/backend/reports" + + + Require all granted + DirectoryIndex /main.html + FallbackResource /main.html + + FallbackResource disabled + + +