WebNFS

WebNFS is a product from Sun Microsystems that extends its NFS to the Internet. Although it is no longer included with the Solaris 9 media, the WebNFS package can be downloaded for free from www.sun.com/webnfs.

The Internet and the World Wide Web have become great media for information distribution and sharing. Unfortunately, the protocol for the web, HTTP, leaves much to be desired in terms of performance. HTTP is a one-way protocol that transfers multiple data formats inefficiently. Entire pages and all their contents must be transferred at the same time to the requesting browser. On the other hand, NFS works with only portions of files at a time, usually only the sections that are in use. It is possible to update sections of a file with NFS, a task that is virtually impossible with HTTP. The following are the benefits of WebNFS over HTTP and FTP:

  • Connection management A WebNFS client can download multiple files over a single persistent TCP connection.

  • Concurrency WebNFS clients can issue multiple concurrent requests to an NFS server. The effect is better use of server and network resources and better performance for the end user.

  • Fault tolerance WebNFS is well known for its fault tolerance in the face of network and server failures. If interrupted, some versions of FTP require the download to be restarted from the beginning, causing users to retrace steps and waste time in duplicating efforts. However, if a WebNFS client faces an interruption, it can resume a download from where it left off.

  • Performance and scalability NFS servers currently handle more than 21,000 operations per second. They are highly integrated with the OS, tuned for maximum system performance, and easy to administer.

WebNFS helps simplify remote file access. It can work with and through firewalls, meaning that system administrators can now specify which directories or files they want to “export,” or make available over the Internet. After these files are exported and an application requests them, WebNFS can automatically locate them, negotiate file access privileges, and transparently “mount” the files from anywhere on the Internet. Users can then access that data as if it were local to their machine.

Unlike current file access protocols, such as FTP and HTTP, WebNFS is a complete file system that supports in-place editing of a file, eliminating the need to download, edit, and upload the file. Instead, users can edit the original file right from their desktops. This saves time and preserves the integrity of shared files.

WebNFS can mount an entire file system at a time, or it can communicate with individual files on the server. This feature is known as multicomponent lookup (MCL). It lets the client look up a document based on a full given path to a file rather than having to look up individual components of that path until it can derive the actual file location. For example, to look up a file such as /books/solaris/test.txt in NFS, you have to look up the individual components (books and solaris) before you can find test.txt. With WebNFS, you simply pass the entire path to the server itself and have the server return the file handle directly. This improves performance by saving several steps of data transfers.

WebNFS also follows the improvements in NFS 3 by including larger data transfers than the 8KB limit imposed in NFS 2, a 64-bit data word size for files, and file systems larger than 4GB.

To use WebNFS, your web browser needs a client, and the web or FTP server needs a WebNFS server. If you request a file with WebNFS, your Internet address or URL would look something like one of the following:

nfs://computer.site.com/filedirectory/file 
nfs://<server>:<port>/<path> 
nfs://mymachine.javaworld.com:2049/home/rawn/webnfs.txt 
nfs://mymachine.javaworld.com/pub/edit.doc 

Note

A pathname for an NFS URL should not begin with a slash. A path that begins with a slash is evaluated relative to the server’s root rather than the public file handle directory.


NFS replaces the HTTP or FTP schema and needs to be implemented directly into the browser. The default port number is 2049; if the port is omitted, it defaults to 2049. This is the NFS port for TCP connections. The directory structure just shown is actually a relative path from a base that the NFS server understands.

How to Enable WebNFS Access

Starting with Solaris 2.6, all file systems available for NFS mounting are automatically available for WebNFS access.

Exercise 22.2 Manually Configuring a File System for WebNFS

To manually configure a file system for WebNFS access, follow these steps:

1.
Edit the /etc/dfs/dfstab file. Add one entry to the /etc/dfs/dfstab file for the file system that you want shared automatically. The index tag is optional, but the public option enables NFS browsing of the file system by a WebNFS-enabled browser:

share -F nfs -o ro,public,index=index.html /export/ftp 

2.
Check that the NFS service is running on the server. If this is the first share command (or set of share commands) that you have initiated, it is likely that the NFS daemons are not running. The following commands kill and restart the daemons:

/etc/init.d/nfs.server stop 
/etc/init.d/nfs.server start 

3.
Share the file system. After the entry is in /etc/dfs/dfstab, the file system can be shared either by restarting the system or by using the shareall command. If the NFS daemons were restarted in step 2, this command does not need to be run because the /etc/init.d/nfs.server script runs the command.

shareall 

4.
Verify that the information is correct. Execute the share command to check that the correct options are listed:

share 

The system should respond with output that looks something like this:

-        /export/share/man   ro   "" 
-        /usr/src     rw=eng   "" 

-        /export/ftp    ro,public,index=index.html  "" 

Using a Browser to Access an NFS URL

Browsers that can support WebNFS access should provide access using an NFS URL that looks something like this:

nfs://<server>:<port>/<path> 

server is the name of the file server, port is the port number to use (the default value is 2049), and path is the path to the file or file system. The path can be either relative to the public file handle or relative to the root file system on the server.

Note

Be sure your browser supports WebNFS. If it doesn’t, you’ll get an error similar to the following: “NFS URLs are not supported.” Currently, Sun’s HotJava browser supports WebNFS, and Netscape says that it will provide support in a future release. Microsoft’s Internet Explorer does not support WebNFS.


You can enable WebNFS access for clients that are not part of the local subnet by configuring the firewall to enable a TCP connection on port 2049. Just allowing access for httpd does not allow NFS URLs to be used.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset