WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Broken Link Checker] Connection Failed: couldn't connect to host [Error

[Plugin: Broken Link Checker] Connection Failed: couldn't connect to host [Error

  • I understand this is a networking/firewall issue and not an issue with the Broken Link Checker plugin. I see it is using cURL to fetch the URLs so I SSH’d into my production machine and typed this:

    curl http://people-press.org/about/danielle-gewurz/

    Which returned…

    curl: (7) couldn't connect to host

    Alright time to talk to my network administrators. They said this:

    “Generally, at most shared hosting companies the servers are directly on the internet. Here we put the serves on an internal private network and then NAT to the internet.

    The curl command will have to connect directly to the private IP address of the server. In this case for XXXXXX that would be 10.5.1.66. So, the command would be as follows.

    curl -H "Host: people-press.org" http://10.5.1.66/about/danielle-gewurz/

    I take it I’ll need to hack the Broken Link Checker plugin to make it work with my unusual set-up. Unless anyone else has a better idea?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Oh yea forgot to mention I’m running a multisite set-up if that should matter at all. Some hooks and filters for this plugin would be greatly appreciated.

    For what it’s worth, the relevant code is in /broken-link-checker/modules/checkers, probably around line 147. You’ll need to replace the hostname in $url with the IP and add the Host header to the CURL handle. Something like this:

    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: xxxx'));

    If you have specific suggestions for hooks/filters that would be useful to add, let me know.

    Well it turns out I didn’t need to fork this plugin and modify it after all. A simple change to the Hosts file on the server did the trick. Thank goodness.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Broken Link Checker] Connection Failed: couldn't connect to host [Error’ is closed to new replies.
Skip to toolbar