Skip to content

Commit c43696f

Browse files
author
Kristan Kenney
committed
Add check for php-fpm during unassigned hosts configuration
1 parent 151ad39 commit c43696f

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

install/upgrade/0.9.8-28.sh

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,23 @@ chmod 751 $HESTIA/data/templates/web/unassigned/js
135135
chmod 751 $HESTIA/data/templates/web/unassigned/webfonts
136136

137137
# Add unassigned hosts configuration to nginx and apache2
138-
if [ -f /usr/local/hestia/data/ips/* ]; then
139-
for ip in /usr/local/hestia/data/ips/*; do
140-
ipaddr=${ip##*/}
141-
rm -f /etc/nginx/conf.d/$ip.conf
142-
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
143-
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
144-
145-
rm -f /etc/apache2/conf.d/$ip.conf
146-
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
147-
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
148-
done
138+
if [ "$WEB_BACKEND" = "php-fpm" ]; then
139+
echo "(!) Unassigned hosts configuration for Apache not necessary on PHP-FPM installations."
140+
elif [ "$WEB_BACKEND" = "apache2" ]; then
141+
if [ -f /usr/local/hestia/data/ips/* ]; then
142+
for ip in /usr/local/hestia/data/ips/*; do
143+
ipaddr=${ip##*/}
144+
rm -f /etc/nginx/conf.d/$ip.conf
145+
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
146+
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
147+
148+
rm -f /etc/apache2/conf.d/$ip.conf
149+
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
150+
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
151+
done
152+
fi
149153
fi
150-
154+
151155
# Set Purge to false in roundcube config - https://goo.gl/3Nja3u
152156
if [ -f /etc/roundcube/config.inc.php ]; then
153157
sed -i "s/\['flag_for_deletion'] = 'Purge';/\['flag_for_deletion'] = false;/gI" /etc/roundcube/config.inc.php
@@ -188,3 +192,4 @@ done
188192
if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
189193
mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
190194
fi
195+

0 commit comments

Comments
 (0)