The Configuration Hosts Card
Contents / Working with
Virtual Hosts / The Hosts Card Fields
The Configuration Hosts Card is used to change parameters for a specific
host. It allows you to:
- Configure the document root directory
- Define a user directory
- Enable or disable CGI
- Enable or disable Server Side Includes
- Setup logging formats and parameters
When you first login to the Sun WebServer and select the Configuration
Folder, there is only one Hosts Card displayed. This is the Hosts Card
for the host machine on which the Sun WebServer is installed.
However, the Sun WebServer can support an unlimited number of Hosts,
each with its own fully-qualified domain name, document tree, port assignment,
and so on. Each additional host you add to the Sun WebServer is called
a "virtual host." Once you add a new host to the Sun WebServer,
its name gets added to the Hosts menu.
Working with Virtual Hosts
You can use the Hosts Card to:
NOTE: In order to properly use the virtual hosting feature of
the Sun WebServer, you must have already set up your network to recognize
the host names and/or IP Addresses you may create.
The Hosts Card Fields
The Configuration Hosts Card fields are:
- Hostname-Defines the name of the default host or the current
virtual host.
- Document Root-Sets the root directory for the documents to be
served by the host. The default document root directory is /var/http/demo/public.
- Directory Listing - Determines
how directory listings will be sent to clients. Fancy means that
files will be listed with icons, file sizes, and last modified dates. Simple
means that only file names will appear in directory listings. Off
means that the contents of directories will not be sent to clients.
- User Doc Enable -If checked, allows
UNIX users to create personal HTML directories. Users can then
publish HTML documents without having access to the main document
root. If enabled, a UNIX user can create a directory with the User Directory
name in their home directory. SWS will look in this directory
when it receives URLs in the form: http://hostname/~username/.
- User Directory-Sets the user document directory for the default
or current virtual host. The default user directory is public_html
.
- CGI Enable - If checked, allows
CGI scritps to be executed on this host. You may wish to edit the
map directive in the server configuration file that sets the location of
the CGI directory. See the on-line Adminstration Guide's CGI section
for details.
- .cgi Suffix Enable - Should only
be checked if CGI Enable is also checked.
.cgi Suffix allows files outside of the defined CGI directory to be
executed as CGI if they have a .cgi extension. There may be security
risks in allowing .cgi files to be executed from any directory, so enabling
this is not recommended under most circumstances.
- DNS Enable - Turns on domain name
lookups for clients making CGI requests. When this is not on,
only the client's IP address is available to CGI scripts through the
REMOTE_ADDR variable. If you enable DNS lookups, the name of the
client will be stored in the REMOTE_HOST variable. DNS lookups
require some processing, so enabling this feature will slow SWS performance
for CGI scripts.
- CGI User - Sets the username that
will execute CGI scripts. The default is nobody.The username you enter
must already exist and have permission to execute files in your CGI directory.
- Enable SSI-A toggle that enables or disables the use of the
SWS Server-Side Includes feature. The default
is No.
- Allow SSI Exec-A toggle that enables or disables execution of
CGI or system comands from within SSI files. The default is No.
- SSI Xbithack - If on or
full allows any file in the document root with the executable permission
set to be parsed for SSI directives; if off, only files ending
in .shtml can be parsed for SSI directives. If set to on, then
files with the user's executable bit set can be parsed, and if set to full
then any file with user and group execute permission set can be parsed.
- Log Format-Sets logging to use one of three choices:
- Common-A log format used by most HTTP servers and analysis tools.
- Binary Common-A log format similar to the Common Log Format, except
that the field separators are '\0' null characters.
- Extended-A log format designed to record more extensive logging information.
Extended Log Format is the default.
- None
- Log Prefix-Sets the log file directory and
filename prefix. Everything you enter up to the final '/' is considered
a directory path; everything that follows is a prefix for the log file
names. Log files will be created in the named directory with file names
in the form: prefix.log_type.sequence. For example, /var/http/logs/http.elf.1.
The default directory is /var/http/logs/httpd.
- Max Files-Sets the maximum number of log
files that can be created before starting over at the first file and sequentially
overwriting them. You can set any number of files you want; the default
is 7files.
- Max Size (MBytes)-Sets the maximum size for each log file before
a new log file is created with an incremented sequence number (up to Max
Files). The default size is 1 Megabyte.
- Cycle (minutes) - Sets the maximum
age in minutes for each log file. If a log file reaches this cycle time,
a new log file with an incremented sequence number (up to Max
Files) will be created. The default cycle time is 1440 minutes, or
one day.
- Remove Host-A button at the bottom of the screen that removes
the name of the current virtual host and removes it from the Sun WebServer
mapping tables.
To Define a New Virtual Host
- Select Configuration from the Folders area.
- If the configuration you want to edit is not open, select Open
from the Config menu.
- Select New from the Hosts menu. A host card with default
settings displays.
- Enter the fully qualified domain name for this host in the Hostname
field.
- (Optional) Change other parameters of the Hosts card, such as the document
root.
- (Optional) Display the Ports card by clicking on the Port name or selecting
a port name from the Ports menu.
- (Optional) Assign the virtual host to a port number or make other changes
to the Ports card parameters.
- Select Save from the Config menu.
- Select Restart from the Config menu.
- If your network is properly set up to recognize the addition of virtual
hosts to your server, enter the following URL into your browser: http://virtualhost/
to connect to the new host.