Hi,
Thanks for the reply!
I had a feeling you were gonna say that :/ For the different module names... that doesn't sound like fun! Would it work by for example, changing:
domain 1: lib/Foo/Bar.pm
domain 2: lib/Foo2/Bar.pm
use a single (common) module and configure the differences using a per-vhost configuration object.
Could you explain this a bit more?
Thanks!
Andy | [reply] |
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.
| [reply] [d/l] |
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 | [reply] |
For anyone interested, we managed to get it going by adding into pre_virtualhost_global.conf, for each VirtualHost
PerlOptions +Parent
PerlSwitches -Mlib=/home/domain.com/lib/perl
According to the Cpanel tech guys, this means that it will run a perl instance separately per domain (which is what we need)
We've got it setup on 2 sites now, and as far as I can see its working a charm (no inter-sharing files at all - which is great! | [reply] [d/l] |