Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home
Jazz home  >  Software

Java servlets HP freeware for MPE/iX

» 

Jazz home

»

Software

»

Papers & Training

»

Java

»

HP Partners

»

News & Events

»

Register for more info

Content starts here

Last updated 04/26/01

Java servlets is unsupported freeware from HP for MPE/iX. It is add-on functionality to the Apache Web Server for MPE/iX and to the HP WebWise MPE/iX Secure Web Server. With this functionality, Java servlets can be compiled and run on the MPE platform. Java servlets are server-side Java code for creating dynamic web pages and developing web applications. Servlets are similar to java applets except they run on a server instead of in a browser.

Servlets can be used wherever CGI might normally be used. Servlets allow for session persistence and have faster startup times than traditional CGI.


FREEWARE:

Java servlets is unsupported freeware that has been ported and packaged by HP for use on MPE/iX. This software has been minimally tested with Apache for MPE/iX and with WebWise Secure Web Server. HP does not guarantee updates or problem fixes for this freeware. The complete terms and conditions regarding this software are listed in the freeware agreement.

This software comes with MPE installation scripts, MPE installation instructions, binaries, additional files needed to run the software, and MPE-specific documentation.

Background:

This software is based on ApacheJServ 1.1 from the Apache Software Foundation. It was initially available as the Java Servlets Beta for MPE/iX. This software is not an HP product and is being provided instead as HP freeware. The reasons for providing Java servlets as freeware instead of as an HP product are:
  • The ApacheJServ open source developers strongly encourage servlet users to move from ApacheJServ to Tomcat. Tomcat is part of the supported Enhydra product from Lutris, http://www.lutris.com. It is also available unsupported as part of the Enhydra open source code, http://www.enhydra.org, or directly from the Apache Software Foundation's Jakarta Project.
  • ApacheJServ 1.1 uses the JSDK2.0 library which has been archived by Sun. This library may not be available in the future and could not be bundled with an HP product due to licensing restrictions. The JSDK2.0 library comes bundled with this Java servlets freeware package.


Requirements

This Java servlets freeware requires

  • MPE/iX 6.0 or later
  • Apache for MPE/iX with DSO capability or WebWise MPE/iX Secure Web Server
  • MPE/iX Dynamic Shared Object (DSO) patch
  • Java Virtual Machine (JVM).

The Apache Home Page lists Apache versions and DSO patch IDs for each MP/iX release. Only Apache versions that support DSO can be used with this freeware. Java servlets HP freeware can also be used with HP WebWise MPE/iX Secure Web Server.

This Java servlets software currently installs in /APACHE/PUB for standard Apache or in /APACHE/SECURE for WebWise. To use non-HP versions of Apache may require the user to modify the installation script and modify the startup and shutdown jobs that are distributed with the software. The servlets DSO is built with the Extended Apache API (EAPI) and may generate an error message in the error_log when used with non-HP versions of Apache. Despite this error message, Java servlets may run successfully.

Java is bundled with MPE/iX in Release 6.0 and later. New versions are often available from the Java for MPE/iX Home Page.

The Java servlets freeware has been installed and run by HP on MPE/iX Release 6.0, 6.5, and 7.0 and with WebWise, Apache 1.3.9, and Apache 1.3.14 Beta. It has also been run with JDK 1.1.7B, SDK1.2, and SDK1.2.2.

Hardware resources

The following are minimum estimates of the hardware requirements needed to install and run this software:

  • 1 MB disk space for product files (configuration files, class files, startup/shutdown files, example files)
  • 2 MB disk space for documentation (API specifications)
  • Additional disk space for log files
  • Additional disk space for new servlets

Registration and download

You must complete the registration agreement before you can download the software.


Description

Below is a brief description of the Java servlets freeware. More MPE documentation is available on the technical content and usage of Java servlets.

Components

The components that make up the java servlets freeware are:

  • The Jserv Dynamic Shared Object module (mod_jserv.so)
  • The JServ servlet engine (ApacheJServ.jar)
  • The Java Servlet Development Kit 2.0 (JSDK 2.0) from Sun
  • JServ configuration files
  • MPE startup and shutdown job stream files

Mod_jserv.so

Mod_jserv.so is a Dynamic Shared Object Apache module (DSO) that loads at Apache run time and provides the communication between Apache and the servlet engine over TCP. Mod_jserv.so converts HTTP requests to servlet requests then sends back the HTTP response to the client.

ApacheJserv.jar

This is a 100% pure java application that executes the servlets. It is often referred to as the "servlet engine" or "JServ".

Java servlet development kit 2.0

The Java Servlet Development Kit 2.0 (JSDK 2.0) contains servlet classes that are required by Apache JServ for proper servlet execution. JSDK 2.0 is distributed as part of the MPE/iX installation, as lib/jsdk.jar, and is also freely available from Sun. Any versions other than JSDK 2.0 (past, present, or future versions) are not guaranteed to work with ApacheJServ1.1.

