You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jason Czerak <ja...@jasnik.net> on 2001/05/16 21:17:38 UTC

NameWithVirtualHost

I"m running Apache 1.3.12 + mod_perl 1.25

I'm looking to fully optimized my mod_perl scripts and in
the process I'm finding that I can't totaly seperate my
virtual hosts. I'm finding that sub procedure that are in
modules that I write  will get redefined across vhosts.
I did extensive research on this and did all the tricks 
that was suggest but with no luck.

An example test script is like this.

/index.pl:
#########
#!/bin/perl -w
use strict;

require "/path/to/custom/module/test.pm"

&testmodulepackage::main();
exit;
#########


Now test.pm would be duplicated and  would have simular
calls but differnet outputs.

Am I assuming correctly that in vhostA.com's /index.pl what
ever is 'required' for use is compleatly local to that
vhost? or once it's required, it's global but the only thing
that is local to that vhost is what ever is in the /index.pl
code-wise? That's what I'm getting to assume here.


my config is simple  here are lines in my dynamic
httpd httpd.conf file:


#PerlModule Apache::StatINC

<Location />
   SetHandler perl-script
   PerlHandler Apache::RegistryNG->handler
   Options +ExecCGI
#    PerlSendHeader On
#    PerlInitHandler Apache::StatINC
#    PerlSetVar StatINCDebug On
</Location>

PerlRequire /vhost/bin/apache-dynamic/startup.pl



and the lines in startup.pl:

#! /usr/bin/perl
use strict;
use Apache::RegistryNG;
use CGI ();
use DBI ();
use DBD::Pg ();
1;

nothing changes if the
$Apache::Registry::NameWithVirtualHost = 1 is in the
startup.pl or not.

If I change the SetHandler perl-script to SetHandler
cgi-script all the modules in the startup.pl load and are
cached and shared but my scripts are not.


I can provide output from perl-status if anyone wishes to C
that. But from what I gather, Apache does correctly place
all calls in the correct name spaces.



--
Jason J. Czerak (Jason-Czerak@Jasnik.net)
  Linux Systems Evangelist
 
Jasnik Services, LLC
  http://www.Jasnik.net