Re: best way to configure for multiple developers?

2003-04-03 Thread Stas Bekman

Right, I guess it just "feels" like it is working under mp1, since I
can get @INC to contain "." (the current dir) and use StatINC in all
the developer locations.  In the mp2 server, it shows me a different
@INC, that doesn't include "." (is it possible in mp2?).
You almost got me ;) I was looking for the place in mp2 that removes "." from 
@INC. After awhile it struck me to check the perl source, and perl.c had:

if (!PL_tainting)
incpush(".", FALSE, FALSE, TRUE);
It's been there for a long time (tested with 5.005_03), though I didn't 
know/remember that :(

# here you have "."
% perl -le 'warn join "\n", @INC, "";'
# and here you don't
% perl -Tle 'warn join "\n", @INC, "";'
"." is added to @INC only if you aren't running with -T. Nothing specific to 
mod_perl.

You can still add it using:

use lib qw(.);

if you really have to. But it's especially bad idea with mp2/threaded mpm, 
where one should never use chdir during request time and rely on cwd. See:
http://perl.apache.org/docs/2.0/user/coding/coding.html#Thread_environment_Issues

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: best way to configure for multiple developers?

2003-04-03 Thread Brian C. Thomas
Hi

Thanks for the info.  I'll try setting up some virtual hosts.  More
below...

On Wed, Apr 02, 2003 at 06:07:01PM -0500, Perrin Harkins wrote:
> Brian C. Thomas wrote:
> >I have read through the lists looking for issues related to mp2 and
> >@INC, and have read the part about "+Parent" and virtual hosts.
> 
> You should read the docs for tips on this, especially here:
> http://perl.apache.org/docs/general/control/control.html#Starting_a_Personal_Server_for_Each_Developer
> 
> The strategies for this are mostly unaffected by mp 1 vs 2.
> 
> >Is there a "best" way to configure the apache/mp2 setup so that there
> >doesn't have to be constant additions to "startup.pl" to adjust the
> >INC path?
> 
> If you don't need to restart the server, you could give each developer a 
> separate virtual host with a separate pool of perl interpreters.  These 
> could each have a different @INC setting and would not share code.  If 
> you need people to be able to restart though, it has to be separate servers.
> 
> >For example, I want developer1 to use /dev1, and developer2 /dev2.  I
> >want each developer to be able to build functions below there
> >directories in as many subdirectories as projects they have going on.
> >I don't want developer1's "functions.pm" code to interfere with
> >developer2's "functions.pm".
> 
> Well, what I mentioned above will let you do that, but how do you do it 
> on the production server?  You probably don't want to have multiple 
> pools of interpreters there, since it would use more memory.  If you 
> keep these files in a separate namespace, it won't be an issue.  Are 
> these real modules, with package declarations?
> 
> >Is such an arrangement even possible under mp2?  I've been using
> >Apache1/mp1 and this works fine
> 
> How are you doing it in mp1?  There is no support for pools of 
> interpreters in mp1, so all of your code must be using the same @INC.

Right, I guess it just "feels" like it is working under mp1, since I
can get @INC to contain "." (the current dir) and use StatINC in all
the developer locations.  In the mp2 server, it shows me a different
@INC, that doesn't include "." (is it possible in mp2?).

Thanks again,

BCT


Re: best way to configure for multiple developers?

2003-04-03 Thread Stas Bekman
Brian C. Thomas wrote:
Hi

I have read through the lists looking for issues related to mp2 and
@INC, and have read the part about "+Parent" and virtual hosts.  What
about the following scenario?
One apache2 server w/ mp2 (no virtual hosts) and several perl coders
using the server as a development site.
Is there a "best" way to configure the apache/mp2 setup so that there
doesn't have to be constant additions to "startup.pl" to adjust the
INC path?  What about name space conflicts?
For example, I want developer1 to use /dev1, and developer2 /dev2.  I
want each developer to be able to build functions below there
directories in as many subdirectories as projects they have going on.
I don't want developer1's "functions.pm" code to interfere with
developer2's "functions.pm".
Is such an arrangement even possible under mp2?  I've been using
Apache1/mp1 and this works fine, but all my tests with mp2 end up
giving me 
I suppose you are looking for this:
http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_
ModPerl::Registry: Can't locate FUNC.pm in @INC (@INC contains:
/usr...) types of  errors.  And for identically named files (e.g.
functions.pm above), I get the subroutines from the first listed
functions.pm in the @INC path, which are the wrong ones being called
for.
Sure, you hit the old 1.0 problem described here:
http://perl.apache.org/docs/1.0/guide/porting.html#Name_collisions_with_Modules_and_libs
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: best way to configure for multiple developers?

2003-04-03 Thread Perrin Harkins
Brian C. Thomas wrote:
I have read through the lists looking for issues related to mp2 and
@INC, and have read the part about "+Parent" and virtual hosts.
You should read the docs for tips on this, especially here:
http://perl.apache.org/docs/general/control/control.html#Starting_a_Personal_Server_for_Each_Developer
The strategies for this are mostly unaffected by mp 1 vs 2.

Is there a "best" way to configure the apache/mp2 setup so that there
doesn't have to be constant additions to "startup.pl" to adjust the
INC path?
If you don't need to restart the server, you could give each developer a 
separate virtual host with a separate pool of perl interpreters.  These 
could each have a different @INC setting and would not share code.  If 
you need people to be able to restart though, it has to be separate servers.

For example, I want developer1 to use /dev1, and developer2 /dev2.  I
want each developer to be able to build functions below there
directories in as many subdirectories as projects they have going on.
I don't want developer1's "functions.pm" code to interfere with
developer2's "functions.pm".
Well, what I mentioned above will let you do that, but how do you do it 
on the production server?  You probably don't want to have multiple 
pools of interpreters there, since it would use more memory.  If you 
keep these files in a separate namespace, it won't be an issue.  Are 
these real modules, with package declarations?

Is such an arrangement even possible under mp2?  I've been using
Apache1/mp1 and this works fine
How are you doing it in mp1?  There is no support for pools of 
interpreters in mp1, so all of your code must be using the same @INC.

- Perrin