JServ configuration files

Three configuration files are used to configure java servlets: jserv.conf, jserv.properties, and root.properties. These files are in addition to the configuration files currently used by Apache for MPE/iX or for HP WebWise Secure Web Server for MPE/iX.


Installation

Successful Java servlets installation depends on properly installing and configuring the Apache Web Server , the Apache JServ module (mod_jserv), the Jserv servlet engine and the JVM. To ensure success, the following should be verified before beginning installation of the servlet software:

  1. The desired version of Java is on your system and can compile and run a Java program
  2. Apache or WebWise Secure Web Server runs successfully

You can check your version of the JVM by invoking the command,

:java -version
or
shell/iX>/usr/local/java/latest/bin/java -version

A simple program like HelloWorld can be used to verify if Java is set up correctly. The program below should be created as HelloWorld.java:

public class HelloWorld
{
   public static void main(String[] args)
   {
      System.out.println("Hello World!");
   }
}

To compile HelloWorld.java,

shell/iX>javac HelloWorld.java
or
shell/iX>/usr/local/java/latest/bin/javac HelloWorld.java

To run HelloWord,

shell/iX>java HelloWorld
or
shell/iX>/usr/local/java/latest/bin/java HelloWorld

For information on installing and running Java, WebWise, or Apache on MPE/iX, please refer to the resources section at the end of this document.

Java servlets installation for WebWise secure web server

For WebWise, download jsecjsin.tar.Z from Jazz and copy it to the e3000. This job installs files under /APACHE/SECURE.

To copy the WebWise installation job to your e3000 using ftp,

ftp>quote type L 8 
ftp>put jsecjsin.tar.Z /tmp/jsecjsin.tar.Z 
ftp>quit

To extract and install the servlet files,

:HELLO MANAGER.SYS
:xeq sh.hpbin.sys -L
shell/iX>cd /tmp
shell/iX>tar -xvfzop /tmp/jsecjsin.tar.Z
x /tmp/jserv_inst.sh, 1131 bytes, 3 tape blocks
x /tmp/jserv.tar.Z, 1053696 bytes, 2058 tape blocks
x /tmp/jsecjs, 567 bytes, 2 tape blocks
shell/iX>callci stream /tmp/jsecjs

Java servlets installation for standard Apache

For standard Apache, download japjsin.tar.Z from Jazz and copy it to the e3000. This job will installs files under /APACHE/PUB.

To copy the standard Apache installation job to your e3000 using ftp,

ftp>quote type L 8
ftp>put japjsin.tar.Z /tmp/japjsin.tar.Z
ftp>quit

To extract and install the servlet files,

:HELLO MANAGER.SYS
:xeq sh.hpbin.sys -L
shell/iX>cd /tmp
shell/iX>tar -xvfzop /tmp/japjsin.tar.Z
x /tmp/jserv_inst.sh, 1131 bytes, 3 tape blocks
x /tmp/jserv.tar.Z, 1053696 bytes, 2058 tape blocks
x /tmp/japjs, 564 bytes, 2 tape blocks
shell/iX>callci stream /tmp/japjs


Configuration

The Java servlets freeware is configured in a few, easy steps.

  1. Copy the sample configuration files to create new ones
  2. Add one line in httpd.conf to load servlets
  3. Change the IP address in jserv.conf to view servlet status
  4. Modify the TZ variable in the job stream files

Copy the sample configuration files

The servlet installation job creates 3 sample configuration files in the directory conf/jserv. These sample files were derived from the corresponding default files in the same directory and are intended for use with Apache for MPE/iX and WebWise Secure Web Server. Copy these files to create your own configuration files. Make sure to log on first as MGR.APACHE:

:HELLO MGR.APACHE
:xeq sh.hpbin.sys -L
shell/iX>cd /APACHE/SECURE/conf/jserv
or
shell/iX>cd /APACHE/PUB/conf/jserv
shell/iX>cp jserv.conf.sample jserv.conf
shell/ix>cp jserv.properties.sample jserv.properties
shell/iX>cp root.properties.sample root.properties

Modify httpd.conf for loading servlets

Modify your conf/httpd.conf file by adding an include directive after the last AddModule directive in the module list. The included file, jserv.conf, contains a LoadModule directive for loading the mod_jserv.so library.

For WebWise Secure Web Server, the include should be added after mod_ssl.c as shown here:

shell/iX>cd /APACHE/SECURE/conf
shell/iX>cat httpd.conf
...
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
<IfDefine SSL>
AddModule mod_ssl.c
</IfDefine>

Include /APACHE/SECURE/conf/jserv/jserv.conf
...

For Standard Apache, the include should be added after mod_setenvif.c as shown here:

shell/iX>cd /APACHE/PUB/conf
shell/iX>cat httpd.conf
...
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c

Include /APACHE/PUB/conf/jserv/jserv.conf
...

Edit jserv.conf for jserv status

