Sun ONE logo      Previous      Contents      Index      Next     

Sun ONE Web Server 6.1 Getting Started Guide

Chapter 4
Publishing Content

Sun ONE Web Server 6.1 introduces support for the Web-based Distributed Authoring and Versioning (WebDAV) protocol that enables users to perform remote web content authoring operations. What this means is that once you’ve created a WebDAV collection on your virtual server (we’ll see how that’s done a little further on), users no matter where they are located, can access the documents from the collection as easily as if they were accessing documents on a local file system.

A complete WebDAV transaction involves a server that supports WebDAV, such as Sun ONE Web Server 6.1, to service requests for WebDAV resources, as well as a WebDAV-enabled client such as Microsoft Internet Explorer, AdobeŽ GoLiveŽ or MacromediaŽ DreamWeaverŽ that supports WebDAV-type web publishing requests.

In this chapter, we will set up both aspects of the WebDAV transaction:

Set Up the Server to Handle WebDAV

Clients can author documents and publish them on your server, view, copy, move, and lock documents, and perform other WebDAV operations on collections of resources that are configured to support WebDAV on a virtual server. As server administrator, therefore, you need to create such collections.

Let’s walk through some of the basic tasks involved.

Let’s assume we have a set of documents located in a folder called /info in the docroot of your virtual server, acme. You want the HR group in Acme Corp. to be able to work remotely with this folder.

Enable WebDAV

First you need to enable WebDAV at two levels: globally, at the server instance level and at the virtual server class level. (By default, WebDAV is disabled.)

To enable WebDAV globally:

  1. Go to the Server Manager and click the Enable/Disable WebDAV link on the Preferences tab.

  2. Figure showing the Enable/Disable WebDAV Globally page.

  3. Click the Enable WebDAV Globally checkbox.
  4. Click OK and then Apply for the changes to take effect.

To enable WebDAV for the virtual server acme, which belongs to the virtual server class, vsclass2:

  1. Go to the Class Manager interface of vsclass2.
  2. Select the Content Management tab and click the Enable/Disable WebDAV link.

  3. Figure showing the Enable/Disable WebDAV page for the virtual server class.

  4. Check the Enable DAV checkbox corresponding to vsclass2.
  5. Click OK.

You’re now ready to create the WebDAV collection.

At a minimum, creating a collection involves nothing more than specifying the path to a directory that you want to enable WebDAV on. Now, if this directory contains only static data (such as HTML pages or images), you need to specify only the URI path to the directory. However, if the directory also contains dynamic content (such as JSP, SHTML, or CGI programs), you must also specify a source URI. What’s the difference between specifying a URI and specifying a source URI for a collection? Well, to understand the difference, let’s consider the following example:

Let’s assume we have a dynamic page, test.shtml in the collection. This page contains a script that displays today’s date on the browser.

Let’s say that while creating the collection, you specify only a URI for the collection, and no source URI. In this case, when a client invokes the test.shtml page, the figure below shows how it appears on a browser window:

Figure showing a dynamic page from a collection created with only content URI specified, on a browser window.

Next, let’s say you also configure a source URI for the collection, say /info_source. Now if a client invokes the test.shtml page, the figure below shows how it appears on a browser window:

Figure showing a dynamic page from a collection created with source URI specified, on a browser window.

By specifying a source URI for a collection, you thus expose the source of a resource to clients. Exposing the source obviously has security implications and you are recommended to set access control on directories that you map source URIs against. This is discussed in Enabling Access Control.

Let’s create a collection next, and specify both a URI and also a source URI so that the collection can expose the source of dynamic content.

Create a WebDAV Collection

To create your collection:

  1. Go to the Virtual Server Manager interface page for your virtual server, acme and select the WebDAV tab
  2. Click the Add DAV Collection link.
  3. Specify /info as the URI and /info_source as the source URI.

  4. Figure showing the Add WebDAV Collection page.

  5. Set the Maximum Property Depth value to either 1 or infinity.
  6. Click OK and then Apply to save and apply your changes.

You might want to specify other parameters for the collection in order to fine-tune the level of WebDAV support. You might for example, want to set an upper limit on how much data a person can copy onto the server or for what length of time a resource can be locked. You could do so either at the time of creating the collection or at any time after you’ve created the collection using the Edit DAV Collections page.

Once you’re done with creating or editing the collection, you need to ensure that only the user named “manager” and no one else has the right to access the collection. A couple of points of note here:

If you need to provide access control and security to the collection you’ve just created for only the user named “manager”, use the Edit ACL button on the Edit WebDAV Collections page to set this up.

Figure showing the Edit DAV Collections page.

Now that we’ve set the server up to handle WebDAV requests, let’s turn to the client-side tasks next.

Set Up a Client to Use WebDAV

You can use any WebDAV-enabled client software to access and use resources on a WebDAV-enabled server, for example, Microsoft Internet Explorer, Adobe GoLive and Macromedia DreamWeaver.

You would first need to connect to Sun ONE Web Server server using a valid WebDAV URI. For example, if /info is the URI to a WebDAV-enabled collection on a server named acme running on port 2222, you’d specify the URL for the client to make a connection with the server:

http://acme:2222/info

On the client-side, you would then receive a listing of the contents of the collection.

You could then perform several operations on the listed resources. For example, you could create a collection on the server, download files from the collection to your machine, upload files, lock, unlock, copy, move or delete resources. Typically, if you were making changes to a file, you would use the WebDAV client software to lock it to prevent others from simultaneously working on the same file and overwriting your changes.

Sun ONE Web Server 6.1 keeps track of the outstanding locks in a locking database.

To view the outstanding locks or to free a locked resource, you use the Lock Management link on the Virtual Server Manager interface, as shown in the figure below:

Figure showing the listing of lock information on the virtual server's Lock Management page.

The WebDAV functionality is discussed at length in the Sun ONE Web Server 6.1 Administrator’s Guide. Refer to it for more information on configuring and fine-tuning your WebDAV resources.



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.