Ver Fonte

Fix #2104 v-change-web-domain-name

Jaap Marcus há 4 anos atrás
pai
commit
9161b9b126
2 ficheiros alterados com 22 adições e 4 exclusões
  1. 1 0
      CHANGELOG.md
  2. 21 4
      bin/v-change-web-domain-name

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
 ### Bugfixes
 - Improve the hostname check to prevent invalid hostnames or the use of an ip address (RFC1178).
 - Add small wait for /usr/bin/iptables-restore [Forum](https://forum.hestiacp.com/t/clean-install-arm64-does-not-start-after-reboot-v-start-service-iptables/4395/7)
+- Fixed 2104 v-change-web-domain-name unable to start webserver
 
 ## [1.4.12] - Service release 
 

+ 21 - 4
bin/v-change-web-domain-name

@@ -85,13 +85,30 @@ rm -f $HOMEDIR/$user/web/$new_domain/logs/$domain.*
 # Updating domain certificates
 if [ -e "$USER_DATA/ssl/$domain.crt" ]; then
     cd $USER_DATA/ssl
-    mv $domain.crt $new_domain.crt
-    mv $domain.ca $new_domain.ca
-    mv $domain.pem $new_domain.pem
-    mv $domain.key $new_domain.key
+    mv $USER_DATA/ssl/$domain.crt $USER_DATA/ssl/$new_domain.crt
+    mv $USER_DATA/ssl/$domain.ca $USER_DATA/ssl/$new_domain.ca
+    mv $USER_DATA/ssl/$domain.pem $USER_DATA/ssl/$new_domain.pem
+    mv $USER_DATA/ssl/$domain.key $USER_DATA/ssl/$new_domain.key
     rm -f $HOMEDIR/$user/conf/web/$domain/ssl/$domain.*
 fi
 
+# Deleting vhost configuration
+del_web_config "$WEB_SYSTEM" "$TPL.tpl"
+# Deleting SSL configuration and certificates
+if [ "$SSL" = 'yes' ]; then
+    del_web_config "$WEB_SYSTEM" "$TPL.stpl"
+fi
+
+# Deleting proxy
+if [ ! -z "$PROXY_SYSTEM" ]; then
+    del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
+    if [ "$SSL" = 'yes' ]; then
+        del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
+    fi
+    if [ -e "/etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf" ]; then
+        sed -i "/=$domain:/d" /etc/$PROXY_SYSTEM/conf.d/01_caching_pool.conf
+    fi
+fi
 
 #----------------------------------------------------------#
 #                       Hestia                             #