Note the following:
Starting with the Solaris 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:
To allow NFS mounting on a server that does not currently allow NFS mounting
To reset the public file handle to shorten NFS URLs by using the public option with the share command
To force a specific HTML file to be loaded by using the index option with the share command
Starting with the Solaris Express, Developer Edition 2/07 release, you can do the following:
Use the sharemgr utility to share file systems, set property values for the shared file systems, and perform related tasks. For information about sharemgr, including descriptions of subcommands and properties, see the sharemgr(1M) man page and sharemgr Command.
Use the sharectl utility to configure file-sharing protocols, such as NFS. See the sharectl(1M) man page and sharectl Command.
When you use sharemgr, you do not need to use the share, shareall, and unshare commands. Also, you do not need to edit the /etc/dfs/dfstab file.
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.
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.
Use the sharemgr utility to assign property values to the file system to be shared by the WebNFS service.
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.
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 |
(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 |
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.
Use the sharemgr utility to verify what you have created.
# sharemgr show [-v] [-p] [-x] [share-group...] |
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.
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.
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 |
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 "" |