From 2935bf6aa60b098790560487b81f993a81ac8f59 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 11 Jun 2018 16:45:59 +0200 Subject: [PATCH] fix 'httpd' directory that is the same as 'apache2' --- install-scripts/installer | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install-scripts/installer b/install-scripts/installer index bff811a..0bdeb44 100644 --- a/install-scripts/installer +++ b/install-scripts/installer @@ -150,10 +150,13 @@ else fi; echo; -# 5. configuration root dir +# 5. 'httpd' is service name, but config dir is apache2 +http_root="/etc/$http_installer"; +test "$http_installer" = "httpd" && http_root="/etc/apache2"; + +# 6. configuration root dir inline_progress " . config root"; -http_root="/etc/$http_installer"; if [ -d "$http_root" ]; then echo "ok"; else @@ -162,7 +165,7 @@ else exit 1; fi; -# 6. configuration structure +# 7. configuration structure inline_progress " . config tree"; if [ -d "$http_root/sites-available" -a -d "$http_root/sites-enabled" ]; then @@ -281,7 +284,7 @@ inline_progress " * $http_installer"; echo; # 1. Copy configuration echo -n " - create proxy configuration "; -if [ "$http_installer" = "apache2" ]; then +if [ "$http_installer" = "apache2" -o "$http_installer" = "httpd" ]; then echo """ ServerName $host ServerAlias www.$host @@ -302,6 +305,10 @@ elif [ "$http_installer" = "nginx" ]; then proxy_pass http://127.0.0.1:$port; } }""" | sudo tee $http_root/sites-available/$host.reverse-proxy > /dev/null; +else + echo "error"; + echo -e "\n\e[31m/!\\\\\e[0m no installer matches '$http_installer'. aborting installation"; + exit 1; fi; # manage error