Installation Configuration of the SimpleHTTPd

The configuration can be done remote via browser. Per default the URI (Uniform Ressource Identifier) /admin is mapped to the WWW server's administration tool. The first time, you enter this section, you will be prompted for a user name and password for an administrator account. This is necessary to prevent hackers for cracking your (unprotected) system, when no administrator account is set.

Administration section

The main menue is separated in different blocks. These blocks are marked by colors for better optical fraction. These table background colors have no certain meaning.
Main SectionSub-SectionMeaning
Common Settings Common settings of the WWW server, like name of the WWW server (which may vary from the machine's name in the network), eMail address of the server's responible, etc.
-->MIME Types The MIME types allow the server to tell the client, which file contains what kind of data. For instance, to tell the client, that a file with extension *.gif is an image, there is a line within this section, mapping .gif to the MIME type image/gif, so the client knows how to handle such images.
Notes:
  • The flag 'compression' specifies whether on-the-fly data compression makes sense for this type of data or not. Compression only takes place when compression is enabled on both access path and MIME type, and the client browser supports such feature!
Access Paths This is a translation list for incoming requests, which is are mapped to (a) a certain module, (b) to a certain path within the system. Since a request may result in static or dynamically generated data, there must be a distinguish between the processors of the request. Here, the processors are represented by internal and loadable modules. The requests can be distinguished by either path, extension or both. If path or extension is omitted, all requests match in that category. For some requests, it further necessary to translate the WWW notation to a local access path, e.g. a path in the file system. Requests may then be blocked or obeyed by a security scheme, that means, access is granted only by giving a user name & password.
Notes:
For translation of paths into the local file system, there are these special tokens:
  • %bin% = is replaced by the path to the WWW servers executable, i.e. if the server runs in /usr/local/www/bin/, %bin% points to /usr/local/www/bin.
  • %doc% = is replaced by the path to the WWW servers executable, striped by one directory. I.e. if the server runs in /usr/local/www/bin, %doc% points to /usr/local/www.
  • The flag 'compression' specifies whether on-the-fly data compression shall be enabled or disabled. If enabled and the remote browser supports such feature, all data sent back is GZIP compressed (compression ration depends on type of data and may vary in between 1:2 ... 1:8). Be aware that there is another 'compression' flag in the MIME type section!
  • The flag 'req. SSL' specifies if an access path must only be available for SSL connections. If set, a non-SSL connection will result in HTTP response code 499 ('requires SSL').

Explanation:
The button to end moves an entry to the end of the list. It may be used for sorting an entry to the right position in the list.
-->Default Files, Index, ... The so-called default files are the files which are searched when either no file name is given, or the specified file could not be located. (note: This is a behaviour different to other WWW servers. SimpleHTTPd first tries to find a default file before returning an error.) This list is processed top-down, like any list within the configuration.
List of Modules This is a list of loadable modules - under Unix, so-called *.so or *.sl (HP/UX) files, under MS Windows 95/98/NT/2000/... and IBM OS/2 *.dll files. Loadable modules are shared objects, shared libraries or dynamic link libraries (depending the platform). They are loaded at run-time, so there is no need to re-compile the WWW server when addin or removing a modules. There is a list of internal modules which are linked in the WWW server, which cannot be removed or modified. These modules do not appear in this List of Modules:
  • ADMIN = administration module for online administration
  • FILE = access to static data (HTML pages, images, ...)
  • INFO = (reserved for future use)
  • INSTALL = note for misconfigured system, is also used, when a path cannot be resolved by the access path list
  • PATH = prefix and remapping - remaps an incoming request (URI) to another path (URI). This may be helpful for adding a security scheme to various other URIs without having the need to keep these entries twice (e.g. /int/bin/status and /bin/status shall result to one CGI call, but /int/ shall be password protected. So you may PATH the incoming request /int/ to /, which is password protected by a security scheme.
Dynamical loaded modules have a name starting by MOD_.... Such modules are stopped and re-started after each and every change in configuration.
-->Configuration of Module ... (reserved for future use - individual configuration of modules)
List of Authorization Schemes An authorization scheme is a list or group of users, that have access to a certain URI or path. Access paths may be mapped to these authorization groups. A user may be member of several authorization schemes, but it is wise to limit the number of occurrences and to set the schemes by rank levels (public groups, higher priviledged users, administrators, ...).
-->Users of ... List of users, which are within an authorization scheme (group). Note: Passwords are encrypted by a one-way encryption routine, so no passwords can be displayed nor cracked!

Configuration File

Per default, the configuration file is assumed to be named to httpd.cfg. If no calling parameter is given, this file is searched in the current directory. If a calling parameter is set, this configuration file is tried to be loaded. If either methods fail, a default configuration file httpd.cfg is searched in the directory, where the binary of the WWW server is located. If this search fails, default settings are taken and a httpd.cfg is created within the directory, where the WWW server (binary) is located.

The configuration file is an ASCII file, which is separated in groups and settings. A group is marked by a line, starting at the left with a bracket:

        [group name]
Below the line, all entries not starting at the line start belong to that group. Settings are separated to setting name = setting value.

Calling Parameters

For security reasons, some settings can only be done by calling parameters, i.e. parameters passed to the SimpleHTTPd at start-up via command line. The syntax of the SimpleHTTPd when calling by command line is:

  (1)   shttpd -help
  (2)   shttpd -register
  (3)   shttpd -unregister
  (4)   shttpd [-dump [FILE]] [-cfg FILE] [-port N]
  1. -help = request online help, don't start server
  2. -register = register WWW server to system for automatic startup. E.g. under MS Windows NT, register to registry.
  3. -unregister = un-register WWW server from system, reverse to -register.
  4. -dump [FILE] = write all incoming and outgoing HTTP headers to the given file or - if not specified - to a file httpd.dmp in the WWW server's binary directory (for debugging purposes).
    -cfg FILE = use an alternative configuration file.
    -port N = use alternative TCP/IP port for WWW server. Default is port 8000.

List of Modules

The distribution knows some modules. Some of them are for testing and demonstration, some are ready for use. Feel free to watch the administration section and the online documentation for to see, how to use the modules.

Module NamePurpose
MOD_cgiModule for accessing CGI scripts.
MOD_roboSearch engine and robot for checking the web site.
MOD_sslData encryption on basis of secure socket layers (SSL). This module enables a second port on the WWW server for secure access.
MOD_statStatistics generation. The modules produces an empty, transparent GIF image and counts the hit on a certain entry. Entries are specified by (case-sensitive) names. There is a fix limit on names - if the limit is reached, the entry with the lowest hit rate is overwritten. The modules stores the statistics data in the WWW server's directory in an ASCII file. To mark a page for statistics on a name hit_me, you have to include a line
        <IMG SRC="/stat?hit_me">
within the HTML page (if the default access paths are set).
MOD_testSample module for demonstration of how to program a module. See next section.

Localization, National Language Support (NLS)

The SimpleHTTPd knows a very basic support for national languages. Normally, a user may specify within his browser which languages he/she prefers to get documents in. The browser send this request list via the HTTP request in a line Accept-Language. For instance, the browser may send the line

        Accept-Language: de, en, fr
which means: If there is a german (de) version of the document with this URL, send it. If not, check then for an english (en) or a french (fr) version. The WWW server uses this information by adding the language/country code to the name of the file matching the URL. So if there is a file index.htm matching the URL http://somewhere.com/pub/index.htm, it is
Note:
index.htm must be available! If the base HTML file does not exits, an error is returned to the caller. National Language Support (files in localized languages) is treated as an option, where the base file must exist.

This support of NLS is only available on static HTML pages, i.e. HTML files. For modules and CGIs, the support has to be added by the programmer himself. The administration section and most parts of the online documentation will only be available in English.

The country/language tags are used that way, they are added to the end of the corresponding base HTML file name plus a dot, i.e.

        <base_HTML_file_name> + '.' + <country_code>
The country_code is a copy of the code given by Accept-Language, but only ASCII codes 'A .. Z' (which are converted to their lower-case counterparts), 'a .. z', '0 .. 9' are copyied, '.' (dot) and '_' and '-' are converted to '-', all other characters are skipped.

>> <<

Table of Contents
Table of
Contents
Index
Index A-Z
Server Administration
Server Ad-
ministration
Copyright
Copyright
Notes
©. 1998-2000 by Dirk Ohme