File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Switch apache to remoteip module
3+
4+ # Checking rpaf config
5+ if [ ! -e " /etc/apache2/mods-enabled/rpaf.load" ]; then
6+ exit
7+ fi
8+
9+ # Checking remoteip module
10+ if [ ! -e " /etc/apache2/mods-available/remoteip.load" ]; then
11+ exit
12+ fi
13+
14+ # Disabling rpaf
15+ /usr/sbin/a2dismod rpaf > /dev/null 2>&1
16+ rm -f /etc/apache2/mods-enabled/rpaf.conf
17+
18+ # Enabling remoteip
19+ /usr/sbin/a2enmod remoteip > /dev/null 2>&1
20+
21+ # Creating configuration
22+ conf=" /etc/apache2/mods-enabled/remoteip.conf"
23+ echo " <IfModule remoteip_module>" > $conf
24+ echo " RemoteIPHeader X-Real-IP" >> $conf
25+ for ip in $( ls /usr/local/vesta/data/ips) ; do
26+ echo " RemoteIPInternalProxy $ip " >> $conf
27+ done
28+ echo " </IfModule>" >> $conf
29+
30+ # Restarting apache
31+ /usr/sbin/apachectl restart > /dev/null 2>&1
32+
33+ # EOF
34+ exit
You can’t perform that action at this time.
0 commit comments