mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Switch from rpaf to remoteip module
This commit is contained in:
parent
e472a33b23
commit
7d702f8cf3
1 changed files with 34 additions and 0 deletions
34
upd/switch_rpath.sh
Executable file
34
upd/switch_rpath.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
# Switch apache to remoteip module
|
||||
|
||||
# Checking rpaf config
|
||||
if [ ! -e "/etc/apache2/mods-enabled/rpaf.load" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# Checking remoteip module
|
||||
if [ ! -e "/etc/apache2/mods-available/remoteip.load" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# Disabling rpaf
|
||||
/usr/sbin/a2dismod rpaf > /dev/null 2>&1
|
||||
rm -f /etc/apache2/mods-enabled/rpaf.conf
|
||||
|
||||
# Enabling remoteip
|
||||
/usr/sbin/a2enmod remoteip > /dev/null 2>&1
|
||||
|
||||
# Creating configuration
|
||||
conf="/etc/apache2/mods-enabled/remoteip.conf"
|
||||
echo "<IfModule remoteip_module>" > $conf
|
||||
echo " RemoteIPHeader X-Real-IP" >> $conf
|
||||
for ip in $(ls /usr/local/vesta/data/ips); do
|
||||
echo " RemoteIPInternalProxy $ip" >> $conf
|
||||
done
|
||||
echo "</IfModule>" >> $conf
|
||||
|
||||
# Restarting apache
|
||||
/usr/sbin/apachectl restart > /dev/null 2>&1
|
||||
|
||||
# EOF
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue