--- On Fri, 10/3/08, Michael Peters <[EMAIL PROTECTED]> wrote:
> Phil Carmody wrote:
> > The problem I'm having is that the package
> > namespaces for the two handlers, and every module they
> > require, clash. I might need different @INCs too. How have
> > people got around this problem in the past?
> 
> It's not a mod_perl problem. This is just how Perl
> works. You can't have 2 packages with the same 
> name. Period. Sometimes it's easy to think that
> Apache's VHosts are using different Perl 
> interpreters, but they aren't. Within the same process
> it's all the same interpreter.

I presume that all hosting services which offer LAMP do so via virtual machines 
then, or via Apache 2. That might make my "how to go live" decisions trickier 
for other projects which I'm not prepared to host on my home machine.

> So, if you want something similar to your original goal I
> see the following options:
> 
> 1) Use a separate Apache. This isn't as hard as it
> sounds. And if you already have a proxy in front 
> (which you should) it's even easier. Just have some
> mod_redirect rules which send requests for your 
> dev version to a different port and have your other dev
> apache listening on that port. You don't 
> even need another machine.

After working out that I was never going sensibly going to be able to get the 
modules to name themselves on the fly (physically possible, but probably slower 
and definitely uglier code) that's what I aimed for post haste. It was 
basically a complete piece of cake. The extra benefit of this is that I can 
stop and start the dev server without any interruptions to the several other 
vhosts that I run on the live server. I'm not bothering with init.d, it's very 
easy to start and stop a second apache by hand. As it exists _only_ to serve 
one mod_perl handler, it doesn't need to be configured to do anything else, 
translate anything, rewrite anything, or index anything, so the new http.conf 
is trivial to create.

Many thanks for confirming that.
Phil



      

Reply via email to