0

I'm running a server with Centos 6 and Plesk 11.

I have curl installed and working on all domains except on a domain that has a www. as preferred domain.

[root@www]# curl http://www.exampledomain.com/wp-admin/admin-ajax.php
curl: (7) couldn't connect to host

When I remove www. it does connect but naturally is supposed to be redirected.

[root@www conf]# curl http://exampledomain.nl/wp-admin/admin-ajax.php
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

This problem arose with I got errors from a WordPress plugin that told me Http Loopbacks wheren't working.

EDIT:

[root@www ~]# curl -v http://www.exampledomain.nl/wp-admin/admin-ajax.php
* About to connect() to www.exampledomain.nl port 80 (#0)
*   Trying 127.0.0.1... Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host


[root@www ~]# sudo nmap -PN -p 80 -sN www.exampledomain.nl

Starting Nmap 5.51 ( http://nmap.org ) at 2015-06-19 22:11 CEST
Nmap scan report for www.exampledomain.nl (127.0.0.1)
Host is up.
rDNS record for 127.0.0.1: localhost
PORT   STATE         SERVICE
80/tcp open|filtered http
0

1 Answer 1

2

If you are able to resolve domain name with 'www' then it may be because its not running on port 80, have you tried https ? Do www and non-www point to same ip? Can you try curl -v <url> for a verbose o/p? Try telnet www.exampledomain.com 80 If you have nmap installed try nmap -v -A www.exampledomain.com. If you are able to connect but server not rendering page, then you may need to check server access logs and error logs and setup itself.

1
  • There is a website running on www. and it's functional (apart from curl). Yes both non-www and www are pointed at the same IP. I have also added the output on nmap and curl verbose in my question. Maybe it rings a bell. I'll go look through my logs for now.
    – GMBrian
    Jun 19, 2015 at 20:19

Not the answer you're looking for? Browse other questions tagged .