You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Dirk Fokken, Cross Development" <di...@cross-development.de> on 2004/07/19 12:20:48 UTC

[users@httpd] Bad protocol 'tcp' with perl/lwp module connections on cygwin

I want to run a perl based web application on windows using cygwin. The web applications is well running under Unix, where it is being developed. The web application is running pretty fine except that connections using perl's lwp module return with a protocol message.

Running the following cgi script from the command line in cygwin works pretty fine.

Running the same script run as cgi via apache result in a message like:

http://192.168.0.5/cgi-bin/lwp.cgi
> 500 Can't connect to search.cpan.org:80 (Bad protocol 'tcp')

The cygwin mailing list gave me an hint that /etc/protocols may not be found by apache, but could not help further.

The sample script:
------------------------------
#!/usr/bin/perl -w

use CGI qw(:standard);

print header();

# Create a user agent object
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");

# Create a request
my $req = HTTP::Request->new(POST => 'http://search.cpan.org/search');
$req->content_type('application/x-www-form-urlencoded');
$req->content('query=libwww-perl&mode=dist');

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->is_success) {
print $res->content;
}
else {
print $res->status_line, "\n";
}
------------------------------

System versions are:

Apache/1.3.29
on Cygwin 
    DLL version info: 
    DLL version: 1.5.10

on

Windows 2000 Professional Ver 5.0 Build 2195

Many thanks for help.

Kind regards,

Dirk 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org