From 46cbe012f6f6d32a5c19d7c029a0513d51efb22b Mon Sep 17 00:00:00 2001 From: Abdelrahman Hamada Date: Mon, 1 Jun 2020 17:53:02 +0300 Subject: [PATCH 1/2] Fix Apache2 WSL2 access --- virtualhost.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualhost.sh b/virtualhost.sh index 936f092..736aaea 100755 --- a/virtualhost.sh +++ b/virtualhost.sh @@ -106,7 +106,7 @@ if [ "$action" == 'create' ] ### Add domain in /mnt/c/Windows/System32/drivers/etc/hosts (Windows Subsytem for Linux) if [ -e /mnt/c/Windows/System32/drivers/etc/hosts ] then - if ! echo -e "\r127.0.0.1 $domain" >> /mnt/c/Windows/System32/drivers/etc/hosts + if ! echo -e "\r127.0.0.1 $domain\r::1 $domain" >> /mnt/c/Windows/System32/drivers/etc/hosts then echo $"ERROR: Not able to write in /mnt/c/Windows/System32/drivers/etc/hosts (Hint: Try running Bash as administrator)" else From 786138f4c9b3cb43e5e466e7376e5b592b271335 Mon Sep 17 00:00:00 2001 From: hwaien Date: Wed, 31 Mar 2021 09:06:51 -0700 Subject: [PATCH 2/2] Update virtualhost-nginx.sh --- virtualhost-nginx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtualhost-nginx.sh b/virtualhost-nginx.sh index 711167a..72aad10 100644 --- a/virtualhost-nginx.sh +++ b/virtualhost-nginx.sh @@ -144,7 +144,7 @@ if [ "$action" == 'create' ] ln -s $sitesAvailable$domain $sitesEnable$domain ### restart Nginx - service nginx restart + systemctl reload nginx ### show the finished message echo -e $"Complete! \nYou now have a new Virtual Host \nYour new host is: http://$domain \nAnd its located at $rootDir" @@ -170,7 +170,7 @@ if [ "$action" == 'create' ] rm $sitesEnable$domain ### restart Nginx - service nginx restart + systemctl reload nginx ### Delete virtual host rules files rm $sitesAvailable$domain