You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kelly Zeng <ze...@lhc.nlm.nih.gov> on 2003/10/09 23:51:33 UTC

open(STDERR, ">&STDOUT") not working

I had the following in wdbi.cgi that failed:
open(STDERR, ">&STDOUT") || die "Can't dup stdout: $!\n"
In Apache's error_log,  i have:
ModPerl::Registry: $r wasn't passed at...

Any ideas what went wrong?

many many thanx.

:)Kelly



Re: 1 server, 2 databases + sites = Mixed calls

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2003-11-17 at 13:47, angie ahl wrote:
> Thanks for that, but CPAN seems to indicate that Apache::PerlVINC will
> have a performance hit (which I need to avoid if possible).

It's really for development use.

> if the 2 sites call a different directory name eg:
> 
> site 1:
> 
> use lib "/home/virtual/site17/fst/var/www/perl/verttemp";
> use verttemp::SiteMap;
> 
> site 2:
> 
> use lib "/home/virtual/site17/fst/var/www/perl/vert";
> use vert::SiteMap;

That will work, if you change the package names inside every file.

> Have I undestood that concept correctly? Could I still call it via
> 
> my $page = SiteMap->new;
> 
> or would I need to say
> 
> my $page = vert::SiteMap->new;

The latter.

> A little find and replacing wouldn't kill me ;)

It seems simper to just run two instances of apache.  You can just start
the same binary twice, with different conf files.

- Perrin


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: 1 server, 2 databases + sites = Mixed calls

Posted by angie ahl <an...@vertebrate.co.uk>.
Thanks for that, but CPAN seems to indicate that Apache::PerlVINC will
have a performance hit (which I need to avoid if possible).

would the following work?

if the 2 sites call a different directory name eg:

site 1:

use lib "/home/virtual/site17/fst/var/www/perl/verttemp";
use verttemp::SiteMap;

site 2:

use lib "/home/virtual/site17/fst/var/www/perl/vert";
use vert::SiteMap;

or should that be 
use lib "/home/virtual/site17/fst/var/www/perl";

ie missing the directory name that corresponds with the module name

Have I undestood that concept correctly? Could I still call it via

my $page = SiteMap->new;

or would I need to say

my $page = vert::SiteMap->new;


A little find and replacing wouldn't kill me ;)

Cheers

Angie

on 17/11/03 Perrin Harkins said:

>On Mon, 2003-11-17 at 12:40, angie ahl wrote:
>> So I have one set of modules in
>> /home/virtual/site17/fst/var/www/perl/vert
>> 
>> and another in 
>> /home/virtual/site29/fst/var/www/perl/vert
>> 
>> And those modules have different database information (but tables 
>inside
>> are the same).
>
>Sounds like you're having namespace collisions.  You can't run two
>different modules with the same package name in the same interpreter. 
>Take a look at Apache::PerlVINC for a workaround, or run two separate
>apaches.
>
>- Perrin
>
>

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: 1 server, 2 databases + sites = Mixed calls

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2003-11-17 at 12:40, angie ahl wrote:
> So I have one set of modules in
> /home/virtual/site17/fst/var/www/perl/vert
> 
> and another in 
> /home/virtual/site29/fst/var/www/perl/vert
> 
> And those modules have different database information (but tables inside
> are the same).

Sounds like you're having namespace collisions.  You can't run two
different modules with the same package name in the same interpreter. 
Take a look at Apache::PerlVINC for a workaround, or run two separate
apaches.

- Perrin


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


1 server, 2 databases + sites = Mixed calls

Posted by angie ahl <an...@vertebrate.co.uk>.
Hi everyone

I would search archives for this but I honestly can't think what to
search for in this case :(

I have 1 server, with 2 practically identical sites on it. And calls to
databases are getting mixed up (Using MySQL and DBI)

I have an ensim server running:
Apache/1.3.27  
mod_perl/1.24_01
(Red-Hat/Linux)

I'm using PerlAuthenHandler Apache::AuthDBI::authen

I'm calling it like so:
PerlSetVar Auth_DBI_data_source DBI:mysql:angie_mydomain_net

I have my own handler calling my Perl Script for all .html pages:

Action add-vertmod /perl/onefile.pl
AddHandler add-vertmod .html

onfile.pl calls a load of my modules like so:

use lib "/home/virtual/site17/fst/var/www/perl/vert";
use SiteMap;
use Event;

inside my modules I have the following DBI Code

my ($dbname, $host, $user, $password, $tablename) = 
    qw(angie_mydomain_net localhost username password Event);

my $dbh = DBI->connect("DBI:mysql:$dbname:$host",$user,$password)
    or die "can't connect user $user to to database $host:$dbname";
    
OK that's the setup:

I set up another subdomain on the server, which lives in folder 
"/home/virtual/site29"

I changed all references to site17 to site29, and all references to the
database and it's username and password. I've double checked this twice
in BBedit now. I didn't miss any.


So I have one set of modules in
/home/virtual/site17/fst/var/www/perl/vert

and another in 
/home/virtual/site29/fst/var/www/perl/vert

And those modules have different database information (but tables inside
are the same).

As you've probably guessed I'm trying to get a mirror site up so I can
work on it while people use the other one safely.

However it seems the database calls are getting mixed up. Sometimes
actions get set to one instead of the other, it's hard to actually say
what is happening, It looks like a var is being overwritten, but I've
used "my" everywhere so I can't work it out.

A bit stuck... Any ideas?

Thanks 

Angie

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: open(STDERR, ">&STDOUT") not working

Posted by Stas Bekman <st...@stason.org>.
Kelly Zeng wrote:
> I had the following in wdbi.cgi that failed:
> open(STDERR, ">&STDOUT") || die "Can't dup stdout: $!\n"
> In Apache's error_log,  i have:
> ModPerl::Registry: $r wasn't passed at...
> 
> Any ideas what went wrong?

We can't help you here as you provided too little information. Please see
http://perl.apache.org/bugs/ and make sure that you post a sample code that
produces this problem and the *complete* error message. Thanks.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com