System Administration Guide: Resource Management and Network Services

How to Enable WebNFS Access

Starting with the 2.6 release, by default all file systems that are available for NFS mounting are automatically available for WebNFS access. The only condition that requires the use of this procedure is one of the following:

See Planning for WebNFS Access for a list of issues that you should consider before starting the WebNFS service.

  1. Become superuser or assume an equivalent role.

    For information about roles, see “Using Privileged Applications” in System Administration Guide: Security Services.

  2. Add entries for each file system to be shared by using the WebNFS service.

    Edit /etc/dfs/dfstab and add one entry to the file for each file system. The public and index tag that are shown in the following example are optional.


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

    See the dfstab(4) man page for a description of /etc/dfs/dfstab and the share_nfs(1M) man page for a complete list of options.

  3. Check if the NFS service is running on the server.

    If this is the first share command or set of share commands that you have initiated, the NFS daemons might not be running. Check to see that one of the NFS daemons is running by using the following command.


    # pgrep nfsd
    318

    318 is the process ID for nfsd in this example. If an ID is not displayed, it means that the service is not running. The second daemon to check for is mountd.

  4. (Optional) Start the NFS service.

    If the previous step does not report a process ID for nfsd, start the NFS service by using the following command.


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

    This command ensures that NFS service is now running on the servers and restarts automatically when the server is at run level 3 during boot.

  5. (Optional) Share the file system.

    After the entry is in /etc/dfs/dfstab, the file system can be shared by either rebooting the system or by using the shareall command. If the NFS service was started earlier, this command does not need to be run because the script runs the command.


    # shareall
    
  6. Verify that the information is correct.

    Run the share command to check that the correct options are listed:


    # share
    -        /export/share/man   ro   ""
    -        /usr/src     rw=eng   ""
    -        /export/ftp    ro,public,index=index.html  ""