Skip to content

Commit cff710e

Browse files
committed
Fix: Move webserver config for unassigned domains to v-add-sys-ip from installer
1 parent 33b1bcc commit cff710e

File tree

4 files changed

+13
-40
lines changed

4 files changed

+13
-40
lines changed

bin/v-add-sys-ip

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,21 @@ if [ ! -z "$WEB_SYSTEM" ]; then
130130
echo "NameVirtualHost $ip:$WEB_PORT" > $web_conf
131131
fi
132132
echo "Listen $ip:$WEB_PORT" >> $web_conf
133+
cat $HESTIA/install/deb/apache2/unassigned.conf >> $web_conf
134+
sed -i 's/directIP/'$ip'/g' $web_conf
135+
sed -i 's/directPORT/'$WEB_PORT'/g' $web_conf
136+
137+
elif [ "$WEB_SYSTEM" = 'nginx' ]; then
138+
cp -f $HESTIA/install/deb/nginx/unassigned.inc $web_conf
139+
sed -i 's/directIP/'$ip'/g' $web_conf
133140
fi
134141

135142
if [ "$WEB_SSL" = 'mod_ssl' ]; then
136143
if [ -z "$(/usr/sbin/apachectl -v | grep Apache/2.4)" ]; then
137-
echo "NameVirtualHost $ip:$WEB_SSL_PORT" >> $web_conf
144+
sed -i "1s/^/NameVirtualHost $ip:$WEB_SSL_PORT\n/" $web_conf
138145
fi
139-
echo "Listen $ip:$WEB_SSL_PORT" >> $web_conf
146+
sed -i "1s/^/Listen $ip:$WEB_SSL_PORT\n/" $web_conf
147+
sed -i 's/directSSLPORT/'$WEB_SSL_PORT'/g' $web_conf
140148
fi
141149
fi
142150

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
Listen directIP:8080
2-
Listen directIP:8443
3-
4-
<VirtualHost directIP:80>
1+
<VirtualHost directIP:directPORT>
52

63
DocumentRoot /var/www/html/
74
Alias /error/ /var/www/document_errors/
85

96
</VirtualHost>
107

11-
<VirtualHost directIP:443>
8+
<VirtualHost directIP:directSSLPORT>
129

1310
DocumentRoot /var/www/html/
1411
Alias /error/ /var/www/document_errors/
1512

16-
</VirtualHost>
13+
</VirtualHost>

install/hst-install-debian.sh

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,22 +1662,6 @@ if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
16621662
ip=$pub_ip
16631663
fi
16641664

1665-
# Add unassigned hosts configuration to webserver
1666-
for ip in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
1667-
1668-
if [ "$apache" = 'yes' ]; then
1669-
rm -f /etc/apache2/conf.d/$ip.conf
1670-
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ip.conf
1671-
sed -i 's/directIP/'$ip'/g' /etc/apache2/conf.d/$ip.conf
1672-
fi
1673-
1674-
if [ "$nginx" = 'yes' ]; then
1675-
rm -f /etc/nginx/conf.d/$ip.conf
1676-
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ip.conf
1677-
sed -i 's/directIP/'$ip'/g' /etc/nginx/conf.d/$ip.conf
1678-
fi
1679-
done
1680-
16811665
# Configuring libapache2-mod-remoteip
16821666
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
16831667
cd /etc/apache2/mods-available

install/hst-install-ubuntu.sh

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,22 +1589,6 @@ if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
15891589
ip=$pub_ip
15901590
fi
15911591

1592-
# Add unassigned hosts configuration to webserver
1593-
for ip in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
1594-
1595-
if [ "$apache" = 'yes' ]; then
1596-
rm -f /etc/apache2/conf.d/$ip.conf
1597-
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ip.conf
1598-
sed -i 's/directIP/'$ip'/g' /etc/apache2/conf.d/$ip.conf
1599-
fi
1600-
1601-
if [ "$nginx" = 'yes' ]; then
1602-
rm -f /etc/nginx/conf.d/$ip.conf
1603-
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ip.conf
1604-
sed -i 's/directIP/'$ip'/g' /etc/nginx/conf.d/$ip.conf
1605-
fi
1606-
done
1607-
16081592
# Configuring MariaDB host
16091593
if [ "$mysql" = 'yes' ]; then
16101594
$HESTIA/bin/v-add-database-host mysql localhost root $mpass

0 commit comments

Comments
 (0)