Chapter 2: Runtime Parameters
GLACI-HTTPD normally loads its runtime parameters from a
configuration file called HTTPD.CFG. This file should
be located in the SYS:/ETC directory. Parameters are set with
variable/value pairs. A line begins with a variable name, followed
by any number of spaces, and then the value to assigned to the
variable. Each variable assignment must be on a different line.
For example, a config file might look like the following:
# GLACI-HTTPD 3.0 configuration file
# Created automatically on Sat Mar 16 19:01:53 1996
ServerPort 80
ServerName no.name.assigned
DocumentRoot SYS:\ETC\HTDOCS
IconDir SYS:\ETC\ICONS
CGIDir SYS:\ETC\CGI-BIN
TempDir SYS:\TEMP
WelcomePage welcome.htm
HomeDir SYS:\
ImageMapDir SYS:\ETC\IMAGEMAP
HtmlEqualsHtm YES
ListDirs YES
LogFile SYS:\ETC\ERROR.LOG
AccessLog SYS:\ETC\HTTPD.LOG
LogToScreen YES
Use311CGI YES
# IP ACCESS LIST
You can edit the HTTPD.CFG file directly, or you can modify the web server's
parameters via a web browser. GLACI-HTTPD version 3.0 includes a Web
Based Configuration option that makes it easy to alter your server's
runtime parameters. Connect to your web server and specify a document
path of /cgi-builtin/menu. For example, if your web server is
named www.yourdomain.com, you would connect to the URL
http://www.yourdomain.com/cgi-builtin/menu. You will be prompted to
enter a username and password. Enter a user name of admin and the
password you selected when installing the web server software. You should
now be presented with the following options.
- VIEW ACTIVE CONFIGURATION
- EDIT CONFIGURATION
- RELOAD CONFIGURATION FILE
- RELOAD MIMETYPE FILE
- CHANGE WEB ADMIN PASSWORD
Clicking on the EDIT CONFIGURATION SCREEN option will bring up a fill-in form
that can be used to modify the runtime parameters. Click the Send
button at the bottom of the form to submit your changes. Clicking the
Clear button will reset the form back to the current parameter
settings. By default, the changes you submit are made active but are
NOT saved to the HTTPD.CFG file. If you wish to save your changes, be
sure to check the Save Config box at the left of the Send
button.
The RELOAD CONFIGURATION FILE will simply load the configuration stored
in the HTTPD.CFG file and make it active. This is useful if you have
been testing parameter changes and want to return to your normal
configuration. It is also useful if you have edited the configuration
file with a text editor and wish to reload it without restarting the
web server.
The RELOAD MIMETYPE FILE option is usefull if you have made chages to
the MIMETYPE.CFG file (such as adding new file extensions or mime types)
and wish to make those changes active.
The CHANGE WEB ADMIN PASSWORD option allows you to select a new password
for accessing the Web Based Configuration Screens. It will present a
fill-in form with three password fields. Enter the old password in the
first field and the new password in the second and third fields. You
are required to enter the new password twice to verify you typed it
correctly. Clicking the Send button will submit the new password
and make it active. It also has the side effect of saving the current
runtime parameters to the HTTPD.CFG file.
- ServerPort sets the TCP/IP port number monitored for client
requests. Port 80 is the standard.
- CGIDir is assigned
the name of the directory where the CGI Scripts is located.
All files in this directory, and only files in this directory,
will be assumed to be CGI Scripts. The exception to this is NetBasic
scripts. Currently they must be located in the
SYS:\NML\USER directory. Any file which ends in .pl will
be called as a Perl script, any script ending in .bas or .nml will
be called as NetBasic scripts. All others will be executed as NLMs.
- TempDir designates
the name of the directory used to hold temporary files needed to run
Perl CGI scripts. The server deletes these files after use.
- DocumentRoot is assigned the path
prepended to every HTTP file request. This protects you from HTTP
clients getting into other directories on the NetWare server.
- IconDir defines the directory to
load icon image files from. It contains image files used by the
ListDir feature.
- WelcomePage is the file automatically sent when a HTTP
client requests the '/' document. This is particularly useful
when combined with a www.your.domain DNS alias for the file server,
making it much easier for net surfers to locate your home page.
If this option is commented out and the ListDirs option is turned
on, then requesting the '/' document will cause a file listing
of the DocumentRoot Directory to be sent. Note that a full pathname
should not be used. DocumentRoot is automatically prepended to
the WelcomePage name.
- HomeDir is the directory on the server where user home
directories are located. It is used to determine the location
of personal web pages. For example, given the following line in
the HTTPD.CFG file:
HomeDir DATA:/USERS
A user with the login name JOHN would have a home directory of
DATA:/USERS/JOHN. The web server will look for his personal web
pages in a subdirectory named HTDOCS within his home directory.
For example, if web server receives a request for the following
example URL:
http://sparrow.glaci.com/~john/mydoc.htm
It will attempt to send a file named DATA:/USERS/JOHN/HTDOCS/MYDOC.HTM.
In the example URL, the document path begins with ~john. The '~'
(tilde) character tells the web server that a user name follows.
- ImageMapDir: This option is here only
for backwards compatibility with older versions of GLACI-HTTPD. It
defines a directory to load image map files from. Image map files are used
in conjunction with ISMAP clickable image support. Prefixing a document path
with '/img/' tells the server that the requested file is an image
or image map file and should be loaded from the ImageMapDir directory.
Image Map files are not required to be in the ImageMapDir directory. They
must, however, have a .MAP extension.
- IP Access Lists are implemented
using the keywords 'ipallow' and 'ipdeny'.
The 'ipallow' keyword is used to specify
systems and networks which may connect to the web server. The
keyword 'ipdeny' is used to specify systems
that should be refused access. An ipallow or ipdeny keyword is
follow by an ip address in dotted decimal notation. Individual
octets of the address can be replaced with a '*' wildcard character.
This allows entire networks or subnetworks to be specified. An
example access list follows:
ipdeny 199.170.176.2
ipallow 199.170.176.*
ipdeny *.*.*.*
Access lists are always scanned from top to bottom. The web server
compares the connecting address with each entry in the list and
stops at the first matching entry. It allows or denies access
as specified by the entry. In the above example, the first line
specifies that address 199.170.176.2 will be denied access to
the web server. Line two specifies that all other addresses on
that network will be allowed access. The final line indicates
that all other nodes on the internet will be denied access.
If no matching entry is found, the connecting address is given
access. If the access list is empty, then IP access lists security
is disabled and anyone can connect to the server.
- HtmlEqualsHtm, when set to YES, causes document requests
with a .html extension to be automatically shortened to a .htm
extension. This may save you some trouble when moving documents
from a UNIX web server to the NetWare web server; you will not
have to change the embedded links in the document to reflect the
shortened extension.
- ListDirs allows HTTP clients to request a listing of files
in any directory under the DocumentRoot when it is set to YES.
You may wish to let ListDirs equal NO if you prefer restricting
web browsers to using the embedded links in your documents for
navigating your files.
- LogFile designates the name of the file that HTTPD logs
messages to. If HTTPD is loaded with the -debug flag then the system
will fill the log file with much debug info. Commenting out the
LogFile line will turn off the log file. No automatic trimming
of the log file is done. The system administrator must check it
occasionally and make sure it does not fill up the file system.
- AccessLog designates where web page access information
should be logged. The log file is compatible with the standard
log file format used by the CERN and NCSA web servers.
- SetLogToScreen should be set to YES if you want log messages
sent to the server console as well as the log file. Commenting
out the entry has the same effect as setting it to NO.
- Use311CGI: This parameter is only significant if you are using
CGI forms to invoke Perl scripts or NLMs you've written yourself. It is
NOT used by NetBasic. It should be set to YES if you wish to use the NetWare
3.11 style CGI Perl scripts and you are running NetWare version 4.0 or later.
You might want to do this if you have existing scripts which are
designed to handle the input and output files explicitly. See
Chapter 4: NetWare CGI Scripts for more details. This setting has
no effect if your server is running NetWare 3.11 or 3.12.
- AdminPassword is used to set the password for accessing
the Web Based Configuration features. An encrypted version of the
password is stored in the HTTPD.CFG file. It can be set using
Web Based Configuration as described in above.
TheMIME Types File
The configuration file for MIME types is named MIMETYPE.CFG and
is stored in SYS:\ETC. Each line in the file defines a single
MIME type. The leftmost column contains the MIME type string,
followed by a space seperated list of filename extensions that
should be associated with that MIME type. A line that begins with
a '#' character is considered a comment and is ignored. The default
MIMETYPE.CFG file that comes with GLACI-HTTPD is probably sufficient
for most users, but it can be easily added to if you have special
MIME types you wish to accommodate.
Normally the HTTPD NLM is loaded by using the LOAD command
at the server console prompt. If you installed the NLM in a directory
other than SYS:/SYSTEM, then you need to include the full volume
and directory in the LOAD command. For example, if you want to
load the HTTPD NLM from the /INTERNET directory on the APPS volume,
you would type the following:
load apps:/internet/httpd
Otherwise, if HTTPD.NLM is in the SYS:/SYSTEM directory, you need
only type:
load httpd
This load command can be placed in your server's AUTOEXEC.NCF
file to automatically load the HTTPD NLM whenever your server
boots. The LOAD HTTPD command should be placed after the LOAD
TCPIP command.
Sometimes it is useful to alter a runtime parameter for a brief
time without altering the HTTPD.CFG configuration file. This can
be done with command line parameters when the LOAD HTTPD command
is executed. To see a listing of the avaliable parameters, simply
load the HTTPD.NLM with the -h flag. Thus, if you type the following
command:
load httpd -h
The following message is printed to the screen:
USAGE: load httpd [-h] | [-c configfile] [-d directory]
[-i icondir ] [-l logfile ] [-w homepage]
-c Use a different configuration file
-d Set the root document directory
-i Set the icon directory
-h Print this help message
-l Set the log file
-w Set the file name of the welcome page