Dirtbag's Blog

Using the perl MCPAN shell with wget behind a proxy

[ link: ftp_proxy | tags: firewall perl ftp linux | updated: Fri, 17 Apr 2020 12:12:08 -0400 ]

I like using the perl CPAN shell for installing perl modules on redhat boxes. I ran into an instance where I had to install some perl modules on a server that was in a lab and had no direct internet access. Read on to find out how I got around this by setting up a ftp proxy.

So from this host in the lab, I could not directly access hosts on the internet. But, I could access other hosts on my internal network that do have internet access with no problem. So what I did was set up a ftp proxy on my trusty linux box (the one that does have internet access. Lets call him "zim"). The ftp proxy server that I found that worked the easiest/best was something called "ftp-proxy". I downloaded it from here. After I unzipped it, there was no configuration neccessary. I simply ran "java FtpProxy" on zim and poof, instant ftp proxy. Now what we need to do is get the CPAN shell and friends to use it. What I found was easiest to do was to rig wget to use the proxy. Hopefully your CPAN shell will use wget as a fetch method at some point as mine does. Anyway, to configure wget to use the proxy on the host zim, create a .wgetrc (on the host in the lab) with the following:


ftp_proxy=ftp://zim:8089
use_proxy = on

Now when the CPAN shell on the host in the lab uses wget to fetch a module, It will get directed to the ftp proxy on the zim host.

-db

Like this article? Buy me a beer!