in reply to Re^2: mod_perl, and weird caching
in thread mod_perl, and weird caching

Sure,

You would make your module generic, so that it works with all of your vhosts. You would then configure the code based on some vhost specific setting. So for example, if you have a vhost-specific configuration file indicating the graphics file names for specific UI components, you could configure that file name in a per-vhost PerlVar.

In your code, you could access this per-vhost setting. You could then use that setting to identify the location of the configuration file for that vhost, read the configuration, and respond.

Basically, a persistent environment like mod_perl assumes that you are not changing the foundation that you are building the application upon. In order for that to hold true, you need to isolate the moving parts into something that you pass through the building infrastructure.

--MidLifeXis

Replies are listed 'Best First'.
Re^4: mod_perl, and weird caching
by ultranerds (Hermit) on Feb 04, 2014 at 19:50 UTC
    Thanks for the detailed info. I'm not too sure how practice thats gonna be for the site (they are quite old, and pretty large). Maybe I'll have to get a dev install configured, and then play around with whats needed to change the module folders names around... i.e we have GT , Links and Plugin... so I could just rename them to GT2, Links2, Plugins2 - and update anywhere that calls them. Hardly ideal, but it would hopefully work.

    Someone also said this to me:

    You can't run multiple domains in the same mod_perl instance, major
    security risk. You need a separate physical apache process per domain.
    How would one go about setting separate Apache processes up? Sorry for my ignorance... I've been hosted on managed hosting for most of my time, so this is all quite new to me =)

    TIA

      Multiple apachectl calls with different configurations, all wrapped up on the front end with an nginx or another non-mod_perl apache front end.

      And the one mod_perl perl domain is correct, unless all of the domains are under a single controlling entity. Any mod_perl-enabled domain is able to impact the performance and operation of any other mod_perl instance on that apache server, as they share the same perl space in memory.

      --MidLifeXis

        Thanks - will get in contact with the host provider, and see if they can help, before doing any module name changes (which I'm not looking forward to ;) lol)

        Thanks again for your help!