Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 27307 invoked from network); 20 Jul 2004 08:08:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Jul 2004 08:08:05 -0000 Received: (qmail 83569 invoked by uid 500); 20 Jul 2004 08:08:03 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 83424 invoked by uid 500); 20 Jul 2004 08:08:02 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list embperl@perl.apache.org Delivered-To: moderator for embperl@perl.apache.org Received: (qmail 46271 invoked by uid 99); 20 Jul 2004 07:45:33 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Apache virtulahosts sharing modules Date: Tue, 20 Jul 2004 17:45:24 +1000 Message-ID: <798980D8CEDD294AA08BFF4D506AA61B2706A3@mercury.OrielTech.Local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Apache virtulahosts sharing modules Thread-Index: AcRsjaz92iwjNTeMTe+OwpD1zqEsGABmK7cg From: "Andrew O'Brien" To: "Steve Wilder" , X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > From: Steve Wilder [mailto:stevew@m8rix.net]=20 > Subject: Apache virtulahosts sharing modules >=20 >=20 > Hello, all. >=20 > I'm using Apache 1.3.29 and Embperl 1.3.6 >=20 > I've got two Apache Virtualhosts: www.benwilder, and=20 > rhyme.benwilder.com >=20 > Both sites have a "test1.phtml" which looks like this: > ---------------------------- > [! use test1; !] >=20 > [+ test1::whereami() +]
> ---------------------------- >=20 > Both sites have a test1.pm file which sits in their Document Root This causes issues within mod_perl. Mod_perl caches things based on namespace, just like perl, so eventually you get the case where the module is not reloaded and you have sync issues. > The problem is that if I reload one or the other enough=20 > times, it will=20 > begin using the other sites test1.pm! I need each site to=20 > only use it's=20 > own test1.pm. >=20 > If I restart Apache, the problem goes away for a time, but will come=20 > back if I reload one or the other enough times. >=20 > BTW: In my httpd.conf, I set "PerlSetEnv PERL5LIB" in the VirtualHost=20 > directive to its own Document Root. >=20 > How do I lock each VirtualHost to it's own test1.pm module? I have never found a really nice way to get around this issue - perhaps others have. Occasionally I have resorted to Apache::PerlVINC (http://search.cpan.org/dist/Apache-PerlVINC/) but this removes all the caching speedups you get with mod_perl by unloading the modules at the end of every request. Even then I've found cases where non-cleaned-up references cause unloads to fail and you end up with sync issues again. Your best bet is to have site-specific information set up at the embperl request level. Ie have constants/whatever initialised in base files rather than having that kind of logic in the modules. Anyone have other ideas? Cheers, Andrew --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org For additional commands, e-mail: embperl-help@perl.apache.org