Bas,
Good ideas! I'm using a 'package' structure which does some of the things that
you are talking about. In some ways the directory/file structure is modeled
on the ACS4/OACS structure. The big difference is that it is entirely file
based. That is configuration isn't in the database, you don't even need to
use a database with this configuration. The main reason is so that you can
quickly tar/gz up an application and move/replicate it somewhere else with
minor changes, if any.
In support of this effort, I also have a new configuration file setup. Every
virtual server has a new directory called config:
servers/server1/
modules/
tcl/
twt/
init.tcl (sourced to start)
packages/
db/
tcl/
templates/
queries/
config/
server.tcl (all sections which have /$server/ )
nslog.tcl (referenced from /ns/$server/modules)
nscgi.tcl ..
mymodule.tcl (tcl or c module in modules sect)
pages/
log/
/supervise/
run (multilog script)
supervise/
run (startup file, serverlog = /dev/fd/1)
Anyway, the packaging isn't to the point of dropping in and having the server
automatically notice stuff, but each package/module has a separate set of
configuation files, so it is much easier to add/remove stuff without editing
a monolithic config file. To see how to set the local configuration of
packages look at how things are sourced starting at: twt/init.tcl:
<http://rmadilo.com/m2/servers/rmadilo/modules/tcl/twt/>
(somewhat out of date, I'll freshed up this today)
I haven't settled on a standard way of 'mounting' a package, although
the session package filters anything directed at /session/* and runs templates
from the sessions/templates directory. I think this is how standard Tomcat
packages work, based upon filters.
On Monday 20 February 2006 06:52, Bas Scheffers wrote:
> Using functionality found in ns_rewrite (where did that disappear to?)
> we should be able to map anything under the designated root to the AAP's
> pages directory.
>
Actually ns_rewriteurl only redirects under the set pageroot, so you can't use
it for this purpose.
What you can do is to write a simple filter which rewrites the url to some
other place under pageroot which is blocked from direct access. You could,
for instance, map a url /mypackage/* to /packages/mypackage/*, and just block
direct access to /packages/*.
<http://rmadilo.com/files/nsrewrite/doc/nsrewriteurl.html>
> Now for the hard parts:
>
> - Library loading: Could the module instruct the server to source the
> Tcl library files from the application? Ns_TclInitModule does something
> like it, but is limited to the server's modules/tcl directory. It also
> stores it by name in a Tcl list, so I guess the path expansion happens
> further down. That may need a core change after all.
>
Loading C level modules using the AOLserver api will likely need to be done at
the correct time, before tcl modules are sourced, so I don't see how to jump
ahead and read a tcl configuration file to load an AOLserver C module.
However, if it is just a Tcl .so module, you can do this easily right now.
tom jackson
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.