Re: Singleton Persistence

Chris Bennett <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Tue, Feb 04, 2014 at 11:42:43AM +0100, Vincent Veyron wrote:
> Le lundi 03 février 2014 à 19:13 -0500, Perrin Harkins a écrit :
> > On Mon, Feb 3, 2014 at 5:33 PM, Chris Bennett
> > <[email protected]> wrote:
> > > Right now I am using pg_1_.pl and pg_2.pl on the different hosts, but
> > > the code is identical, except that some data is pulled in from a config
> > > file for the different databases, etc used.
> 
> > I'm sure that you can use the same code, but the question is how do
> > you know which data to pull in and how do you store it in perl data
> > structures?  One common approach in this situation is to use
> > PerlSetVar inside your virtualhost config to set something you can
> > read from perl that will tell you which virtualhost you're in.  
> 
> Hi Perrin,
> 
> $r->hostname() will tell you which virtualhost you're in.
> 

That should work.

> legalcase.libremen.com (English version) shares the same code as 
> litigios.libremen.com (Spanish version). Each virtualhost has its own
> database, configured with PerSetVar, as Perrin said.
> 
> You can see it in action with the demo account.
> 

I will go look at your sites. Since I speak both English and Spanish, I
can look at both.

I will try these suggestions.
I have 3 databases that I use in production with password access and
demo versions on the other site.
I don't want anyone getting access to my production databases
since insert, update and delete are options. 

Thanks,
Chris Bennett

> 
> -- 
>                                         Regards, Vincent Veyron 
> 
> http://libremen.com/ 
> Legal case, contract and insurance claim management software
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.