modperl-getting_two_perl_namespaces

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Date: Tue, 26 Mar 2002 11:16:49 -0800
Subject: How to get two perl namespaces in apache
From: "Thomas K. Burkholder" <burkhold@dogrobber.com>
To: modperl@apache.org

Hi there-

Apologies if this gets sent twice - I sent a message yesterday, but it 
seems to have vanished into the ether.

I'd like to run the production server of my mod_perl project 
(http://www.areaj.org/areaj) on the same machine as my development 
server.  Clearly they have the same module names so I have to somehow 
run them in two different environments - I don't think running them on 
two different virtual servers is going to do it, right?  Doesn't apache 
just start one perl "runtime"?  Please tell me if I'm mistaken about 
that.

So, I guess I'm wondering if there's an easy way to have two completely 
separate apache configurations running on the same machine (listening on 
different ports obviously).


===

Date: Tue, 26 Mar 2002 11:46:30 -0800
From: ___cliff rayman___ <cliff@genwax.com>
To: "Thomas K. Burkholder" <burkhold@dogrobber.com>
Subject: Re: How to get two perl namespaces in apache


"Thomas K. Burkholder" wrote:

> run them in two different environments - I don't think running them on
> two different virtual servers is going to do it, right?  Doesn't apache
> just start one perl "runtime"?  Please tell me if I'm mistaken about

there is only one interpreter, so running a module with the same name
on two different virtual servers is not going to work.

> So, I guess I'm wondering if there's an easy way to have two completely
> separate apache configurations running on the same machine (listening on
> different ports obviously).

sure. just leave the regular config file, then build something like:
httpd_dev.conf

change both the Listen and Port directives to an alternate port, and then
start with:
httpd -c httpd_dev.conf

i haven't tried this exact scenario myself, but it should work without a problem.

===

Date: Tue, 26 Mar 2002 14:40:23 -0500
To: "Thomas K. Burkholder" <burkhold@dogrobber.com>, modperl@apache.org
From: Drew Taylor <drew@drewtaylor.com>
Subject: Re: How to get two perl namespaces in apache

Thomas,

You can run seperate environments if your coding doesn't reference any hard 
coded paths. I just setup a dev server at my new job and do exactly what 
you want. All you have to do is add a "use lib qw(/path/to/modules);" in 
your startup.pl or make sure the PERL5LIB environment var is set. This can 
be done w/ "PerlSetVar /your/path/here" or setting it for the user apache 
is running as. HTH.

Drew

At 11:16 AM 3/26/02 -0800, Thomas K. Burkholder wrote:
>Hi there-
>
>Apologies if this gets sent twice - I sent a message yesterday, but it 
>seems to have vanished into the ether.
>
>I'd like to run the production server of my mod_perl project 
>(http://www.areaj.org/areaj) on the same machine as my development 
>server.  Clearly they have the same module names so I have to somehow run 
>them in two different environments - I don't think running them on two 
>different virtual servers is going to do it, right?  Doesn't apache just 
>start one perl "runtime"?  Please tell me if I'm mistaken about that.



===

Date: Tue, 26 Mar 2002 20:44:25 +0100
From: Ernest Lergon <ernest@virtualitas.net>
To: modperl@apache.org
Subject: Re: How to get two perl namespaces in apache

"Thomas K. Burkholder" wrote:
> 
> So, I guess I'm wondering if there's an easy way to have two completely
> separate apache configurations running on the same machine (listening on
> different ports obviously).
> 

Hi Thomas,

just throwing a glance I found:

http://thingy.kcilink.com/modperlguide/modules/Apache_PerlVINC_Allows_Module.html

Maybe someone here has experience with it.

More tips on

http://thingy.kcilink.com/modperlguide/porting/Name_collisions_with_Modules_and.html

and in this discussion:

http://www.mail-archive.com/modperl@apache.org/msg24564.html


===

Date: Tue, 26 Mar 2002 15:01:47 -0500
From: Perrin Harkins <perrin@elem.com>
To: Ernest Lergon <ernest@virtualitas.net>
Subject: Re: How to get two perl namespaces in apache

Ernest Lergon wrote:
> just throwing a glance I found:
> 
> http://thingy.kcilink.com/modperlguide/modules/Apache_PerlVINC_Allows_Module.html

Not a good idea for production use.  It will slow things down.  Handy 
for development with multiple projects using separate virtual hosts though.

===

Date: Mon, 25 Mar 2002 18:17:29 -0800
Subject: Any way to run two versions of the same perl classes at the same time?
From: Thomas Burkholder <burkhold@apple.com>
To: modperl@apache.org

Hi there-

I've reached a point where I've released a stable version of my project 
(areaj, at www.areaj.org) with a demo server (www.areaj.org/areaj) but I 
want to continue development work on the same machine.  But, obviously 
the new and old versions of the code live in an identical namespace - so 
I don't see a way to run both servers under the same apache 
installation.  I can't just use StatINC and change the code dynamically, 
because that will create an unpredictable and bug-prone experience for 
the people using the production server (I want folks using the 
production server to see the existing product anyway, not what I'm 
developing on).

Does anyone know of an easy way to solve this with apache/mod_perl, 
without running on two different servers?  Locating the code isn't a 
problem; I already deliver the code to a custom location in the user's 
home dir.  I just don't know how to get two apaches to run that read the 
different versions of the code.


===

Subject: Re: How to get two perl namespaces in apache
From: Garth Winter Webb <garth@digicamp.com>
To: modperl@apache.org
Date: 26 Mar 2002 11:40:47 -0800

On Thomas K. Burkholder wrote:

> Apologies if this gets sent twice - I sent a message yesterday, but it 
> seems to have vanished into the ether.
> 
> I'd like to run the production server of my mod_perl project 
> (http://www.areaj.org/areaj) on the same machine as my development 
> server.  Clearly they have the same module names so I have to somehow 
> run them in two different environments - I don't think running them on 
> two different virtual servers is going to do it, right?  Doesn't apache 
> just start one perl "runtime"?  Please tell me if I'm mistaken about 
> that.
> 
> So, I guess I'm wondering if there's an easy way to have two completely 
> separate apache configurations running on the same machine (listening on 
> different ports obviously).

You just need to fire up two separate apaches, each with their own
conf.  So basically you have:

/usr/local/apache_prod
/usr/local/apache_dev

These can actually share the same bin and lib directories; everything is
still installed at '/usr/local/apache' and you symlink the directories
you want to have in common.  You also need separate copies of apachectl
that fire up the httpd's so that they point at the right httpd.conf and
have the right server root.

Garth



the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu