• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

LWP::UserAgent does not work in http

V

vincenieuw

Guest
Hi,

On a FC4, Plesk 8.0 Server the perl module LWP::UserAgent does not seem to work.

I tried to ping and dig the domains holding the xml files, that worked fine.
The results in the shell are all right, so dns seems to work from shell.

I tried to completely disable the firewall and then tried again from http and still no result.

If I add the domainname in the hosts file (although a ping from shell works!) I get this error:
============
500 Can't connect to www.domainname.com:80 (connect: Permission denied)
============

If I don’t add the domainname in de the hosts file I get this error:
============
500 Can't connect to www.domainname.com:80 (Bad hostname ' www.domainname.com')
============

In Cpan I reinstalled the module LWP::UserAgent and it’s there.

When I run the .pl script from the shell it works fine also.

The script contains no more than:

=============

#!/usr/bin/perl

require LWP::UserAgent;

print "Content-type: text/html\n\n";

print "<html>";
print "<body>";

$sUrl = "http://www.domainname.com/feeds/document1.xml";

$oUserAgent = new LWP::UserAgent;
$oUserAgent->agent("Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)");
$oHTTP = new HTTP::Request 'GET', "$sUrl";
$oResponse = $oUserAgent->request($oHTTP);
$sResponse = $oResponse->content;

print "<b>$sUrl</b>";
print "<xmp>$sResponse</xmp>";
print "<hr />";

print "</body>";
print "</html>";


=============

Does anyone know what can be the problem?
Thanks in advance.
 
Back
Top