• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

REMOTE_ADDR WRONG IP

Bogdan1

Regular Pleskian
Hey,

I have a problem, $_SERVER['REMOTE_ADDR']; return not user IP but server(hosting) ip.
I have Plesk 12.5 php 5.6.

Where could be the problem?

PS: I know, I can use $_SERVER['HTTP_X_FORWARDED_FOR'] , but php framework use REMOTE_ADDR
 
Hi @Bogdan1!

Unfortunately, I cannot reproduce your issue on our test environment.

Could you please provide more details:
1. Your OS
2. Used PHP handler. I see it's 5.6 but it can be FastCGI/PHP-FPM server by Apache 2.4/PHP-FPM server by nginx. You can post screenshot of current values on PHP Settings screen of your domain.
 
Hi @Bogdan1!

Unfortunately, I cannot reproduce your issue on our test environment.

Could you please provide more details:
1. Your OS
2. Used PHP handler. I see it's 5.6 but it can be FastCGI/PHP-FPM server by Apache 2.4/PHP-FPM server by nginx. You can post screenshot of current values on PHP Settings screen of your domain.

Sorry @vlikhtanskiy, I forgot.

OS: Centos 6
PHP Handler is FastCGI by Apache

V6kDGlh.png
 
Last edited:
Hello,

Looks like mod_rpaf (or remoteip on apache2.4) doesn't enabled. To check:

Code:
# apachectl -M | grep rpaf
Syntax OK
rpaf_module (shared)

If you don't see rpaf_module word in output, you should enable it either by re-enabling nginx or issue the command plesk sbin httpd_modules_ctl --enable rpaf
 
Hi everyone,

I'm having the same problem. When I turn off nginx, all IPv6 addresses are displayed correctly but when I turn on nginx again, only the server IPv6 address is shown.
I've tried the command 'plesk sbin httpd_modules_ctl --enable rpaf' but this doesn't solve the problem.

Does somebody know how to fix this issue?

I'm using Plesk 12.5.30 Update #8 on CentOS 6.7
PHP 5.6.14 with FastCGI served by Apache.

Thanks!
 
Hey PeterM,

long time since Otc 2015... Just in case the Problem is still persiststing for you, I was able to fix it for me:

File: /etc/apache2/mods-enabled/rpaf.conf

Code:
RPAFenable On
        RPAFsethostname On
        RPAFproxy_ips 127.0.0.1 PUTIPV6HERE
        RPAFheader X-Forwarded-For

Save file and Restart Apache. In my case i needed to set my servers external IPV6 address.
 
Last edited:
Back
Top