Firewalled CPAN not Resolving FTP

This was a real pain in the backside, but fortunately quite easy to resolve in this case. I was running perl based content uploading scripts on a machine behind firewalls, and required some additional bits of code from CPAN. Our firewalls blocked FTP traffic, so I had to find a way of getting CPAN to use HTTP based mirrors rather than the default FTP ones. A little visit to the CPAN mirror sites pages gave me all the info I needed.

First of all I needed to know the address of our http_proxy port - something I got from the Network Admin guy. One armed with this knowledge I ssh’ed on to the machine affected and exported the http_proxy address as follows:

$ export http_proxy=http://xxx.xxx.xxx.xxx:1234

Next I started up cpan and ran o conf urllist. More than likely you’ll get nothing there…

cpan> o conf urllist

Next, I populated that array list with something meaningful - a http CPAN mirror site. I used http://www.mirror.ac.uk/mirror/ftp.funet.fi/pub/languages/perl/CPAN/, being UK based and all…

cpan> o conf urllist push http://www.mirror.ac.uk/mirror/ftp.funet.fi/pub/languages/perl/CPAN/

Next I checked that this was now ok.

cpan> o conf urllist

   urllist

       http://www.mirror.ac.uk/mirror/ftp.funet.fi/pub/languages/perl/CPAN/

Type 'o conf' to view configuration edit options

Looked good. Committed the changes to my Config.pm file…

cpan> o conf commit

commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm

Success! Managed to get on and install packages. Cool.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blogmarks
  • co.mments
  • del.icio.us
  • digg
  • Fark
  • Furl
  • Reddit
  • Spurl
  • TailRank
  • YahooMyWeb

About this entry