Snug HTTP server - Using the program

  • Introduction
    • Introduction
    • Licens agreement
    • Contact information
  • Installation
    • Installing/uninstalling
    • Additional tweaking for BeOS, UNIX and Linux users
  • Configuration
    • The configuration file
    • LogMaxEntries
    • LogMaxAge
    • LogRotation
    • LogDir
    • ExtendedMessages
    • Port
    • Address
    • ExternIP
    • Timeout
    • AddAllowedReferer
    • MaxConnections
    • DirectoryListing
    • ShowProtectedFiles
    • AddIndex
    • AddType
    • AddForbidden
    • AddUser
    • AddVirtual
  • Using the program
    • Versions of Snug HTTP server
    • SnugW16.exe
    • SnugOS2.exe
    • SnugBeOS
    • SnugW32.exe
    • SnugAROS
    • Running the program
    • Troubleshooting
    • URLs and URL encoding
    • Directory listings
  • Compiling
    • BeOS, BeIDE
    • Linux, UNIX, GCC
    • Microsoft Windows, BCC 5.02
    • OS/2, Open Watcom

Versions of Snug HTTP server

Snug HTTP server exists for different plattforms. On this page you will find a short presentation of the different versions. This program is a console application so don't expect a fancy GUI. All versions works in the same way.

SnugW16.exe

This is the main executable for Microsoft Windows For Workgroups 3.11. This version derived from the fact that I couldn't get linux to run on my old AST PowerExec 4/25SL (25 MHz/4 MB of RAM). SnugW16.exe was tested with TCP32B.EXE (TCP/IP stack for WFW 3.11) and PW1118.EXE (Win32s) installed. If you need help retrieving those files, please contact me. After installing TCP32B I receive 'Error 3658: The IFSHLP.SYS driver is not installed.' In my case I solved the problem by adding DEVICE=C:\WINDOWS\IFSHLP.SYS to the end of my config.sys. Also make sure that NET START is added to your autoexec.bat. You can also load IFSHLP.SYS using DEVICEHIGH. This loads device drivers into the upper memory area, Himem.sys and a UMB provider, such as Emm386.sys, must be loaded in conventional memory (using DEVICE=himem.sys and DEVICE=emm386.exe commands). The DOS=umb command must also be included in Config.sys. This version is compiled for the i386 instruction set. This version also run on OS/2 but reportedly uses 100% CPU resources. Use the native OS/2 port instead.


SnugOS2.exe

This version is tested on OS/2 Warp 3 connect and eComStation (unkown version). It uses the old 16-bit TCP/IP stack but will run on systems with the new 32-bit stack.


SnugBeOS

This version is tested on BeOS R5.0.1 and BeOS developer Edition 1.1 and ZETA 1.21. Hardware requirements for BeOS are low and that made BeOS interesting for a Snug HTTP server port. The program must be started from the Terminal application. Start the program with ./SnugBeOS -config snug.ini. BONE (BeOS Networking Environment) is not required.


SnugW32.exe

Main executable for Microsoft Windows systems. This version should be compatible with Microsoft Windows 95 and newer. Tested on Microsoft Windows 95, 98SE, ME, NT3.51, NT4.0, 2000, 2003 Server, XP and Vista. Developement was done on Microsoft Windows 98SE and long term testing was done on NT 3.51. If the window flashes up momentarily and finishes in an instant, run it from the command prompt instead. If you are running Microsoft Windows, choose run on the start-menu and type in command or cmd to open a console window. Then run SnugW32.exe from the command prompt instead.

SnugAROS

Main executable for Amiga Resarch Operating System. This version is under developement

Running the program

You can start the program with parameter ?, which gives a brief help and a list on available parameters that can be passed to the program. An optional parameter -config can be passed to the program specifying which configuration file to use. The program can also be run without specifying any parameters. In that case snug.ini will be used or an error will be displayed if something goes wrong. Use ./SnugUNIX -config snug.ini on UNIX to start SnugUNIX with snug.ini as configuration file. If you are using Microsoft Windows or OS/2 you can double-click on the approriate executable.

SnugW32.exe

Typical sight if SnugW32.exe is ready to serve web content. You should be able to access the server's content from a web browser by typing in the address and port number shown in the console window.


Troubleshooting

During initialization, the program will halt at the first error, writing an error message to stderr (the console in most cases) and terminate if neceassry. All other messages is written to stdout (the console if not redirected). Almost all error messages generated by the program is self-explanatory. Most error messages will be the result from a faulty configuration. The solution is to carefully check the configuration file for errors. Once the server is running you can obtain extended error messages if ExtendedMessages=1 in the configuration. This will for example reveal if a file exists or if it has wrong access flags set and thus cannot be read from. Most error occurs at startup, problems seldom occur during operation. Some common errors are explained below.

The line 'xxx' is missing. - The server expected line xxx in the configuration file. Take a look in the Configuration section in this instruction manual to see more information about parameter 'xxx'.

Could not get current working directory. - This error will most likely be caused if the file structure is too deep. Try moving the Snug-directory to a higher level in the file structure (for example to a parent directory or C:\program files\Snug on Microsoft Windows system).

Associate local address with socket failed. - Another network application is most probably using the same port number as specified in configuration.


URLs and URL Encoding

UTF-8 encoded URLs are not supported and cannot be decoded correctly by the server. Only support for 7-bit US-ASCII encoded URLs are supported. If this is a problem UTF-8 encoding must be disabled on the client side or change the filenames.

The maximum URL-length the server can handle is somewhere around 500 characters depending on the configuration. If the limit is exceeded, the server will respond with 414 Request-url Too Long. To be on the safe side use a-z, A-Z and 0-9 and some of the other characters in the 7-bit ASCII set.

Disabling UTF-8

Disabling UTF-8 in the Opera web browser.

Directory listings

The directory listings use tables which makes in incompatible with some text based browsers. This should not be a problem with modern browsers (tested with WebExplorer on Warp 3 and 4 and Netscape Navigator on Red Hat 5.2). The appearence of directory listings cannot be changed. It is possible to hide certain files in the directory listing. All that you need to do is to add a period (.) to the front of the filename in linux and comma (,) if you are using Microsoft Windows. A period is the default method of hiding files in linux. However, using periods as the first character in a filename on Microsoft Windows may result in an error message (You must type a filename.).

Typical directory listing

Typical directory listing as shown in Opera 8.01.