[Catalyst] Shared Host Setup

Jason Kohles email at jasonkohles.com
Tue Nov 20 21:34:54 GMT 2007


On Nov 20, 2007, at 3:42 PM, John Goulah wrote:

> On Nov 20, 2007 1:16 PM, Mesdaq, Ali <amesdaq at websense.com> wrote:
> Someone said they were going to write a advent calendar entry for  
> using
> local::lib so I was waiting for that. But just wanted to share my
> solution as an alternative because some shared hosts are big pains to
> work with. Some don't even allow outbound connections so using cpan is
> not an option. So you would basically have to package everything up  
> and
> lay it down.
>
>
> I'll be writing that, but really if you follow bootstrap  
> instructions , that covers most of it. I'll just cover a couple  
> extras and go into more detail.
>
> Of course, you'd be out of luck without an outbound connection, I  
> try to avoid those hard to work with hosts :-)
>

Not necessarily.  There are several ways to work around this problem  
that I've used with great success.  In order of my preference, they are:

1. I run squid on my laptop, bound only to the localhost interface and  
with ACLs that only allow localhost to use it as a general-purpose  
proxy, then I login to the remote host with a port forward and run  
cpanp (or cpan) with a proxy configuration...

	ssh -R 3128:localhost:3128 server.address
	server% http_proxy=http://localhost:3128 cpanp

2. If I'm at a client site where my laptop won't have outgoing access  
either, then I run apache on the laptop, and use CPAN::Mini to make  
myself a local mirror of CPAN before I go...

	minicpan -l /var/www/html/minicpan -r http://some.cpan.mirror/

	ssh -R 8080:localhost:80 server.address
	server% cpanp (and use http://localhost:8080/minicpan as the mirror  
address)

3. As a last resort, if the site is so paranoid that ssh forwarding is  
locked down too, then I still have a fallback...

	rsync -essh -avz /var/www/html/minicpan some.secure.host:minicpan


If you write your own mirroring tool instead of using the cpanmini  
script, you can even exclude stuff from your local mirror...

#!/usr/bin/perl -w
use strict;
use warnings;
use CPAN::Mini;

CPAN::Mini->update_mirror(
	remote		=> 'http://some.cpan.mirror',
	local		=> '/data/minicpan',
	force		=> 0,
	trace		=> 1,
	skip_perl	=> 1,
	path_filters	=> [
		qr/(CGI-Application|Maypole|Oracle|Class-DBI)/
	],
	module_filters	=> [
		qr/Acme/,
	],
);

CPAN::Mini only mirrors the most recent version of each module, so the  
size is much smaller than you might expect (I believe a minicpan  
mirror can still fit on a CD-ROM, although I haven't checked that  
recently...)

-- 
Jason Kohles, RHCA RHCDS RHCE
email at jasonkohles.com - http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071120/3553b02d/attachment-0001.htm


More information about the Catalyst mailing list