Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Replacing rpaf module with remoteip

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
plutocrat
Posts: 232
Joined: Fri Jan 27, 2017 9:16 am

Os: Ubuntu 17x
Web: apache + nginx
Replacing rpaf module with remoteip
  • Quote

Post by plutocrat » Fri Nov 02, 2018 8:36 am

I've had a small niggling problem for a few months, but haven't got around to fixing it until now. In the default apache+nginx installation for Ubuntu, the module libapache2-mod-rpaf is installed. This works OK up to a point: it logs the correct remote IP in the server logs in /var/log/apache2/domains/. However the apache traffic report at https://your.server.address:8083/list/server/?web shows the incorrect IP address: that of the server itself.
[If you can't find this, its
Dashboard > Server > SHOW CPU/NET/MEM/DISK > Web
I used VestaCP for around a year before I discovered this section! ]

So it seems the way to fix this is to replace rpaf with remoteip. Here are the steps:
nano /etc/apache2/mods-available/remoteip.conf

and add these lines replacing the IP address with the IP address of your server.

Code: Select all

<IfModule remoteip_module>
    RemoteIPHeader X-Forwarded-For
    RemoteIPInternalProxy 22.33.44.55 
</IfModule>
Now swap the modules over, but don't restart apache yet.

Code: Select all

a2dismod rpaf
a2enmod remoteip
Now open up /etc/apache2/apache2.conf and alter the Logfile format. Find these lines

Code: Select all

LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
and change the %h at the beginning of each one to %a

Code: Select all

LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%a %l %u %t \"%r\" %>s %O" common
Test:

Code: Select all

apachectl -t
Restart apache

Code: Select all

systemctl restart apache2.service
Check the logfiles to make sure the correct IP addresses are appearing. And then check the apache status page.
https://your.server.address:8083/list/server/?web
Top


Post Reply
  • Print view
1 post • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password