• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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