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

Incorrect IP address PHP

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
Pilovali
Posts: 9
Joined: Mon Apr 13, 2015 1:52 pm

Incorrect IP address PHP
  • Quote

Post by Pilovali » Fri Apr 07, 2017 6:02 pm

Heya,

If I use the following code:

Code: Select all

<?php
echo $_SERVER['REMOTE_ADDR'];
?>
Then I'm seeing the IP address of my webserver. However, HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR does show the correct IP address.
I am not going to replace all my scripts with that. I just want it to give the correct IP via REMOTE_ADDR.

It's a clean installation on Ubuntu 16.04 minimal. All latests updates and PHP 7.

Does anybody knows how to fix this?
Top

Pilovali
Posts: 9
Joined: Mon Apr 13, 2015 1:52 pm

Re: Incorrect IP address PHP
  • Quote

Post by Pilovali » Fri Apr 07, 2017 6:41 pm

I fixed it myself. For future references:

Run the following:

Code: Select all

wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/upd/switch_rpath.sh
chmod +x switch_rpath.sh
./switch_rpath.sh
Source:
viewtopic.php?t=13817#p56361
viewtopic.php?f=10&t=13499&p=54963&hili ... .sh#p54963
Top


Post Reply
  • Print view

2 posts • 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