Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to get CPAN to use Http Proxy?

Reply
Thread Tools

How to get CPAN to use Http Proxy?

 
 
Rhugga
Guest
Posts: n/a
 
      10-24-2005
How can I force CPAN to use an http proxy for all it's downloads? When
configuring CPAN, I specified only an http proxy (thus leaving ftp
proxy blank). However, it is still trying to use ftp to grab it's
files.

log:
Trying with "/usr/bin/wget -O -" to get
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
--11:45:00-- ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
=> `-'
Resolving ftp.perl.org... done.
Connecting to ftp.perl.org[207.45.221.24]:21... failed: Connection
timed out.
Connecting to ftp.perl.org[153.106.5.70]:21... failed: Connection timed
out.
Retrying.

--11:51:19-- ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
(try: 2) => `-'
Connecting to ftp.perl.org[207.45.221.24]:21... failed: Connection
timed out.
Connecting to ftp.perl.org[153.106.5.70]:21...
failed: Connection timed out.
Retrying.

--11:57:39-- ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
(try: 3) => `-'
Connecting to ftp.perl.org[207.45.221.24]:21... failed: Connection
timed out.
Connecting to ftp.perl.org[153.106.5.70]:21...


Thanks,
CC

 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      10-24-2005
Rhugga wrote:
> When configuring CPAN, I specified only an http proxy (thus leaving
> ftp proxy blank).


Even if you don't type anything, it will propose the default ftp in
your path (such as /usr/bin/ftp). If you just hit ENTER, this will
become the default value. You can edit your CPAN/Config.pm file to
make sure the value is blank.

FWIW, I have messed with CPAN a LOT at my place of employment. I'm
behind an authenticating proxy server, and I was not able to get ANY of
the available CPAN methods to work. I was able to use a KLUDGE
(warning: this is a KLUDGE) which I described in a posting here:
http://tinyurl.com/dug5y (did I mention this is a KLUDGE?). But it
works great (though it's a KLUDGE).

 
Reply With Quote
 
 
 
 
Rhugga
Guest
Posts: n/a
 
      10-24-2005

I am able to get CPAN working fine using a proxy on our SLES 9
machines, however, on AS3U4 systems it won't.

However, our custom AS3 iso doesn't come with CPAN so I'm not sure
where to configure this. I will try the config.pm file.

Thx,
CC

 
Reply With Quote
 
Rhugga
Guest
Posts: n/a
 
      10-24-2005

Yea, that doesn't work. Each time I execute 'perl -MCPAN -e shell' it
tries to configure itself, which hangs here:

Your proxy user id?
You have no /root/.cpan/sources/MIRRORED.BY
I'm trying to fetch one
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY


I need to get past this configure phase, so I can manu8ally edit the
Config.pm file, and the hopefully it will work. Any ideas how I can get
it to get past this point?
Thx,
CC

 
Reply With Quote
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      10-24-2005
Rhugga wrote:
> I need to get past this configure phase


Not really. Your CPAN module directory has a Config.pm file in it
already. Edit that directly.

 
Reply With Quote
 
Rhugga
Guest
Posts: n/a
 
      10-24-2005

yea, I edited that file directly, however, each time I execute 'perl
-MCPAN -e shell' it forces manual configuration.

Here is the Config.pm file:
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[/var/spool/cpan/build],
'cache_metadata' => q[1],
'cpan_home' => q[/var/spool/cpan],
'ftp' => q[ ],
'ftp_proxy' => q[ ],
'getcwd' => q[cwd],
'gpg' => q[/usr/bin/gpg],
'gzip' => q[/bin/gzip],
'histfile' => q[/var/spool/cpan/histfile],
'histsize' => q[100],
'http_proxy' => q[http://www-proxy.us.oracle.com:80/],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/var/spool/cpan/sources],
'lynx' => q[/usr/bin/lynx],
'make' => q[/usr/bin/make],
'make_arg' => q[],
'make_install_arg' => q[UNINST=1],
'makepl_arg' => q[],
'ncftp' => q[ ],
'ncftpget' => q[ ],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'prerequisites_policy' => q[follow],
'proxy_user' => q[],
'scan_cache' => q[atstart],
'shell' => q[/bin/bash],
'tar' => q[/bin/tar],
'term_is_latin' => q[1],
'unzip' => q[/usr/bin/unzip],
'urllist' => [q[http://www.perl.com/CPAN/],
q[http://cpan.belfry.net/], q[http://www.binarycode.org/cpan]],
'wget' => q[/usr/local/git/bin/wget],
};
1;
__END__


Thx,
CC

 
Reply With Quote
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      10-24-2005
Rhugga wrote:
> Here is the Config.pm file:


Hmmm. That's odd.

CPAN.pm checks the config file thus:

sub missing_config_data {
my(@miss);
for (
"cpan_home", "keep_source_where", "build_dir", "build_cache",
"scan_cache", "index_expire", "gzip", "tar", "unzip", "make",
"pager",
"makepl_arg", "make_arg", "make_install_arg", "urllist",
"inhibit_startup_message", "ftp_proxy", "http_proxy",
"no_proxy",
"prerequisites_policy",
"cache_metadata",
) {
push @miss, $_ unless defined $CPAN::Config->{$_};
}
return @miss;
}

Since all is defined in your config file, it seems that this check
should return an empty array.

What happens if you edit CPAN.pm and comment-out the return statement?
I'm wondering if you have more than one copy of the CPAN module and
you're hacking on one version but @INC is finding another???

 
Reply With Quote
 
Rhugga
Guest
Posts: n/a
 
      10-24-2005

When I do a find on Config.pm I get the following:
[root@adcinfops02 root]# find / -name Config.pm -print
/usr/lib/perl5/5.8.0/Net/Config.pm
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Config.pm
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/Encode/Config.pm
/usr/lib/perl5/5.8.0/CPAN/Config.pm
/usr/local/oracle/perl/5.8.1/lib/CPAN/Config.pm
/usr/local/oracle/perl/5.8.1/lib/Encode/Config.pm
/usr/local/oracle/perl/5.8.1/lib/Config.pm
/usr/local/oracle/perl/5.8.1/lib/Net/Config.pm
/u01/app/oracle/product/10.2/inventory/Templates/perl/lib/5.8.3/i686-linux-thread-multi/Config.pm
/u01/app/oracle/product/10.2/perl/lib/5.8.3/Net/Config.pm
/u01/app/oracle/product/10.2/perl/lib/5.8.3/i686-linux-thread-multi/Encode/Config.pm
/u01/app/oracle/product/10.2/perl/lib/5.8.3/i686-linux-thread-multi/Config.pm

The stuff under /usr/local/oracle is for a version of perl in a
different location. I am trying to install CPAN for the perl in
/usr/bin. I believe the output I posted before was from the wrong
Config.pm. I just looked at /usr/lib/perl5/5.8.0/CPAN/Config.pm and all
it contains is a single line:
1;

i'm gonna try copying a Config.pm from another location and try using
it.

Thx,
CC

 
Reply With Quote
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      10-24-2005
Rhugga wrote:
> I just looked at /usr/lib/perl5/5.8.0/CPAN/Config.pm and all
> it contains is a single line:
> 1;


Thought so. Yeah, that would cause it to wanna run the config script.

 
Reply With Quote
 
Harry
Guest
Posts: n/a
 
      10-25-2005
Rhugga wrote...
>
>How can I force CPAN to use an http proxy for all it's downloads? When
>configuring CPAN, I specified only an http proxy (thus leaving ftp
>proxy blank). However, it is still trying to use ftp to grab it's
>files.



On my Windows command prompt, I can set the following to let
wget to go through my company's proxy server.

set http_proxy=http://my.proxy.server.com:80/
set ftp_proxy=http://my.proxy.server.com:80/

I believe it will work in a similar on *nix.
Check out the man page of wget.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
on windows 7 / cygwin / perl / cpan - cannot make cpan work SVCitian Perl Misc 1 10-22-2010 03:59 PM
rt.cpan.org, search.cpan.org: why so unuseable? Ben Bullock Perl Misc 12 07-08-2008 12:51 PM
Is there a better way to search CPAN than search.cpan.org? usenet@DavidFilmer.com Perl Misc 5 10-12-2005 04:50 AM
Upgrading to CPAN.pm v1.76 install Bundle::CPAN fails carl d. Perl Misc 1 05-10-2005 09:35 PM



Advertisments