fix 'httpd' directory that is the same as 'apache2'

This commit is contained in:
Adrien Marquès 2018-06-11 16:45:59 +02:00
parent 156df26412
commit 2935bf6aa6
1 changed files with 11 additions and 4 deletions

View File

@ -150,10 +150,13 @@ else
fi; fi;
echo; 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"; inline_progress " . config root";
http_root="/etc/$http_installer";
if [ -d "$http_root" ]; then if [ -d "$http_root" ]; then
echo "ok"; echo "ok";
else else
@ -162,7 +165,7 @@ else
exit 1; exit 1;
fi; fi;
# 6. configuration structure # 7. configuration structure
inline_progress " . config tree"; inline_progress " . config tree";
if [ -d "$http_root/sites-available" -a -d "$http_root/sites-enabled" ]; then 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 # 1. Copy configuration
echo -n " - create proxy configuration "; echo -n " - create proxy configuration ";
if [ "$http_installer" = "apache2" ]; then if [ "$http_installer" = "apache2" -o "$http_installer" = "httpd" ]; then
echo """<VirtualHost *:80> echo """<VirtualHost *:80>
ServerName $host ServerName $host
ServerAlias www.$host ServerAlias www.$host
@ -302,6 +305,10 @@ elif [ "$http_installer" = "nginx" ]; then
proxy_pass http://127.0.0.1:$port; proxy_pass http://127.0.0.1:$port;
} }
}""" | sudo tee $http_root/sites-available/$host.reverse-proxy > /dev/null; }""" | 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; fi;
# manage error # manage error