• 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

CURL don't resolved correctly at same server

Status
Not open for further replies.

Jose Antonio R

New Pleskian
Hi,

Server1 of mydomain.com with Centos 6.5 and Ples 11.5.30#26

If visit from browser: http://www.mydomain.com/my-page.html return 200 HTTP (All OK)

But using SSH at Server1; curl -o test.html http://www.mydomain.com/my-page.html return 404 HTTP (The requested URL /my-page.html was not found on this server.). Apache logs show: Error ... File does not exist: /var/www/vhosts/default/htdocs/my-page.html

And usin SSH at Server2; curl -o test.html http://www.mydomain.com/my-page.html return 200 HTTP (All OK)


I think that Plesk don´t resolve OK for localhost vhost. I have tried /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

How I can solve this? Some suggestion?

Thanks
 
Thanks for your answer. Results;

SSH at Server1 mydomain.com;

#nslookup www.mydomain.com
Server: 10.255.XXX.X
Address: 10.255.XXX.X#53
Non-authoritative answer:
Name: www.mydomain.com
Address: 87.106.YY.YYY

#ping www.mydomain.com
PING www.mydomain.com (87.106.YY.YYY) 56(84) bytes of data.
64 bytes from alias.onlinehome-server.info (87.106.YY.YYY): icmp_seq=1 ttl=64 time=0.035 ms
64 bytes from alias.onlinehome-server.info (87.106.YY.YYY): icmp_seq=2 ttl=64 time=0.062 ms
64 bytes from alias.onlinehome-server.info (87.106.YY.YYY): icmp_seq=3 ttl=64 time=0.042 ms
^C
--- www.mydomain.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2989ms
rtt min/avg/max/mdev = 0.035/0.046/0.062/0.012 ms


SSH at Server2;

#nslookup www.mydomain.com
Server: 10.255.XXX.X
Address: 10.255.XXX.X#53
Non-authoritative answer:
Name: www.mydomain.com
Address: 87.106.YY.YYY

#ping www.mydomain.com
PING www.mydomain.com (87.106.YY.YYY) 56(84) bytes of data.
64 bytes from alias.onlinehome-server.info (87.106.YY.YYY): icmp_seq=1 ttl=63 time=0.377 ms
64 bytes from alias.onlinehome-server.info (87.106.YY.YYY): icmp_seq=2 ttl=63 time=0.743 ms
64 bytes from alias.onlinehome-server.info (87.106.YY.YYY): icmp_seq=3 ttl=63 time=0.692 ms
^C
--- www.mydomain.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2459ms
rtt min/avg/max/mdev = 0.377/0.604/0.743/0.161 ms



Some suggestion?
 
Dear Jose Antonio R,

could you provide me access to both servers so I can have a look at it?
Please per PM.

Its a little bit strange, so I would investigate it for you.
 
Dear Jose Antonio R,

could you provide me access to both servers so I can have a look at it?
Please per PM.

Its a little bit strange, so I would investigate it for you.

Thanks Henning, but I can´t give you access to servers (security policy). Please, say me what you need check and I copy results here.

Yes, It's strange;
It seem that vhost config at Plesk don´t resolved correctly for curl when use with local domains.
Apache log "File does not exist: /var/www/vhosts/default/htdocs/my-page.html". Plesk resolve as DEFAULT VHOST instead mydomain.com (/var/www/vhosts/mydomain.com/htdocs/my-page.html) when use curl http://mydomain.com/my-page.html
 
Hi.
After some tests by Parallels support, it's a problem with IPV4 and IPV6 (through local network routing). This is the email;

I found the root cause of the issue why the domain is opening with IPV6.
I can see that there is IPV6 in the network configured and DHCP is enabled. Please check the below snippet.
-=-=
[root ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPV6INIT=yes
IPV6ADDR=XXXX:XXXX:XXXX:XXXX:0000:0000:000F:XXXX/64
IPV6_DEFAULTGW=fe80::1
IPV6ADDR_SECONDARIES="XXXX:XXX:XXX:XXXX::f:XXXX/64"
-=-=
So whenever the domains is accessed on the server with IPV6, it is directly going to localhost.
But in case if we access the website using IPV4, it is not getting accessed. The reason behind this is whenever domain is accessed with IPV4 it is going through internal network routing.
-=-=
[root]# ip r
XX.XXX.XXX.1 dev eth0 scope link
XXX.XXX.0.0/16 dev eth0 scope link metric 1002
default via XX.XXX.XXX.1 dev eth0
-=-=
In the above result you can see that the request is getting routed through XX.XXX.XXX.1, which suggests that request is going through internal network routing.
Also if I make the following entry in then website is getting accessed file.
-=-=
In /etc/hosts
YY.YYY.YY.YYY www.mydomain.com
-=-=
So it is clearly suggests that whenever domain is accessed inside the server(With IPV4) it is going through local network routing which is misconfigured.
You need to check the local network configuration of the server with the help of your system administrator and it falls outside the scope of Parallels support.


Thanks!
 
Status
Not open for further replies.
Back
Top