System Administration Guide: Network Services

ProcedureHow to Enable WebNFS Access

Note the following:

See Planning for WebNFS Access for a list of issues to consider before starting the WebNFS service.

The following procedure uses the sharemgr utility. If you prefer to use the share and shareall utilities, see the example that follows this procedure.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Use the sharemgr utility to assign property values to the file system to be shared by the WebNFS service.

    1. Use the following syntax to create a share group with the desired property value.


      # sharemgr create [-P protocol] [-p property=value] share-group

      For example:

      • To create a share group that forces a specific HTML file to be loaded, you can use the index property:


        # sharemgr create [-P protocol] -p index=[file-path.html] share-group
      • To create a share group that moves the location of the public file handle from root (/) to an exported directory for WebNFS-enabled browsers and clients, you can use the following:


        # sharemgr set -P nfs -p public=true -s share-path share-group

        Note that the public property moves the location of a public file handle from root (/) to an exported directory for WebNFS-enabled browsers and clients. However, only one file system (or share) on each server can use this property. Because a share-group can consist of more than one file system, this property is not accepted by a share group. For more information, see the share_nfs(1M) man page.

    2. Use the following syntax to add shares to the share group.


      # sharemgr add-share -s share-path [-t] [-d description] [-r resource-name] share-group
    3. (Optional) If necessary, use the following syntax to set more property values to an existing share group.


      # sharemgr set [-P protocol] [-S security-mode] [-p property=value] share-group

      Note –

      You do not need to repeat this command-line syntax for each additional property value. You can use the -p option multiple times to define multiple properties on the same command line.


  3. Use the sharemgr utility to verify what you have created.


    # sharemgr show [-v] [-p] [-x] [share-group...]

Example 5–2 How to Use the share and shareall Commands to Enable WebNFS Access

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

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

    Edit /etc/dfs/dfstab. Add one entry to the file for every file system. The public and index tags 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. Share the file system.

    After the entry is in /etc/dfs/dfstab, you can share the file system by either rebooting the system or by using the shareall command.


    # shareall
    
  4. 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  ""