Serve a Sample HTML File from Your vFabric Web Server Instance

After you install vFabric Web Server and create an instance, you can use it to host your entire Web site. This section does not describe the entire process; rather, it simply shows how to serve an HTML file from the default document root of your instance.

Prerequisites

Procedure

  1. Open the configuration file for your vFabric Web Server instance and make note of the value of the DocumentRoot directive, which is the directory out of which the instance serves your documents. By default, vFabric Web Server takes all requests from this directory.

    The configuration file is called httpd.conf and is located in the INSTANCE-DIR/conf, such as /opt/vmware/vfabric-web-server/myserver/conf/httpd.conf. The DocumentRoot directive looks like the following:

    DocumentRoot "/opt/vmware/vfabric-web-server/myserver/htdocs" 
  2. Copy your sample HTML pages to the document root.

    For example, if you have a hello.html page in the /home/samples directory that you want to serve up:

    prompt# cp /home/samples/hello.html /opt/vmware/vfabric-web-server/myserver/htdocs
  3. Invoke the HTML page in your browser using the vFabric Web Server instance.

    For example, if your browser is running on the same computer as vFabric Web Server and the instance is listening at the default port 80, the URL is as follows:

    http://localhost/hello.html

    Because the instance is using the default port of 80, you do not have to explicitly specify it in the URL. If you set a different port, such as 8000, then the URL would be:

    http://localhost:8000/hello.html

    You should see your hello.html page in your browser.

  4. You can create a directory hierarchy under the document root to better organize your HTML pages.

    For example:

    prompt# cd /opt/vmware/vfabric-web-server/myserver/htdocs
    prompt# mkdir fun
    prompt# cp /home/samples/hello.html fun

    The URL to invoke the HTML page would now be:

    http://localhost/fun/hello.html

What to do next