NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | EXIT STATUS | ATTRIBUTES | FILES | SEE ALSO | NOTES
htcontent creates or deletes information about the content of resources on a web site.
You can set whether directories can be browsed and also sets the format for directory listings. You can also create a list of default file names to search for in the directory.
For files, you can set preferences for HTTP 1.1 content negotiation. Preferences include character set, language, compression encoding, and media type.
You can set variant information for a Uniform Resource Identifier (URI). If a URI has a set of associated file variants, the server will select the most appropriate variant based on the client's preferences and the preference settings on each file variant.
See the Examples section for more detail.
Subcommands
The following subcommands are supported:
Adds directories, options, preferences, or variants for a URI.
Deletes directories, options, preferences, or variants for a given URI.
Displays help on usage.
Lists the configured directories, options, preferences, or variants for a URI.
Displays the version of htcontent.
Options
The following options are supported:
Specifies the virtual host name. Required with all subcommands.
Specifies the name of the httpd instance. Required with all subcommands.
Specifies the URI. The URI must already exist. Required with all subcommands.
Specifies options for directory listings and default files on directory options. Valid with all subcommands. This option requires a comma-separated list of parameters to specify directory settings. Lists should be specified in order of preference. The following are the valid directory options:
Deletes all preference or variants information. Valid with the delete subcommand.
Sets the method for displaying the contents of a directory when there is no file matching one of the default file names. Valid with the add and delete subcommands. The listing_type directive can be one of the following:
Displays each directory as a hyperlink with the file size, the last modified time, and an icon next to each entry to indicate the file type.
Displays no directory contents.
Displays directory entries as plain text hyperlinks.
Specifies the file associated with the variant information (-V) or a list of default file names in a directory (-O). Use a colon (:) to separate items in a list. File names must be relative to the URI. Valid with the add and delete subcommands.
Sets the server's content negotiation preferences for the specified URI. Valid with all subcommands. This option requires a comma-separated list of parameters to specify preference settings. Lists should be specified in order of preference. The following are the valid preference options:
Deletes all preference or variants information. Valid with the delete subcommand.
Specifies the character set of the data. A character set refers to a method used with one or more tables to convert a sequence of octets into a sequence of characters. The default charset for variants is ISO-8859-1. Valid with the add and delete subcommands.
Specifies the preferred encodings or the encoding type of a variant. Encoding refers only to methods of compression. For example, gzip or compress reveals which methods have been used to encode the file. For preferences, separate multiple encodings with a colon (:). Valid with the add and delete subcommands.
Specifies the preferred languages of a variant. Languages are specified in the standard two-letter format. For preferences, separate multiple languages with a colon (:). Valid with the add and delete subcommands.
Specifies the preferred types of media of a variant. Media type is in standard MIME type format. For preferences, separate multiple media types with a colon (:). Valid with the add and delete subcommands.
Disables password prompting. Passwords will be read from stdin. Valid with the add and delete subcommands.
Specifies a user name in the web site's administration realm (serverAdmin by default), or in the realm specified by the ACL from the URI. Required with all subcommands.
Specifies variant suboptions. Valid with all subcommands. This option requires a comma-separated list of parameters to specify variant settings. Lists should be specified in order of preference. The following are the valid variant options:
Deletes all preference or variants information. Valid with the delete subcommand.
Specifies the character set of the data. A character set refers to a method used with one or more tables to convert a sequence of octets into a sequence of characters. The default charset for variants is ISO-8859-1. Valid with the add subcommand.
Specifies the preferred encodings or the encoding type of a variant. Encoding refers only to methods of compression. For example, gzip or compress reveals which methods have been used to encode the file. For preferences, separate multiple encodings with a colon (:). Valid with the add subcommand.
Specifies the file associated with the variant information (-V) or a list of default file names in a directory (-O). Use a colon (:) to separate items in a list. File names must be relative to the URI. Valid with the add and delete subcommands.
Specifies the preferred languages of a variant. Languages are specified in the standard two-letter format. For preferences, separate multiple languages with a colon (:). Valid with the add subcommand.
Specifies the preferred types of media of a variant. Media type is in standard MIME type format. For preferences, separate multiple media types with a colon (:). Valid with the add subcommand.
This example displays a page named home.html in English, French, or German based on the client's preference. There are three files: home.en.html, home.fr.html, and home.de.html.
% htcontent add -i sws_server -h www.A.com -n home.html \\ -u admin -V f=home.en.html,l=en Enter Password for admin: % htcontent add -i sws_server -h www.A.com -n home.html \\ -u admin -V f=home.fr.html,l=fr Enter Password for admin: % htcontent add -i sws_server -h www.A.com -n home.html \\ -u admin -V f=home.de.html,l=de Enter Password for admin:
To view the variants associated with a URI, use htcontent list. After Example 1, you could verify the content settings:
# htcontent list -i sws_server -h www.A.com -n home.html \\ -u admin -V Enter Password for admin: home.de.html lang = de home.fr.html lang = fr home.en.html lang = en
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Availability | SUNWhttp |
Interface Stability | Evolving |
The following file is used by this utility:
Defines the content variants, encoding types, and directory preferences for a web site.
If the command is run by root
user, then the user name and password of an administrator are not required.
Users other than root
must use the -u option and pass the user name and password of a valid administrator to the command.
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | EXIT STATUS | ATTRIBUTES | FILES | SEE ALSO | NOTES