NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXAMPLES | EXIT STATUS | ATTRIBUTES | FILES | SEE ALSO | NOTES
The htserver command creates and maintains the Sun WebServer server instances. Each server instance is a process associated with a configuration file, and each one hosts one or more web sites.
htserver can start, stop, and restart server instances. It can also enable or disable server instances. Each "enabled" server instance will be started when the machine reboots or when htserver start or htserver restart is run with no instance specified.
The list and query subcommands can be used to get information about what servers are running or enabled and what configuration files each instance uses.
Once a server instance is created, use hthost(1m) to add web sites. To modify the configuration, either use the Sun WebServer GUI (http://hostname:2380/admin/admin.html), or edit the server configuration file (see httpd.conf(4)).
The server instance named admin
is the administration server. This server instance is created when Sun WebServer is installed and listens to port 2380 on all IP addresses. The admin
server instance is used to access the Sun WebServer GUI.
Subcommands
The first argument to htserver must be one of the following subcommands:
Creates a reference to a new server instance so that it can be managed. An entry is added to the server list in httpd-instances.conf(4).
Deletes a server instance from httpd-instances.conf. This removes the server instance from Sun WebServer management, but does not delete the data or configuration files for the server or any of its sites.
Disables a server instance. Disabled instances can only be started by running htserver start instance_name, and explicitly specifying the instance name. the disable subcommand does not stop a running server instance.
Enables a server instance. Enabled instances will be started when the machine reboots or whenever htserver start or htserver restart is run with no instance named.
Solaris ISP Server has a background service that periodically checks the state of all enabled servers. If you have installed Sun WebServer as a part of the Solaris ISP Server, this service attempts to restart all enabled servers that are not running. If the restart fails due to an error in the server configuration, it disables the server and sends a message to the server administrator stating that the server has been disabled and will not be restarted automatically.
Displays usage information for this command.
Lists server instances and status information for all servers or each named instance.
Displays detailed status and statistical information about a named server instance. Also displays host and port statistics when used with the -v option. Status can be one of the following:
All processes have stopped running. Occurs when the server has been stopped or during a small time frame before the server enters Initializing status.
Server is parsing configuration files and initializing internal data structures.
All listening ports are waiting for client connections. Occurs when the server has started or restarted successfully.
Server is destroying data structures, closing connections and listeners, and killing all running server processes. After this cleanup, the server status changes to Initializing.
Server is destroying data structures, closing connections and listeners, and killing all running server processes. Same as the Restarting state except that after the cleanup process is complete, the process dies rather than returning to Initializing status.
Restarts named server instances or all of the currently running server instances.
Starts named server instances or all enabled server instances with the configuration files listed in httpd-instances.conf.
Stops named server instances or all running server instances.
Updates a named instance with the named configuration file.
Subcommand Options
The following options are supported:
Indicates that the command applies to Sun WebServer. Sun WebServer is a special server instance that allows remote administration of servers and sites through the Sun WebServer GUI.
Runs the command in verbose mode with more descriptive messages output to the screen.
The following operands are supported:
Specifies the name of a configuration file to use for a server instance. This operand is required as the last argument for the add and update subcommands.
Specifies a server by its instance name. Instance names are maintained in the /etc/http/httpd-instances.conf file. A single instance name is required with the add, update, delete, and query subcommands. Other subcommands take an optional instance name or list of instance names.
To list all server instances (nonroot users must use -z and provide a user name and password from the serverAdmin
realm):
% htserver list -z admin Enter Password for admin: Instance : sws_server Enabled : No pid : - Config file : //etc/http/sws_server.httpd.conf Instance : aws Enabled : Yes pid : 4018 Config file : /var/opt/SUNWixamc/awsconf/aws.conf Instance : SUNWixmon Enabled : Yes pid : 4020 Config file : /opt/SUNWixmon/sws/SUNWixmon.httpd.conf Instance : admin Enabled : No pid : - Config file : //usr/http/admin_server/conf/admin.httpd.conf
To create a new server named Large_Sites
with default values for the configuration file (/etc/http/Large_Sites.httpd.conf), server root directory (/var/http/Large_Sites), and site directory (/var/http/Large_Sites/websites/):
# htserver add Large_Sites Creating server configuration file: /etc/http/Large_Sites.httpd.conf Creating server root directory: /var/http/Large_Sites Creating site directory: /var/http/Large_Sites/websites/default_site Creating site configuration: /var/http/test_server/Large_Sites/websites/default_site/conf/default_site.site.conf
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Availability | SUNWhttp |
Interface Stability | Evolving |
The following files are used by this utility:
The server instance configuration file.
Tracks all Sun WebServer instances. When htserver creates a new instance, an entry is added to this file.
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 -z option and pass the user name and password of a valid administrator to the command.
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXAMPLES | EXIT STATUS | ATTRIBUTES | FILES | SEE ALSO | NOTES