Jump to content
  • 0

Ip Address Shows As Server Ip For Everything.


phireuk

Question

All IP addresses for customers, myself and anything shows as my VPS IP address.

 

For example here is a password reset i tested on a public proxy.

 

Someone at the IP address (my.server.ip.address) requested a password reset for your account.

 

Any ideas.  I did add the geo.dat file if it make any difference. regardless the IP shows the same in emails and in blease whether it's enabled or disabled.

geo.png

 

Sorry to spam the board :blesta:

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Found the solution.  Thanks for your help max. 

 

https://forum.vestacp.com/viewtopic.php?f=10&t=6650

 

Here is the quote from the VestaCP forum.

 

 

Remove rpaf that doesn't work.
 

apt-get remove libapache2-mod-rpaf

create the file remoteip.conf
 

vim /etc/apache2/mods-available/remoteip.conf
the file should say this.
<IfModule mod_remoteip.c>
RemoteIPHeader X-Real-IP
RemoteIPInternalProxy 127.0.0.1
RemoteIPInternalProxy xxx.xxx.xxx.xxx      (add your server IP here)
</IfModule>

save the file.

Activate remoteip which is native in Apache 2.4

a2enmod remoteip
service apache2 restart


Now works perfectly... :blesta:

Link to comment
Share on other sites

  • 0

Using a reverse proxy setup (e.g. nginx in front of Apache)?

 

Wow that was quick... and as for nginx, yes that would be true sir. :blesta:

  It didn't even cross my mind, thanks for pointing it out.

 

So is there a work around you know of? 

 

 searching google comes up with a few things, but if you have experience maybe you can point me i the right direction?

 

EDIT:  I guess i need to set my IP as a trused proxy.  But not sure how

Link to comment
Share on other sites

  • 0

I found this on a different forum

https://forum.vestacp.com/viewtopic.php?f=11&t=6760

 

Im using vestaCP

1) a2enmod remoteip
2) create an config file under /etc/apache2/mods-available named remoteip.conf
3)add the following lines
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 127.0.0.1 your.proxy.server.ip
4) link the file under /etc/apache2/mods-enabled
5) service apache2 restart

 

Step 4 im usure what he / she means. 

I assumed he meant make a symbolic link.  so i tried from the directory where I made the conf file...

 ln -s remoteip.conf /etc/apache2/mods-enabled/remoteip.conf

 but when restarting apache i got the warning

 * Restarting web server apache2                                         [fail]
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 71 of /etc/apache2/apache2.conf: 
Could not open configuration file /etc/apache2/mods-enabled/remoteip.conf: Too many levels of symbolic links
Action 'configtest' failed.
The Apache error log may have more information.

And on line 71

Include mods-enabled/*.conf
 

 

Im lost, greatful for any help. :blesta:

Edit: I realise it's not a blesta issue now.

Link to comment
Share on other sites

  • 0

I found this on a different forum

https://forum.vestacp.com/viewtopic.php?f=11&t=6760

 

Im using vestaCP

1) a2enmod remoteip

2) create an config file under /etc/apache2/mods-available named remoteip.conf

3)add the following lines

RemoteIPHeader X-Forwarded-For

RemoteIPTrustedProxy 127.0.0.1 your.proxy.server.ip

4) link the file under /etc/apache2/mods-enabled

5) service apache2 restart

 

Step 4 im usure what he / she means. 

I assumed he meant make a symbolic link.  so i tried from the directory where I made the conf file...

 ln -s remoteip.conf /etc/apache2/mods-enabled/remoteip.conf

 

The target is not relative to the current working directory, but to the link. So with your command you are making it point to itself, which will not work as intended.

Try instead:

ln -sf ../mods-available/remoteip.conf /etc/apache2/mods-enabled/remoteip.conf

Pretty sure a2enmod also creates the link though, provided remoteip.conf exists.

So might be easier to swap step 1 and 2. Create remoteip.conf first, then run a2enmod...

 

Also check your nginx config and verify that the client IP is passed through X-Forwarded-For matching the Apache configuration you quote (and not some other header like X-Client-IP)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...