The conf/jserv/jserv.conf file contains configuration directives for viewing servlet status once the servlet engine has been started. To enable, replace "your.PC.com" with the IP address of your PC's browser (127.0.0.1 is equivalent to "localhost"). This feature should be enabled for trusted users only (i.e. the system administrator) and probably disabled on production systems. To disable this feature, remove your PC's address from the "allow from" directive.

shell/iX>cd /APACHE/SECURE/conf/jserv 
or
shell/iX>cd /APACHE/PUB/conf/jserv 
shell/iX>cat jserv.conf 
...
<Location /jserv/>
SetHandler jserv-status 

order deny, allow
deny from all
allow from 127.0.0.1 your.PC.com
</Location>
...

Customize the job stream files

The servlet engine, Apache JServ, is started by streaming JSRV (for standard Apache) or JSRVS (for WebWise Secure Web Server). The servlet engine is stopped by streaming JSRVOFF (for standard Apache) or JSRVSOFF (for WebWise Secure Web Server).

Change the TZ variable for your local timezone in JSRV and JSRVOFF or in JSRVS and JSRVSOFF. Or, set TZ in a system-wide UDC and remove or comment out TZ in the JServ stream jobs.

shell/iX>cd /APACHE/SECURE
shell/iX>cat JSRVS
!job jsrvs,mgr.apache,secure;pri=cs
!setvar TZ 'PST8PDT'
...
!eoj

shell/iX>cd /APACHE/SECURE
shell/iX>cat JSRVSOFF
!job jsrvsoff,mgr.apache,secure;pri=cs
!setvar TZ 'PST8PDT' 
...
!eoj 


Running the servlet engine

Startup

For the first startup after installation, it is best to start Apache or WebWise Secure Web Server then check the conf/error_log and conf/mod_jserv.log files for errors. This will verify that the web server has started successfully and was able to load the mod_jserv module. Mod_jserv.log is created at the first Apache startup.

After the web server is running, start the servlet engine. Jserv.log is created at the first servlet engine startup.

 
shell/iX> callci stream /APACHE/SECURE/JHTTPDS
shell/iX> cd /APACHE/SECURE/logs
shell/iX> tail error_log 
shell/iX> tail mod_jserv.log
shell/iX> callci stream /APACHE/SECURE/JSRVS
shell/iX> tail jserv.log

or 

shell/iX> callci stream /APACHE/PUB/JHTTPD
shell/iX> cd /APACHE/PUB/logs 
shell/iX> tail error_log 
shell/iX> tail mod_jserv.log 
shell/iX> callci stream /APACHE/PUB/JSRV
shell/iX> tail jserv.log 

For normal startup of WebWise Secure Web Server and the servlet engine,

:stream jhttpds.secure.apache
:stream jsrvs.secure.apache

For normal startup of standard Apache and the servlet engine,

:stream jhttpd.pub.apache
:stream jsrv.pub.apache

Starting the servlet engine also starts up the Java Virtual Machine (JVM) since the servlet engine is itself a servlet. Because the JVM is starting up, there will a short delay before the engine is running.

Verify startup

Successful installation and startup of the servlet engine can be verified by

  • Looking at the content of the log files
  • Running the servlet status handler to view servlet status
  • Running the example servlets provided with the servlet package
  • Accessing the online jserv documentation

View servlet status by calling the servlet status handler(the trailing slash is required),

http://your.host.com/jserv/

To run the example servlets,

http://your.host.com/servlets/Hello
http://your.host.com/servlets/IsItWorking

To access the jserv documentation,

http://your.host.com/jservdocs 

Shutdown

To stop WebWise Secure Web Server and the servlet engine,

:xeq sh.hpbin.sys "-c 'kill `cat /APACHE/SECURE/logs/httpd.pid`'"
:stream jsrvsoff.secure.apache

To stop standard Apache,

:xeq sh.hpbin.sys "-c 'kill `cat /APACHE/PUB/logs/httpd.pid`'"
:stream jsrvoff.pub.apache


Resources

The following are additional resources for Java servlets, Java, WebWise Secure Web Server, and Apache. Release documents for Java, WebWise, and Apache are on HP's online documentation site, http://docs.hp.com/mpeix/all/index.html

Java servlets resources

  • More MPE documentation is available for the Java servlets freeware. It describes the software in greater depth and explains how to compile and run a servlet on MPE.
  • http://java.apache.org/ is the Apache JServ official home page. This site contains general information about Apache JServ and related projects. The FAQs may help with usage problems.
  • http://your.host.com/jservdocs contains the Apache JServ 1.1 API specification.
  • http://your.host.com/JSDK2.0/doc/apidoc contains the JSDK2.0 API specification. This specification is useful when writing servlets.
  • http://java.sun.com/products/servlet is Sun's servlet site

Apache web server resources

HP WebWise MPE/iX secure web server resources

Java resources


 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2004 Hewlett-Packard Development Company, L.P.