# Virtual Hosting in Jigsaw

Running Jigsaw with virtual hosting involves the following steps:

1) Open a JigAdmin window (see JigAdmin documentation)

2) Create the virtual resource.

1. Select the "space" node.
2. Click on the "Resources" button on top of the right part of the window.
3. Type the name of the virtual resource in the Identifier field (ie "virtual").
4. Select the "`org.w3c.tools.resources.VirtualHostResource`" class.
5. Click on the "Add Resource" button.

3) Attach a VirtualHostFrame to the new "virtual" resource.

1. Select the new "virtual" node.
2. Click on the "Frames" button (near the "Resources" button).
3. Select the "`org.w3c.jigsaw.frames.VirtualHostFrame`" class.
4. Click on the "Add Frame" button.

4) Modify the VirtualHostFrame attributes. See the VirtualHostFrame reference page that describe these attributes. Type the old root resource name (ie "root") in the "Followup" field. Don't forget to commit your changes by clicking on the "Commit" button.
5) Add you virtual host. You can add as many virtual host as you want, but in this example we will add only one virtual host that will be a PassDirectory (see here for more details).

1. Select the "virtual" node.
2. Click on the "Resources" button.
3. Type the name of the virtual host with the port number in the "Identifier" field (ie www.foobar.org:8001)
4. Select the "o`rg.w3c.tools.resources.PassDirectory`" class.
5. Click on the "Add Resource" button.

6) Configure your virtual host.

1. Expand the "virtual" node.
2. Select the child node "www.foobar.org:8001"
3. Click on the "Attribute" button.
4. Type, in the "pass-target" field, the path of the directory (ie /home/Jigsaw/Jigsaw/WWW2) that will be the root directory of your virtual host.
5. Commit your changes by clicking on the "Commit" button.

7) Add a HTTPFrame to your new PassDirectory.

1. Select the "www.foobar.org:8001" node.
2. Click on the "Frames" button.
3. Select the "`org.w3c.jigsaw.frames.HTTPFrame`" class.
4. Click on the "Add Frames" button.

8) Edit the general properties. Set the "Root Name" property to "virtual" and click on the "Commit" button.
9) Save the configuration, Jigsaw has a new virtual host! Now incoming request for www.foobar.org on port 8001 will be on the /virtual/www.foobar.org:8001 resources, the others requests will be dispatched to the "root" resource.

Jigsaw Team
$Id: virtual-hosting.html,v 1.3 1998/07/08 14:57:23 benoit Exp $