NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | EXIT STATUS | ATTRIBUTES | FILES | SEE ALSO | NOTES
A servlet engine can be defined on any Sun WebServer server instance or any individual web site. The servlet engine runs a JavaTM virtual machine that loads and executes servlets defined in its servlets.properties file.
The htservlet command defines and modifies servlet engine runtime, security, and logging properties; adds or removes entries in the servlets.properties file; and loads or unloads servlets in running servlet engines.
For subcommands where -h hostname is optional, omitting -h applies the subcommand to the shared servlet engine (server-wide setting).
Subcommands
The following subcommands are supported:
You must restart the server in order for the changes made to the configuration files to take effect.
Adds a servlet to the servlets.properties file. Adding a servlet does not imply that the servlet is automatically loaded.
Configures a default cookie for the servlet engine and writes changes to the httpd.site.conf file.
Deletes a servlet from the servlet engine and writes changes to the servlets.properties file.
Disables an option on the servlet engine and writes changes to the configuration file.
Enables an option on the servlet engine and writes changes to the configuration file.
Displays help on usage.
Lists all loaded servlets on the server.
Loads a servlet from the servlets.properties file on a running server.
Configures the log location and cycling parameters and writes changes to the configuration file.
Returns current servlet engine settings on a running server.
Reloads a servlet on a running server.
Configures the security settings for the servlet engine and writes changes to the configuration file.
Configures the session management settings for the servlet engine and writes changes to the httpd.site.conf file.
Specifies the settings on the servlet engine and writes changes to the configuration file.
Configures the pool size for servlets that implement the SingleThreadModel interface.
Unloads a servlet from the running web server.
Displays the version of htservlet.
Options
The following options are supported:
Specifies the optional initial arguments passed to the servlet. Used in the format name=value [[, name=value...]]. Valid with the add and reload subcommands.
Specifies the URL of the servlet's code base. This URL can be pointing to a directory or a JAR file. Used only for remote servlets. Valid with the add subcommand.
Specifies a comment of the cookie carrying the session ID. Valid with the cookie subcommand.
Specifies the name of the servlet main class file. Valid with the add subcommand.
Specifies the domain where cookies with session IDs are valid. For example, if a cookie has a domain of "www.A.com", then only "www.A.com" will recognize it as a valid cookie. All other servers will reject this cookie. Valid with the cookie subcommand.
Specifies the directories and JAR files for the servlet engine on the local machine. This is a colon-separated list. This option can only prepend the path specified to the original path in the file. Valid with the settings subcommand.
The path name and the file prefix for servlet log files. As new log files are created, they use this prefix and a number suffix. Valid with the log subcommand.
Specifies a servlet engine option to enable or disable. Valid options are:
Enables or disables servlet chaining. Servlet chains are a sequence of servlets executed in the specified order to fulfill one single servlet request.
Enables or disables cookie support on this server. This is a server-wide setting.
Enables or disables the server to enable a JVM. This is a server-wide setting.
Enables or disables servlet error logging.
Enables or disables session persistence in the servlet engine. If session persistence is enabled, sessions are written out to disk on server shutdown, and recovered on startup. This is a server-wide setting.
Enables or disables rewriting of URL with session ID when a protocol switch is involved, for example, switching from "http" to "https" or vice-versa.
Enables or disables loading servlets from remote sites in this servlet engine.
Enables or disables the servlet engine for the server process or web site. This is a server-wide setting.
Enables or disables session support in all the servlet engines. If the session is supported, session swapping will be enabled by default.
Allows all sites on the server to share a single servlet engine. This is a server-wide setting. If this option is disabled, each site is allowed to create its own servlet engine instance.
Enables or disables URL rewriting for this servlet engine. If enabled, session IDs are appended to URLs by either the encodedUrl() or encodeRedirectUrl() method. This is a server-wide setting.
Specifies the name of the virtual host. Valid with all subcommands.
Specifies the length of time (in minutes) a session is allowed to remain unused before becoming invalidated on this servlet engine. Valid with the session subcommand.
Specifies the name of the server instance. Valid with all subcommands.
Specifies the class path for the Java virtual machine (JVM) which may include the location of classes.zip file of JDK, JSDK, and the servlet engine. This is a colon separated list (for example, usr/lib/java/ [[:/usr/java/lib...]]). This command only prepends to the existing path. Do not put the servlets directories in the server classpath. It is a server-level setting. Valid with the settings subcommand.
Because running the command-line utility htserver restart or restarting the server from the Sun WebServer GUI does not restart the Java virtual machine, if you change server_classpath, you must kill and restart the Sun WebServer process in order for your changes to take effect.
Specifies the initial servlet pool size for any servlets implementing the SingleThreadModel interface. Valid with the single subcommand.
Specifies the maximum servlet pool size for any servlets implementing the SingleThreadModel interface. Valid with the single subcommand.
Specifies the maximum number of log files. When the log suffix exceeds this number, the next log file is created which overwrites the first log file. The default number is 7 files. Valid with the log subcommand.
Specifies the name of the cookie used to carry session IDs when cookies are enabled. Default is "swssessionid
". Valid with the cookie subcommand.
Specifies the name of the servlet. Valid with the add, delete, load, reload, and unload subcommands.
Specifies the access settings used in conjunction with the -r option. Valid with the security subcommand.
Allows local and remote servlets to access resources.
Allows access only to resources on the same host.
Allows no access.
Allows access only to resources on servlets with a code base.
Specifies the full path to the properties file for the servlet engine. Valid with the settings subcommand.
Disables password prompting, and the password is piped ("|") to the command. Valid with the add, delete, disable, enable, load, log, reload, unload, security, and settings subcommands.
Specifies the path on the local host for which cookies with session IDs are valid. Pages outside of this path cannot read the cookie. This path is relative to the document root. Default is "/". Valid with the cookie subcommand.
Specifies the maximum number of resident sessions in a servlet engine. If the maximum number has been reached, sessions are swapped out onto disk. Session swapping is enabled if sessions are enabled. Valid with the session subcommand.
Specifies the resource settings used in conjunction with the -o option for access control. Valid with the security subcommand.
Sets access permissions for file resources such as read/write a file on local disk.
Sets access permissions for links to dynamic libraries.
Sets access permissions for network resources.
Sets access permissions for security resources such as classLoaders.
Sets access permissions for system resources such as System.Exec ().
Indicates that the session cookie will include the "secure" field. Valid with the cookie subcommand.
Indicates that the servlet will be loaded at start-up. Valid with the add subcommand.
The log cycle time measured in minutes. When the log cycle time exceeds this number, a new log file is created with an incremented suffix. The default time is 1440 minutes (1 day). Valid with the log subcommand.
Specifies user name. Valid with the add, delete, disable, enable, load, log, reload, unload, security, and settings subcommands.
Specifies verbose mode for more detailed messages. Valid with all subcommands.
Specifies the directory where sessions will be swapped during session persistence or when the number of resident sessions has exceeded the maximum. Valid with the session subcommand.
Specifies the maximum age of a cookie before expiring. Valid with the cookie subcommand.
Specifies the maximum log file size measured in bytes. When the log file size exceeds this number of bytes, a new log file is created with an incremented suffix. The default file size is 1048576 bytes (1 MB). Valid with the log subcommand.
# htservlet enable -g jvm -i sws_server -u admin
To load a declared servlet on a server:
# htservlet load -i sws_server -h www.A.com -n foo -u http
To add servlets to be loaded at start-up:
# htservlet add -i sws_server -h www.A.com -n foo \\ -c FooServlet -b http://x.eng/ -a counter=1 -s \\ -u http
To add a servlet declaration (in verbose mode):
# htservlet add -i sws_server -h www.A.com -n foo \\ -c FooServlet -b http://x.eng/ -a counter=1 -v \\ -u http
To set the server classpath:
# htservlet settings -i sws_server -j /usr/jdk/lib/classes/zip:. \\ -u http
To enable cookie support on a server:
# htservlet enable -g cookie -i sws_server -u admin
To set the cookie name for the default session identifier:
# htservlet cookie -i sws_server -h www.A.com \\ -N MySessionId -u admin
To set the session swap directory:
# htservlet session -i sws_server -h www.A.com \\ -W /tmp/sessionSwapDirectory -u admin
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Availability | SUNWhtsvl |
Interface Stability | Evolving |
The following files are used by this utility:
Contains the web site servlet engine configuration if the servlet engine is not shared.
Contains the server instance servlet engine configuration if all web sites share the servlet engine.
Defines each servlet that can be loaded by a web site.
If the command is run by the 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