[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

A specific sort of WEBrick configuration

Lloyd Zusman

1/2/2005 5:02:00 PM

I'm trying to configure WEBrick to create a server that will behave in
the following way. I have made a number of false starts, and before I
dive in and try again, I'm wondering if anyone has created a setup that
they can describe which has each and every one of the following
characteristics:

- One WEBrick instance answers queries for a number of different
virtual hosts that are listening on the same IP address.

- For each virtual host, WEBrick can serve up different content.

- This content is organized in subdirectories whose names are based in
some way on the virtual hostnames. Within each of these
subdirectories is contained the site-specific ruby code which controls
the appearance and functionality of each of these individual sites.

- Session management is easily available and selectable, such that any
individual sites that want session management simply have to request
it via some sort of configuration; and any sites which don't want
session management don't have to use it and can disable it.

I have found examples which show how to manage sessions (for example,
using tofu), and other examples which show how to handle the virtual
hosts. However, I have yet to see how to have all of these features
in a single WEBrick instance.

If someone could point me to an example of how all of this can be done
within a single instantiation of WEBrick, I would be quite grateful.

Thanks in advance.

--
Lloyd Zusman
ljz@asfast.com
God bless you.



1 Answer

Eric Hodel

1/4/2005 8:59:00 PM

0

On 02 Jan 2005, at 09:01, Lloyd Zusman wrote:

> I'm trying to configure WEBrick to create a server that will behave in
> the following way. I have made a number of false starts, and before I
> dive in and try again, I'm wondering if anyone has created a setup that
> they can describe which has each and every one of the following
> characteristics:
>
> - One WEBrick instance answers queries for a number of different
> virtual hosts that are listening on the same IP address.
>
> - For each virtual host, WEBrick can serve up different content.
>
> - This content is organized in subdirectories whose names are based in
> some way on the virtual hostnames. Within each of these
> subdirectories is contained the site-specific ruby code which
> controls
> the appearance and functionality of each of these individual sites.
>
> - Session management is easily available and selectable, such that any
> individual sites that want session management simply have to request
> it via some sort of configuration; and any sites which don't want
> session management don't have to use it and can disable it.
>
> I have found examples which show how to manage sessions (for example,
> using tofu), and other examples which show how to handle the virtual
> hosts. However, I have yet to see how to have all of these features
> in a single WEBrick instance.
>
> If someone could point me to an example of how all of this can be done
> within a single instantiation of WEBrick, I would be quite grateful.

Sounds like you want to use inheritance or mixins to get what you want.
Each part of your composite Servlet can be implemented separately,
then layered into the functionality you want.

--
Eric Hodel - drbrain@segment7.net - http://se...
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04