Client IP address incorrect, reverts to server IP

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
5chn3ll
Registered User
Posts: 6
Joined: Mon Mar 19, 2018 1:27 am

Client IP address incorrect, reverts to server IP

Post by 5chn3ll » Fri May 25, 2018 6:24 pm

I've found a lot of traffic around this topic, but not the magic bullet so far.

I'm running phpBB on a GoDaddy server. The install works perfectly except one issue: the client IP address is always wrong. Clients always show an IP address in the GoDaddy IP range instead of the actual IP address.

When I echo back HTTP_X_FORWARDED_FOR, the results include my correct IP address, but the address is prepended with :ffff:. Presumably it's the :ffff: that prevents the address from parsing correctly.

To see this in action, visit 996outpost.com/ipcheck.php. The PHP echoes three values: SERVER_ADDR, REMOTE_ADDR, and HTTP_X_FORWADED_FOR.

REMOTE_ADDR is always incorrect; it's always the same value as SERVER_ADDR.

Is there a solution to this? None of the user verification extensions will work properly since each visitor's IP is erroneously indicated as the server IP.

I have found a couple of threads, one suggesting changes to startup.php and another with a line added to session.php, but neither helped out.

Thanks in advance for pointing me in the right direction.

User avatar
Lumpy Burgertushie
Registered User
Posts: 65036
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Client IP address incorrect, reverts to server IP

Post by Lumpy Burgertushie » Fri May 25, 2018 6:25 pm

try turning off cloudfare in your hosting control panel and see what happens.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

5chn3ll
Registered User
Posts: 6
Joined: Mon Mar 19, 2018 1:27 am

Re: Client IP address incorrect, reverts to server IP

Post by 5chn3ll » Fri May 25, 2018 6:31 pm

I can't find this setting anywhere - I'd seen a similar post, but I can't find anything related to site acceleration...

5chn3ll
Registered User
Posts: 6
Joined: Mon Mar 19, 2018 1:27 am

Re: Client IP address incorrect, reverts to server IP

Post by 5chn3ll » Fri May 25, 2018 6:38 pm

Per GoDaddy's documentation, website acceleration is no longer offered to new accounts.

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2797
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Client IP address incorrect, reverts to server IP

Post by thecoalman » Sat May 26, 2018 5:16 am

The IP address being reported by the script is not a Cloudflare IP so that is not the issue, it's one reserved for internal networks. This is misconfigured server or something else that needs to be resolved by Godaddy support.

User avatar
3Di
Registered User
Posts: 12946
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Client IP address incorrect, reverts to server IP

Post by 3Di » Sat May 26, 2018 2:49 pm

I see you are running Apache, try this inside your script:

Code: Select all

if (function_exists('apache_request_headers'))
{
	$headers = apache_request_headers();
	$real_client_ip = $headers["X-Forwarded-For"];
	echo 'Real client IP: ' . $real_client_ip;
}
else
{
	echo 'Unable to find the function apache_request_headers';
}
Just written but tested..
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 49557
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Client IP address incorrect, reverts to server IP

Post by stevemaury » Sat May 26, 2018 3:00 pm

It's a feature, not a bug. Now you are more GDPR compliant.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. PM or email me.

All unsolicited PMs will be ignored.

User avatar
3Di
Registered User
Posts: 12946
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Client IP address incorrect, reverts to server IP

Post by 3Di » Sun May 27, 2018 4:57 am

stevemaury wrote:
Sat May 26, 2018 3:00 pm
It's a feature, not a bug. Now you are more GDPR compliant.
The point is
5chn3ll wrote:
Fri May 25, 2018 6:24 pm
None of the user verification extensions will work properly since each visitor's IP is erroneously indicated as the server IP.
Which IMO deserves to get a little help if possible, that's what I am trying to do here.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Mick
Support Team Member
Support Team Member
Posts: 20125
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Client IP address incorrect, reverts to server IP

Post by Mick » Sun May 27, 2018 7:57 am

What have godaddy got to say about it?
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: canonknipser, EA117, jgs240, kasimi, KevC, kimtieuphuong, Marcyyy, shortmort37 and 50 guests