Browse Source

Give priority to webmail.*.conf (#3400)

Jaap Marcus 3 years ago
parent
commit
7237cafd23

+ 4 - 0
bin/v-change-sys-webmail

@@ -51,6 +51,10 @@ for user in $($BIN/v-list-sys-users plain); do
 	done
 done
 
+if [ -d /etc/apache2/ ]; then
+	sed -i "s/IncludeOptional conf.d\/domains\/$WEBMAIL_ALIAS.*.conf/IncludeOptional conf.d\/domains\/$NEW_ALIAS.*.conf/g" /etc/apache2/apache2.conf
+fi
+
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 1 - 0
install/deb/apache2/apache2.conf

@@ -81,6 +81,7 @@ LogFormat "%{User-agent}i" agent
 LogFormat "%b" bytes
 
 IncludeOptional conf.d/*.conf
+IncludeOptional conf.d/domains/webmail.*.conf
 IncludeOptional conf.d/domains/*.conf
 
 # Include the virtual host configurations:

+ 1 - 0
install/rpm/httpd/httpd.conf

@@ -70,6 +70,7 @@ LogFormat "%{User-agent}i" agent
 LogFormat "%b" bytes
 
 Include conf.d/*.conf
+IncludeOptional conf.d/domains/webmail.*.conf
 IncludeOptional conf.d/domains/*.conf
 
 ErrorDocument 403 /error/403.html

+ 7 - 0
install/upgrade/versions/1.7.1.sh

@@ -37,3 +37,10 @@ if [ "$FIREWALL_SYSTEM" = "iptables" ]; then
 		sed -i 's|/install/deb/firewall/ipset/blacklist.sh|/install/common/firewall/ipset/blacklist.sh|g' $HESTIA/data/firewall/ipset.conf
 	fi
 fi
+
+if [ "$WEB_SYSTEM" = "apache2" ]; then
+	if ! (grep -q "$WEBMAIL_ALIAS.*.conf" /etc/apache2/apache2.conf); then
+		echo "[ * ] Update /etc/apache2/apache2.conf..."
+		sed -i "s/IncludeOptional conf.d\/domains\/\*.conf/IncludeOptional conf.d\/domains\/$WEBMAIL_ALIAS.*.conf\nIncludeOptional conf.d\/domains\/\*.conf/g" /etc/apache2/apache2.conf
+	fi
+fi