• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • 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.

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