Added fixes for rpm based system usage

This commit is contained in:
Alexey Berezhok
2024-04-14 22:48:16 +03:00
parent 68a01be7c3
commit 8bcf0d1d01
46 changed files with 351 additions and 118 deletions

View File

@@ -52,6 +52,10 @@ if [ -f "/etc/apache2/conf.d/hestia.conf" ]; then
echo "[ * ] Removing old Apache configuration file from previous version of Hestia Control Panel..."
rm -f /etc/apache2/conf.d/hestia.conf
fi
if [ -f "/etc/httpd/conf.h.d/hestia.conf" ]; then
echo "[ * ] Removing old Apache configuration file from previous version of Hestia Control Panel..."
rm -f /etc/httpd/conf.h.d/hestia.conf
fi
if [ -f "/etc/nginx/conf.d/hestia.conf" ]; then
echo "[ * ] Removing old NGINX configuration file from previous version of Hestia Control Panel..."
rm -f /etc/nginx/conf.d/hestia.conf

View File

@@ -6,6 +6,17 @@
####### Place additional commands below. #######
#######################################################################################
if [ "$WEB_SYSTEM" = "httpd" ]; then
confd="conf.h.d"
else
confd="conf.d"
fi
if [ "$PROXY_SYSTEM" = "httpd" ]; then
pconfd="conf.h.d"
else
pconfd="conf.d"
fi
# Add webmail alias variable to system configuration if non-existent
if [ -z "$WEBMAIL_ALIAS" ]; then
echo "[ * ] Updating webmail alias configuration..."
@@ -119,7 +130,7 @@ done
# Add unassigned hosts configuration to Nginx and Apache
for ipaddr in $($BIN/v-list-sys-ips plain | cut -f1); do
web_conf="/etc/$WEB_SYSTEM/conf.d/$ipaddr.conf"
web_conf="/etc/$WEB_SYSTEM/$confd/$ipaddr.conf"
rm -f $web_conf
if [ "$WEB_SYSTEM" = "apache2" ]; then
@@ -151,7 +162,7 @@ for ipaddr in $($BIN/v-list-sys-ips plain | cut -f1); do
| sed -e "s/%ip%/$ipaddr/g" \
-e "s/%web_port%/$WEB_PORT/g" \
-e "s/%proxy_port%/$PROXY_PORT/g" \
> /etc/$PROXY_SYSTEM/conf.d/$ipaddr.conf
> /etc/$PROXY_SYSTEM/$pconfd/$ipaddr.conf
fi
done

View File

@@ -197,13 +197,25 @@ chown root:root /var/log/$WEB_SYSTEM/domains/$WEBMAIL_ALIAS* > /dev/null 2>&1
if [ "$IMAP_SYSTEM" = "dovecot" ]; then
echo "[ * ] Enabling IMAP quota information reporting..."
if [ -e /etc/dovecot/conf.d/20-pop3.conf ]; then
cp -f $HESTIA/install/deb/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf
if [ -e /etc/redhat-release ]; then
cp -f $HESTIA/install/rpm/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf
else
cp -f $HESTIA/install/deb/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf
fi
fi
if [ -e /etc/dovecot/conf.d/20-imap.conf ]; then
cp -f $HESTIA/install/deb/dovecot/conf.d/20-imap.conf /etc/dovecot/conf.d/20-imap.conf
if [ -e /etc/redhat-release ]; then
cp -f $HESTIA/install/rpm/dovecot/conf.d/20-imap.conf /etc/dovecot/conf.d/20-imap.conf
else
cp -f $HESTIA/install/deb/dovecot/conf.d/20-imap.conf /etc/dovecot/conf.d/20-imap.conf
fi
fi
if [ -e /etc/dovecot/conf.d/90-quota.conf ]; then
cp -f $HESTIA/install/deb/dovecot/conf.d/90-quota.conf /etc/dovecot/conf.d/90-quota.conf
if [ -e /etc/redhat-release ]; then
cp -f $HESTIA/install/deb/dovecot/conf.d/90-quota.conf /etc/dovecot/conf.d/90-quota.conf
else
cp -f $HESTIA/install/deb/dovecot/conf.d/90-quota.conf /etc/dovecot/conf.d/90-quota.conf
fi
fi
fi
@@ -222,3 +234,6 @@ fi
if [ -e /etc/apache2/conf.d/roundcube.conf ]; then
rm -f /etc/apache2/conf.d/roundcube.conf
fi
if [ -e /etc/httpd/conf.h.d/roundcube.conf ]; then
rm -f /etc/httpd/conf.h.d/roundcube.conf
fi

View File

@@ -26,6 +26,10 @@ if [ -n "$DB_PMA_ALIAS" ]; then
rm /etc/apache2/conf.d/phpmyadmin.conf
touch /etc/apache2/conf.d/phpmyadmin.inc
fi
if [ -e "/etc/httpd/conf.h.d/phpmyadmin.conf" ]; then
rm /etc/httpd/conf.h.d/phpmyadmin.conf
touch /etc/httpd/conf.h.d/phpmyadmin.inc
fi
$HESTIA/bin/v-change-sys-db-alias 'pma' "$DB_PMA_ALIAS"
fi
@@ -34,6 +38,10 @@ if [ -n "$DB_PGA_ALIAS" ]; then
rm /etc/apache2/conf.d/phppgadmin.conf
touch /etc/apache2/conf.d/phppgadmin.inc
fi
if [ -e "/etc/httpd/conf.h.d/phppgadmin.conf" ]; then
rm /etc/httpd/conf.h.d/phppgadmin.conf
touch /etc/httpd/conf.h.d/phppgadmin.inc
fi
$HESTIA/bin/v-change-sys-db-alias 'pga' "$DB_PGA_ALIAS"
fi

View File

@@ -44,3 +44,10 @@ if [ "$WEB_SYSTEM" = "apache2" ]; then
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
if [ "$WEB_SYSTEM" = "httpd" ]; then
if ! (grep -q "$WEBMAIL_ALIAS.*.conf" /etc/httpd/conf/httpd.conf); then
echo "[ * ] Update /etc/httpd/conf/httpd.conf..."
sed -i "s/IncludeOptional conf.d\/domains\/\*.conf/IncludeOptional conf.d\/domains\/$WEBMAIL_ALIAS.*.conf\nIncludeOptional conf.d\/domains\/\*.conf/g" /etc/httpd/conf/httpd.conf
fi
fi