• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved How to get ip address with apache listening to localhost

TorbHo

Basic 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