W3C logo
Jigsaw

Virtual Hosting in Jigsaw


Jigsaw Home / Documentation Overview / Tutorials

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 "Root" node.
  2. Select "Add Resource" in the popup menu (right click).
  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 "Ok" button.

virtual-hosting virtual-hosting

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

  1. Select "Edit Resource" in the popup menu.
  2. In the resource editor, Select "Add Frame" in the popup menu.
  3. Select the "org.w3c.jigsaw.frames.VirtualHostFrame" class.
  4. Click on the "Ok" button.

virtual-hosting virtual-hosting

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.

virtual-hosting

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. Select "Add Resource" in the popup menu.
  3. Type the name of the virtual host with the port number in the "Identifier" field (ie www.example.org:8001)
  4. Select the "org.w3c.tools.resources.PassDirectory" class.
  5. Click on the "OK" button.

virtual-hosting

6) Configure your virtual host.

  1. Expand the "virtual" node.
  2. Select the child node "www.example.org:8001".
  3. Select "Edit Resource" in the popup menu.
  4. Select the "www.example.org:8001" node in the resource editor tree.
  5. 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.
  6. Commit your changes by clicking on the "Commit" button.

7) Add a HTTPFrame to your new PassDirectory.

  1. Select the "www.example.org:8001" node (in the resource editor)
  2. Seect "Add Frame" in the popup menu.
  3. Select the "org.w3c.jigsaw.frames.HTTPFrame" class.
  4. Click on the "Ok" button.

virtual-hosting

8) Edit the general properties. Set the "Root Name" property to "virtual" and click on the "Commit" button.

virtual-hosting

9) Save the configuration, Jigsaw has a new virtual host! Now incoming request for www.example.org on port 8001 will be on the /virtual/www.example.org:8001 resources, the others requests will be dispatched to the "root" resource.