tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David N. Welton)
Subject Re: web site
Date Thu, 11 Apr 2002 11:06:06 GMT
Ronnie Brunner <> writes:

> > We will do this on, but the reason I didn't do
> > something similar immediately is this:

> > How to set up a testing environment that does not affect other
> > websh pages being run on my system.  I got bit by this when
> > setting up the test site on my computer.

> The clean way to setup a server with different applications / setups
> for templates etc by just using multiple interpreter classes:

>    proc web::interpmap {file} {
>       if {[string match "*/myExamples/*" $file]} {
>           # this is my own code for the examples
> 	  return /path/to/script/for/examples/myScript
>       }
>       if {[string match "/path/to/special/app" $file]} {
>           # an app with its own script code
> 	  return /real/path/to/app/code
>       }
>       # default : the stuff
>       return [file join [file dirname [web::request SCRIPT_FILENAME]]]
>    }

> Doesn't that help?

Yes, that can be made to work.

> > What I ended up doing is having a 'common.tcl' file that is loaded
> > at child init time on the live site, and loaded before each
> > request on my box.

> The "and loaded before each request" seems strange. I understand
> that in a page you explicitly want to test with new code it's easier
> to include the code in the file, because it's loaded (=eval'd) every
> time you request the page. But in all the other pages it shouldn't
> be there (where's all the fun of being faster with preloaded code
> ;-)

Well, it should be there, because it's the 'global' code that is
available to all pages within the site.  Yes, it's 'slow' but since
it's just me using the computer, I don't really notice, and it's
faster than having to restart apache if I add something.

> > I'm not sure what the easiest/cleanest way to do this in Websh is,
> > though.

> Regarding what: testing or production?

On the production box, the mod_websh installation will be dedicated to
serving up the websh/ directory, and hopefully we won't be mucking
around too much with the code, so doing things statically is ok.  The
testing box is the one that I was trying to find the best solution
for.  The interpmap system above should do the trick.

David N. Welton
Free Software:
   Apache Tcl:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message