Java Web Server proves to be a worthwhile tool

By David Strom

(appeared in Infoworld, 7/21/97)

 

Java is everywhere these days, so why not create a web server in Java if you are a true believer? Indeed, there have been two efforts to date: one by the W3C as more of a demonstration called Jigsaw (http://www.w3.org/pub/WWW/Jigsaw/) and the other by Javasoft called, naturally, the Java Web Server. The former is free and rather bare-bones, the latter is free only for the first 120 days of use but has more features.

Why would you want to run a Java-based web server? I can think of a very good reason: it is an excellent teaching tool, showing you the various nooks and crannies of the language and what it can do. For instance, you could write an application to access your database in Java and run it on various platforms, without having to worry what API the web server was running. But before you rush out and download all 7 megabytes of code, do some planning.

First off, you'll need a Java-capable browser to setup and administer the server: all of the documentation pages and configuration routines are written as Java applets. While most v3 and later browsers work, I found that the best combination was to run Netscape Communicator v4 on the machine local to the web server itself. Running across my local ethernet network took several minutes to load the Java admin applets initially, but worked well enough going screen to screen. Still, administering this server over the Internet could require lots of patience.

Second, while Java has made lots of cross-platform hay, that is more of a promise than reality. The Java Web Server runs without much work on Windows NT and 95 and Solaris. And with some effort Sun representatives told me that it runs on a wide variety of other Unix platforms. You'll need a copy of the Java Virtual Machine for these other platforms and a fair level of expertise to configure the various shell scripts and to recompile the application if you want the server to run as a root user. (For more information on how to do this, see http://www.comoc.com/jeeves-faq.html.) In the meantime, I suggest sticking to the published versions, which include the necessary Java Runtime Environment as part of the downloaded web server code. If you want better cross-platform support, try Jigsaw which also runs on Macintosh and OS/2.

The Java Web Server has lots of features that make it a fairly respectable server. For example, it supports rolling log files (when a file reaches a certain size), secure transactions, and a proxy server. The real story here, however, is what Javasoft calls Servlets, tiny applications that run on the server and extend its functions. A bunch are included with the product, including one to display the current date and time, one to display the contents of the access logs, and one to query a database. Taking these apart and seeing how they work in conjunction with the web server is part of the learning process that this product offers. The Servlet API documentation comes with the product as well, and Javasoft supplies plug-ins to run Servlets on IIS, Netscape and Apache web servers as part of its Java Servlet Development Kit, which is freely available on the Javasoft web site.

Making changes to the server configuration is straightforward: you connect to the server with your browser at port 9090, and run through a series of Java applets to adjust parameters. Adding a new MIME type took less time than it would on IIS, where you have to edit registry keys and restart the server. On the Java Web Server, all configuration changes take effect immediately -- a nice touch.

I had some quibbles with the match of documentation to software, and also thought that the default port of 8080 is a bit obscure: most people will probably change this to the more common port 80. I tested the software on NT v4, running on a 180 Pentium -- which is about the minimum horsepower machine I'd recommend for the job.

For most web applications, I would steer clear of this server for garden-variety production web hosting, but would consider it in a shop that has -- or will want to have -- Java expertise.


THE BOTTOM LINE

Java Web Server

Version 1.0

A web server built entirely in Java.

Pros: An excellent teaching tool for those new to the language

Cons: Needs Java-capable browser to configure and maintain which could be slow over the Internet

Sun Microsystems

Mountain View CA

fax 408 343 1601

jserv.javasoft.com

800-JAVASOFT

512 434 1591

javasoft@harte-hanks.com

Price: $295 (Secure), $95 (nonsecure)

Platform: Windows 95, Windows NT v 4.0, Solaris v 2.4 or better

Copyright 1997 Infoworld Publishing Co.