• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Resolved How to get ip address with apache listening to localhost

TorbHo

Regular Pleskian
Hello,

we used the command
Code:
plesk bin apache --listen-on-localhost true
as described in https://support.plesk.com/hc/en-us/articles/17793065826839

After that we have problems, because some code needs to get the visitor's ip address with PHP
Code:
$_SERVER[ 'REMOTE_ADDR' ]
or with .htaccess
Code:
Allow from xxx.xxx.xxx.xxx

Is there a solution or workaround to get the visitor's ip address when apache is listening to localhost?
 
I tried the solution for
Server-wide solution with Apache only
but I get the error
Code:
/etc/httpd/conf/httpd.conf dir or file not found

If I understand correctly, if I could do that, I had to add:
Code:
RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 127.0.0.1
into a new file like:
Code:
/etc/httpd/conf.d/localhost.conf
Is that correct?
 
I'm sorry, I posted to the wrong location. This thread belongs to Plesk Obsidian for Linux, not Onyx.
If you are on Debian/Ubuntu it can be /etc/apache2 instead of /etc/httpd.
Yes, it is Ubuntu. Thank you, I will try it.
 
I have blocked ports 7080 and 7081 in the Plesk Firewall. To me, this seems to be a better solution and so far, I haven't encountered any problems with it.

Have I overlooked something? Is there any reason not to block these ports in the firewall?
 
Back
Top