Installing Apache JServ and JSDK

NOTE: This process requires root access to your server, and is available only on the Freedom 400x and the Freedom 500x.

Step 1: Install the Java Servlet Development Kit (JSDK)

In order to install Apache-Jserv, you must first obtain and install the Sun Java Servlet Development Kit, which is located in the following directory on your server:

/usr/ports/java/jsdk

Because the JSDK package is distributed under a license that prohibits redistribution, this port must be installed manually. Once JSDK has been successfully installed, you may install the Apache-Jserv package without error.

To install JSDK, perform the following steps:

  1. Log in to your server as root.

This is done by typing the su command at your shell prompt and providing the root password, as shown below:

  > su

  Password:

  1. Change to the /usr/ports/www/apache-jserv directory by typing the following command at your shell prompt:

  > cd /usr/ports/www/apache-jserv

  1. Obtain the jsdk package.

This is done by visiting Sun's Web site with your preinstalled copy of Lynx, the text mode Web browser.

From the prompt, type:

  > make install

A screen of instructions appears, as shown below:

NOTES on USING LYNX:

You are now working within the Lynx text-mode Web browser. Use the "Up" and "Down" arrow keys to scroll through a page. Links to other pages are shown in bold text. To jump to another page, highlight the bold text link and press the [Enter] key on your keyboard. Lynx includes a menu at the bottom of each page. For further information, press H from within the Lynx browser.

  1. Scroll down to highlight the continue text link and press [Enter] to bring up the Java Technology Home Page:

  1. Accept or reject the license agreement.

The license appears below the ACCEPT and REJECT links. Highlight your choice and press [Enter].

NOTE: By accepting the agreement, you are bound to the license. To protect your rights, you should always read an agreement carefully before accepting.

You must choose ACCEPT to continue with the installation. Once you have done so, you are taken to the download page.

  1. Download JSDK.

Scroll down the page to select an appropriate download protocol such as HTTP download and press [Enter] to start the transfer.

Lynx will attempt to fetch "jsdk2_1-solsparc.tar.Z" from the download site you selected. After a few seconds, you should see the following highlighted prompt just above the bottom menu:

  "application/x-compress  D)ownload, or C)ancel"

Press D on your keyboard to instruct Lynx to download the file.

After some transfer activity, a Lynx post-download installation screen will prompt you to save the file:

  Standard download options:

  Save to disk

Make sure "Save to disk" is highlighted, and press [Enter].

The following line appears at the bottom of the Lynx browser window:

  Enter a filename: jsdk2_1-solsparc.tar.Z

Press [Enter], and the file will be saved. At this point, you can quit Lynx by typing Q then pressing [Enter].

Allow the build to complete.

Step 2: Modify the JServ Configuration File

Change to the jserv configuration directory, and modify jserv.conf to use your server's IP address by following these steps:

  1. Obtain your server's IP address (if you don't already know it) by typing the following command at your shell prompt:

  > ifconfig | awk '/inet/ { print $2 }'

Make a note of this address.

  1. Edit the JServ Configuration File.

First, locate and open the JServ Configuration file with the following commands:

  > cd /www/conf/jserv

  > pico jserv.conf

Next, Scroll nearly to the end of the document, where the following text appears:

  <Location /jserv/>

  SetHandler jserv-status

  order deny,allow

  allow from 127.0.0.1

  </Location>

Then, change the "127.0.0.1" in the "allow from" line to your IP address:

  allow from [insert your IP address here]

Finally, save your changes and exit with [Ctrl-X].

  1. Restart Apache.

Use the following command to restart Apache:

  > apachectl restart

  1. Test the servlet engine.

To test if the servlet engine is running, open your Web browser to the following URLs, where mydomain.com is the actual domain name of your server:

Servlet Engine test

NOTE: Do not forget the TRAILING slash in the following example, or you will get a Not Found error message!

http://www.mydomain.com/jserv/

Operational Examples:

http://www.mydomain.com/examples/IsItWorking

http://www.mydomain.com/examples/Hello

These servlets (with java source) are located in the following directory:

 /usr/local/share/java/servlets