Skip to content

Commit d61b4f3

Browse files
Merge branch 'master' of github.com:serghey-rodin/vesta
2 parents 7cdbe58 + 5356e95 commit d61b4f3

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

install/vst-install-debian.sh

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ vestacp="http://$CHOST/$VERSION/$release"
2020

2121
if [ "$release" -eq 8 ]; then
2222
software="nginx apache2 apache2-utils apache2.2-common
23-
apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf
23+
apache2-suexec-custom libapache2-mod-ruid2
2424
libapache2-mod-fcgid libapache2-mod-php5 php5 php5-common php5-cgi
2525
php5-mysql php5-curl php5-fpm php5-pgsql awstats webalizer vsftpd
2626
proftpd-basic bind9 exim4 exim4-daemon-heavy clamav-daemon
@@ -32,7 +32,7 @@ if [ "$release" -eq 8 ]; then
3232
bsdmainutils cron vesta vesta-nginx vesta-php expect"
3333
else
3434
software="nginx apache2 apache2-utils apache2.2-common
35-
apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf
35+
apache2-suexec-custom libapache2-mod-ruid2
3636
libapache2-mod-fcgid libapache2-mod-php5 php5 php5-common php5-cgi
3737
php5-mysql php5-curl php5-fpm php5-pgsql awstats webalizer vsftpd
3838
proftpd-basic proftpd-mod-vroot bind9 exim4 exim4-daemon-heavy
@@ -527,7 +527,6 @@ if [ "$apache" = 'no' ]; then
527527
software=$(echo "$software" | sed -e "s/apache2-suexec-custom//")
528528
software=$(echo "$software" | sed -e "s/apache2.2-common//")
529529
software=$(echo "$software" | sed -e "s/libapache2-mod-ruid2//")
530-
software=$(echo "$software" | sed -e "s/libapache2-mod-rpaf//")
531530
software=$(echo "$software" | sed -e "s/libapache2-mod-fcgid//")
532531
software=$(echo "$software" | sed -e "s/libapache2-mod-php5//")
533532
fi
@@ -830,6 +829,7 @@ if [ "$apache" = 'yes' ]; then
830829
a2enmod ssl
831830
a2enmod actions
832831
a2enmod ruid2
832+
a2enmod headers
833833
mkdir -p /etc/apache2/conf.d
834834
echo > /etc/apache2/conf.d/vesta.conf
835835
echo "# Powered by vesta" > /etc/apache2/sites-available/default
@@ -1164,9 +1164,9 @@ $VESTA/bin/v-change-user-language admin $lang
11641164

11651165
# RoundCube permissions fix
11661166
if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
1167-
if [ ! -d "/var/log/roundcube" ]; then
1168-
mkdir /var/log/roundcube
1169-
fi
1167+
if [ ! -d "/var/log/roundcube" ]; then
1168+
mkdir /var/log/roundcube
1169+
fi
11701170
chown admin:admin /var/log/roundcube
11711171
fi
11721172

@@ -1175,17 +1175,39 @@ $VESTA/bin/v-update-sys-ip
11751175

11761176
# Get main ip
11771177
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
1178+
copy_of_ip=$ip
1179+
1180+
# Firewall configuration
1181+
if [ "$iptables" = 'yes' ]; then
1182+
$VESTA/bin/v-update-firewall
1183+
fi
11781184

11791185
# Get public ip
11801186
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
1187+
11811188
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
11821189
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
11831190
ip=$pub_ip
11841191
fi
11851192

1186-
# Firewall configuration
1187-
if [ "$iptables" = 'yes' ]; then
1188-
$VESTA/bin/v-update-firewall
1193+
# Configuring libapache2-mod-remoteip
1194+
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
1195+
copy_of_pub_ip=$pub_ip
1196+
echo "<IfModule mod_remoteip.c>" > /etc/apache2/mods-available/remoteip.conf
1197+
echo " RemoteIPHeader X-Real-IP" >> /etc/apache2/mods-available/remoteip.conf
1198+
if [ "$copy_of_ip" != "127.0.0.1" ] && [ "$copy_of_pub_ip" != "127.0.0.1" ]; then
1199+
echo " RemoteIPInternalProxy 127.0.0.1" >> /etc/apache2/mods-available/remoteip.conf
1200+
fi
1201+
if [ ! -z "$copy_of_ip" ] && [ "$copy_of_ip" != "$copy_of_pub_ip" ]; then
1202+
echo " RemoteIPInternalProxy $copy_of_ip" >> /etc/apache2/mods-available/remoteip.conf
1203+
fi
1204+
if [ ! -z "$copy_of_pub_ip" ]; then
1205+
echo " RemoteIPInternalProxy $copy_of_pub_ip" >> /etc/apache2/mods-available/remoteip.conf
1206+
fi
1207+
echo "</IfModule>" >> /etc/apache2/mods-available/remoteip.conf
1208+
sed -i "s/LogFormat \"%h/LogFormat \"%a/g" /etc/apache2/apache2.conf
1209+
a2enmod remoteip
1210+
service apache2 restart
11891211
fi
11901212

11911213
# Configuring mysql host

0 commit comments

Comments
 (0)