You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mark Bathie <m....@its.uq.edu.au> on 2000/12/14 08:20:52 UTC

apache registry

Hi all,

I want to run a production and a development version of my mod-perl web
page on the same apache server. The production and development code
lives in separate directories and all code is the same (excluding
database name). Some of the code to generate the web page and to connect
to the back end database is tied up in custom written modules that
I wrote. The module (DB.pm) that connects to my database has the
database name imbedded within, so for example if I were to view the
production web page, mod-perl will happily go away connect to the
production database. Now If I come along and view the development
version of the web page, mod-perl will realise that DB.pm is already
stored in cache and it won't reload the module. So in effect I have
connected to the production database via the development web page.

The problem I see here relates to the production and development
versions having the same name for their database connectivity modules
(DB.pm). I can code around this, but it would be very messy, and I would
like to avoid making code changes and I want my dev and prod source
codes to be the same. Is there any way of storing the module name
distinctivly with apache (other than the default of using the module
name) ? any other suggestions ?

cheers,

mark bathie.



Re: apache registry

Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "MB" == Mark Bathie <m....@its.uq.edu.au> writes:

MB> I want to run a production and a development version of my mod-perl web
MB> page on the same apache server. The production and development code

Run two instances of apache, running on different port numbers.  Your
development server could run on port 8000 for instance, instead of the
default port 80.  Then you can just copy your doc tree and perl
libraries into a different location and it should just work ok.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

Re: apache registry

Posted by Stas Bekman <st...@stason.org>.
On Thu, 14 Dec 2000, Mark Bathie wrote:

> Hi all,
> 
> I want to run a production and a development version of my mod-perl web
> page on the same apache server. The production and development code
> lives in separate directories and all code is the same (excluding
> database name). Some of the code to generate the web page and to connect
> to the back end database is tied up in custom written modules that
> I wrote. The module (DB.pm) that connects to my database has the
> database name imbedded within, so for example if I were to view the
> production web page, mod-perl will happily go away connect to the
> production database. Now If I come along and view the development
> version of the web page, mod-perl will realise that DB.pm is already
> stored in cache and it won't reload the module. So in effect I have
> connected to the production database via the development web page.
> 
> The problem I see here relates to the production and development
> versions having the same name for their database connectivity modules
> (DB.pm). I can code around this, but it would be very messy, and I would
> like to avoid making code changes and I want my dev and prod source
> codes to be the same. Is there any way of storing the module name
> distinctivly with apache (other than the default of using the module
> name) ? any other suggestions ?

First, why do you run both in the same server? Run two servers
instead. The mod_perl guide full of information on how to do that.

If you still insist on keeping your setup, look at creating virtual hosts,
see PerlVINC in the guide http://perl.apache.org/guide.


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:stas@stason.org   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/