locomotive.org


The Locomotive Embedded Web Server

This is the documentation for the Locomotive Embedded Web Server. This web server is written in pure-Java, and is written specifically to work with the Locomotive to be a seamless, easy to install and configure, servlet compliant, multithreaded web server.

The documentation for the Embedded Web Server is new, and not very complete, but it doesn't take much to set it up. See the Locomotive Embedded Web Server Installation Guide for a description of how to get it running on your computer.

Here's what the current version is able to do:

  1. Serve static content files as any web server would serve them to a browser.
  2. Uses the Locomotive's thread pooling, and config file parsing/loading classes.
  3. Re-uses the Locomotive's logging code to log requests to an access log that is written in the common web server log file format. All requests are logged except for requests that are passed through to the Locomotive (those aren't yet logged only because I haven't yet figured out an easy way to do it). These standard access logs can be parsed by any standard access log statistical utility program.
  4. Pass Locomotive servlet/handler GET and POST requests (handlers are untested through the EWS so far, but should work okay), and POSTs are now completely supported (try it, it works!).
  5. Allows configuring as many Embedded Web Server instances as you wish, each with a different config file (each could run on a different port, have different security, have different document root directories, etc).
  6. Passes HTTP cookies through to the Locomotive and back just fine (as far as I can tell so far, anyway).
  7. Runs on both UNIX and Windows (tested on both, works fine).
  8. Just like the Locomotive, each HTTPServer instance can be configured to allow requests only from a list of IP addresses (more great code re-used from the Locomotive).
  9. Enforces the document root directory that you specify. The Embedded Web Server now interprets ".." tokens in paths, and does not allow clients to back out of the document root directory.

Here's what the current version doesn't yet do:

  1. CGI. We may be able to do this via the Enhydra CGI servlet, but this has not been tested at all yet.. If you even try it, tell us about it!
  2. This web server currently only knows the MIME types for the following file extensions: .html, .gif, .jpg, and .class . All other files default to the text/plain MIME type until we get our own MIME types file (format?) and load it on startup of the HTTPServer. This will take some work, so it'll be at least a few weeks, I think.
  3. Listing directories. So far, the Embedded Web Server does not have any code for listing the contents of a directory. For better security, many web server administrators turn this feature off, but for many uses it is necessary, and often very useful/nice. In order to support this like it is supported in other web servers, we'll need icon images for different kinds of files, etc., and that's in addition to the code that uses them. We'll also need a handy way of turning this feature off, at least for the entire server instance.

But, please do try it out and let us know what you think.

Happy Serving!



$Id: index.html,v 1.7 2000/01/22 17:21:56 jason Exp $
$Revision: 1.7 $