Next Previous Contents

4. How to Setup Java Servlet Support

There are several Web Server plug-ins and Application Servers available for Linux that provide support for Java Servlets. These include:

If you are going to try just one, I suggest you initially try Apache JServ.

4.1 Allaire JRun

To be written.

See http://www.allaire.com/products/jrun/for more information.

4.2 Apache JServ

Background

Apache JServe is a 100% pure Java servlet engine fully compliant with the Java Servlet 2.0 specification. Apache JServ is part of the Java Apache Project. (From the Apache Java Project website).

Download

Apache JServ can be obtained from http://java.apache.org/jserv/index.html.

>From the Apache JServ Project home page, follow the Download Apache JServ link.

Currently RPM distributions are available for RedHat Linux. For other Linux distributions you will have to build from source. The following example describes how install the RPM for RedHat 6x.

As of the time of this writing, the current version is 1.1b3.

Installation

I suggest installing files in the /usr/local directory. After downloading the files, run:

mkdir /usr/local/apachejserv  
mv ApacheJServ*.rpm /usr/local/apachejserv 

For RedHat and RedHat-derived distributions, use the RedHat Package Manager (RPM) to install the rpm file such as:

rpm -i ApacheJServ-1.1-b2_RH6x.i386.rpm  

The above example shows version 1.1-b2 for the RedHat 6x on the Intel architecture.

Setting up Your Environment

You will need to stop, set your Java environment variables, and restart Apache to register Apache JServ.

To stop Apache, type:

cd /etc/rc.d/init.d
./httpd stop

Note: The httpd script used at boot time may be in a different location on other Linux distributions

To set you Java environment, see the How to Install the JDK section of this document, specifically for the JDK you intend to use. You need to set several properties in the jserv.properties file installed in /etc/httpd/conf/jserv. Specifically, look for:

To restart Apache, type:

cd /etc/rc.d/init.d
./httpd start

Confirming Your Installation

To confirm that the Apache JServ is installed and running on your computer, open your web browser, and enter the URL: "http://127.0.0.1/servlet/IsItWorking" substituting the correct IP address if you are browsing from another machine.

You should see a web page to the effect of "Yes, It's Working!". Contratulations, you have installed, set up an environment for, and tested the Apache JServ for Linux.

For more assistance, I suggest you look into the Apache JServ website at

http://java.apache.org/jserv/index.html.

Now, to compile and run your own servlet. Enter the following Java servlet program.

import java.io.*;  
import javax.servlet.*; 
import javax.servlet.http.*; 
 
public class HelloWorldServlet extends HttpServlet { 
  public void service (HttpServletRequest request, 
    HttpServletResponse response) throws ServletException, IOException { 
  } 
}

More Information

For more information, I suggest you look into the Java Apache Project website at http://java.apache.org/.

4.3 BEA WebLogic

See BEA WegLogic below.

4.4 Enhydra

To be written.

See http://www.enhydra.orgfor more information.

4.5 IBM WebSphere

To be written.

See http://www-4.ibm.com/software/webservers/appserv/linux.htmlfor more information.

4.6 Locomotive

To be written.

See ://www.locomotive.org/for more information.


Next Previous Contents