• 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

Issue Can't access sites from localhost

Gaby

New Pleskian
Hello,

I found a strange issue on all my Plesk installations...

Since 14 january, 2019, a client tell me PDF generation on his website does not works anymore.
When I look at the code, some images are integrated with full URL (https://example.com/image.jpg) instead path (/var/www/blah/image.jpg), because path do not works (strange too, but the library is very limited, so why not).

If I try to go on https://example.com/image.jpg from my computer, everything is fine, but if I try to grab the image from the server via a:

Code:
wget https://example.com/image.jpg
#or a
lynx https://example.com/image.jpg

I got this error message:

Code:
# with wget:
wget https://example.com/image.jpg
--2019-01-28 14:46:15--  https://example.com/image.jpg
Resolving example.com (example.com)... 127.0.1.1
Connecting to example.com (example.com)|127.0.1.1|:443... failed: Connection refused.
# or with lynx:
Looking up example.com
Making HTTPS connection to example.com
Alert!: Unable to connect to remote host.

lynx: Can't access startfile https://example.com/image.jpg

In /etc/hosts, I have this entry:

Code:
127.0.1.1 example.com example

Ok, so from the server, example.com is in fact localhost.

I try a:

Code:
telnet localhost 80
telnet example.com 80
telnet <public_ip> 80

I got this:

Code:
# from server
# 1.
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
# 2.
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused
# 3.
Trying <public_ip>...
Connected to <public_ip>.
Escape character is '^]'.

# from another computer
# 2.
Trying <public_ip>...
Connected to example.com.
Escape character is '^]'.
# 3.
Trying <public_ip>...
Connected to <public_ip>.
Escape character is '^]'.

Si it's clear, connection is blocked from localhost.

I try to disable completely Plesk firewall, and fail2ban too, an iptables -S return nothing, ufw is disabled, and the problem still occurs...

Please note this problem happen AFTER Plesk initialization (not installation), when you have to go on the link and configure it for the first time.
Of course, everythink works fine before, and I'm not sure about the date, because it's only the moment where my client report me this issue...


Actually the only solution I have is to remove the entry in /etc/hosts, but I'm not sure about side-effects... So if anyone have a better solution (like find and solve the real problem :p), it can be better ^^

Thanks for your help, do not hesitate to ask for more informations if you need them, and sorry for my english ;)
 
Hello Peter, thanks for your answer!

Both addresses are in the loopback range and can be used as localhost (What's so Special About 127.0.0.1 in Computer Networking?).
Just to be sure I tried to change it with 127.0.0.1 in /etc/hosts, but nothing change :/

This problem is recent, and I think it starts with one of the lasts Plesk updates. It's hard to say which one, but it seems to start around the 14th january.

Thanks again :)
 
Back
Top