[plt-scheme] web-server and load-configuration-sexpr
Jens Axel Søgaard <jensaxel at soegaard.net> writes:
> Hi Aycan,
>
>> I want to use "load-configuration-sexpr". Could you please give an
>> example?
>>
>> Basically I have a default-host and a couple of virtual hosts. Besides
>> I want to attach a module to servlets namespaces.
>
> Just to make sure, I am on the right page. What are you trying to do
> exactly? I believe it is rather seldom anyone needs to use
> load-configuration-sxexpr. Normally you'd just edit the configuration
> file - or use the web interface.
Thanks for the reply Jens,
I'm trying to reuse a servlet in multiple virtual hosts. Let me
explain more:
I have written a simple file editor servlet (or a wiki with no markup
and entries mapped onto filesystem) which operates on a predefined
root path. It shows the list of files and directories and then you can
browse through the directories, view files, create new files etc...
I want to reuse this servlet in each of my virtual hosts and I want
this servlet to operate on each virtual host's host-root path (besides
"the host-root of the current virtual host" is another question for a
servlet writer). The worst case, I can copy the editor servlet into
each of the virtual hosts servlet folder and edit the path by
hand. But there would be more modular solutions which I couldn't find
yet.
I looked at load-configuration-sexpr but soon I realized that it
doesn't apply-default-functions to virtual hosts.
Anyway, there is another problem with creating the configuration
table. I want my virtual hosts to refere to the same message files
(that I defined in default-host-table). The similarities between
default-host-table and virtual hosts are not limited with messages. In
my situation host-roots are:
/var/www/www.vhost1.com
/var/www/www.vhost2.com
So I think there's no need to copy these files or write each vhost's
configuration one by one. Building the configuration seems to me a
better approach.
Kind Regards,
--
Aycan iRiCAN
KOR Bilişim Teknolojileri
http://www.core.gen.tr/