How To Install Tomcat 4.1.27 Standalone using Jpackage RPMs
-----------------------------------------------------------

The Tomcat Team no longer generates monolithic RPMs for the
full or LE version of Tomcat after 4.1.24. Instead, RPMs
can be obtained from www.jpackage.org. Jpackage's apparent
goal is to generate RPMs for common Java based packages and
to standardize the installed directory structure and
environment.

Because Jpackage manages many RPMs, (at least one for each
Java library/tool), there are over 20 RPMs that make up
a working Tomcat 4.1 installation. This includes RPMs for the
j2sdk and its extensions. As with other RPM managed products,
future upgrades to Tomcat may only include one or a handfull
of RPMs to be updated. If this sounds daunting or difficult
to manage, remember that RPMs make the whole process fairly
easy.

As mentioned above, Jpackage attempts to unify the Java install
environment by repackaging JVMs/JREs into a consistent form
that allows multiple versions of Sun, Blackdown, and IBM
product RPMs to be plug compatible with other Jpackage
components like Tomcat. This eliminates many configuration
problems and makes user and service environments generally
stable. To realize this goal, some Jpackage RPM installation
scripts require that the JVM and related components be
installed using Jpackage RPMs; this includes the Tomcat 4.1
RPM. Also, there is also a Jpackage utilities RPM that must
be installed to support this install architecture.

For many reasons, (see the site FAQ for details), Jpackage
cannot distribute binary RPMs for many vendor's products or
components. However, Jpackage has created "nosrc" RPMs that
you manually compose, (only once), after pulling the products
binary "sources" from the vendor's web sites. The "nosrc"
designation can be misleading: by building RPMs from these
templates, downloaded binary components are not rebuilt
from Java or other sources, they are simply repackaged as
Jpackage compatible binary RPMs! For a Tomcat 4.1 install,
this process must be done for only the JVM and a few of its
extensions. Don't let this extra step color your opinion of
the Jpackage RPMs!

Here are the steps I used to install Tomcat 4.1.27 using the
Sun 1.4.2_01 j2sdk on a RedHat 8.0 server, (YMMV):

---------------

1. Erase any j2sdk and obsolete Tomcat RPM installs. For
example, these were the commands I used after saving any
Tomcat configuration files or webapps:

> su -
Password:
> rpm -e j2sdk-1.4.2_01-fcs
> rpm -e tomcat4-4.1.24-full.2jpp
> rm -rf /var/tomcat4
> rm -rf /etc/tomcat4
> exit

---------------

2. Download the following RPMs from www.jpackage.org:

ant-1.5.4-2jpp.noarch.rpm       
jaf-1.0.2-3jpp.nosrc.rpm     
jakarta-commons-beanutils-1.6.1-4jpp.noarch.rpm 
jakarta-commons-collections-2.1-4jpp.noarch.rpm 
jakarta-commons-daemon-1.0.cvs20030227-6jpp.noarch.rpm 
jakarta-commons-dbcp-1.0-4jpp.noarch.rpm   
jakarta-commons-digester-1.5-3jpp.noarch.rpm 
jakarta-commons-fileupload-1.0-1jpp.noarch.rpm 
jakarta-commons-logging-1.0.3-4jpp.noarch.rpm 
jakarta-commons-modeler-1.1-2jpp.noarch.rpm    
jakarta-commons-pool-1.0.1-5jpp.noarch.rpm 
java-1.4.2-sun-1.4.2.01-7jpp.nosrc.rpm
javamail-1.3.1-1jpp.nosrc.rpm 
jpackage-utils-1.5.27-1jpp.noarch.rpm
jta-1.0.1-0.b.3jpp.nosrc.rpm       
mx4j-1.1.1-5jpp.noarch.rpm
regexp-1.3-1jpp.noarch.rpm
servletapi4-4.0.4-3jpp.noarch.rpm
tomcat4-4.1.27-2jpp.noarch.rpm
tyrex-1.0-3jpp.noarch.rpm         
xalan-j2-2.5.1-1jpp.noarch.rpm
xerces-j2-2.4.0-3jpp.noarch.rpm           
xml-commons-1.0-0.b2.6jpp.noarch.rpm 
xml-commons-apis-1.0-0.b2.6jpp.noarch.rpm 

If you wish to use an older JVM version, choose the nosrc RPM
that you wish to use; you may also need to include the following
nosrc RPMs for required extensions and libraries depending on
the JVM version:

jaas-ext-1.0.1-2jpp.nosrc.rpm 
jdbc-stdext-ext-2.0-12jpp.nosrc.rpm 
jndi-ext-1.2.1-10jpp.nosrc.rpm
jsse-ext-1.0.3.01-5jpp.nosrc.rpm
ldapjdk-4.1-5jpp.noarch.rpm
oro-2.0.7-1jpp.noarch.rpm

---------------

3. Download the following binary sources from the Sun j2sdk
and appropriate product web sites:

j2sdk-1_4_2_01-linux-i586.bin
jaf-1_0_2.zip
javamail-1_3_1.zip
jta-1_0_1B-classes.zip

Again, you may also need to download these if you are using
older JVM versions:

jaas-1_0_01.zip
jdbc2_0-stdext.jar
jndi-1_2_1.zip
jsse-1_0_3_02-do.zip, (or jsse-1_0_3_02-gl.zip)

---------------

4. Install the require Jpackage utility RPM:

> su -
Password:
> rpm -U jpackage-utils-1.5.27-1jpp.noarch.rpm
> exit

---------------

5. Because we are going to build binary RPMs using the nosrc
RPMs and the downloaded binary sources, we need a standard
host RPM directory structure. Note that the following RPM
building steps should be done in a user directory and not as
root on your machine! More details for these steps can be
found on the www.jpackage.org web site. Here are the commands
to prepare the RPM environment:

> mkdir ~/rpm
> mkdir ~/rpm/BUILD
> mkdir ~/rpm/RPMS
> mkdir ~/rpm/RPMS/i386
> mkdir ~/rpm/RPMS/i586
> mkdir ~/rpm/RPMS/noarch
> mkdir ~/rpm/SOURCES
> mkdir ~/rpm/SPECS
> mkdir ~/rpm/SRPMS
> mkdir ~/rpm/tmp

Create the ~/.rpmmacros file with the following lines, (do
substitute your name and email address in the place of
the template values):

%_topdir        %(echo ${HOME}/rpm)
%_tmppath       %{_topdir}/tmp

%packager       Firstname Lastname <[EMAIL PROTECTED]>

---------------

6. Install all of the nosrc RPMs into the RPM directories:

> rpm -i jaf-1.0.2-3jpp.nosrc.rpm     
> rpm -i java-1.4.2-sun-1.4.2.01-7jpp.nosrc.rpm
> rpm -i javamail-1.3.1-1jpp.nosrc.rpm 
> rpm -i jta-1.0.1-0.b.3jpp.nosrc.rpm

You should see RPM spec files for each in the ~/rpm/SRPMS
directory.

And continue with these for older JVM versions:       

> rpm -i jaas-ext-1.0.1-2jpp.nosrc.rpm 
> rpm -i jdbc-stdext-ext-2.0-12jpp.nosrc.rpm 
> rpm -i jndi-ext-1.2.1-10jpp.nosrc.rpm
> rpm -i jsse-ext-1.0.3.01-5jpp.nosrc.rpm

Note that the ~/rpm/SPECS/jsse.spec file needs to be edited
to reflect the downloaded version of the JSSE package. I
edited the spec file replacing '1.0.3.01' with '1.0.3.02'
and 'gl' with 'do'.

---------------

7. Copy the downloaded binary sources into the user
~/rpm/SOURCES directory:

> cp j2sdk-1_4_2_01-linux-i586.bin ~/rpm/SOURCES/
> cp jaf-1_0_2.zip ~/rpm/SOURCES/
> cp javamail-1_3_1.zip ~/rpm/SOURCES/
> cp jta-1_0_1B-classes.zip ~/rpm/SOURCES/

And for older JVM versions:

> cp jaas-1_0_01.zip ~/rpm/SOURCES/
> cp jdbc2_0-stdext.jar ~/rpm/SOURCES/
> cp jndi-1_2_1.zip ~/rpm/SOURCES/
> cp jsse-1_0_3_02-do.zip ~/rpm/SOURCES/
 
---------------

8. Build the corresponding binary RPMs using rpmbuild,
(see www.jpackage.org if you have an older version of
rpm that does not use rmpbuild):

> rpmbuild -ba ~/rpm/SPECS/jaf.spec
> rpmbuild -ba ~/rpm/SPECS/java-1.4.2-sun.spec
> rpmbuild -ba ~/rpm/SPECS/javamail.spec
> rpmbuild -ba --without javadoc ~/rpm/SPECS/jta.spec

And for older JVM versions:
                                   
> rpmbuild -ba --without javadoc ~/rpm/SPECS/jaas-ext.spec
> rpmbuild -ba --without javadoc ~/rpm/SPECS/jdbc-stdext-ext.spec
> rpmbuild -ba ~/rpm/SPECS/jndi.spec
> rpmbuild -ba ~/rpm/SPECS/jsse.spec

---------------

9. Extract only the required new binary RPMs from the RPM
directories:

> cp ~/rpm/RPMS/i586/java-1.4.2-sun-1.4.2.01-7jpp.i586.rpm .
> cp ~/rpm/RPMS/i586/java-1.4.2-sun-devel-1.4.2.01-7jpp.i586.rpm .
> cp ~/rpm/RPMS/i586/java-1.4.2-sun-fonts-1.4.2.01-7jpp.i586.rpm .
> cp ~/rpm/RPMS/noarch/jaf-1.0.2-3jpp.noarch.rpm .
> cp ~/rpm/RPMS/noarch/javamail-1.3.1-1jpp.noarch.rpm .
> cp ~/rpm/RPMS/noarch/jta-1.0.1-0.b.3jpp.noarch.rpm .

And continuing only for older JVM versions:

> cp ~/rpm/RPMS/noarch/jaas-ext-1.0.1-2jpp.noarch.rpm .
> cp ~/rpm/RPMS/noarch/jdbc-stdext-ext-2.0-12jpp.noarch.rpm .
> cp ~/rpm/RPMS/noarch/jndi-ext-1.2.1-10jpp.noarch.rpm .
> cp ~/rpm/RPMS/noarch/jsse-ext-1.0.3.02-5jpp.noarch.rpm .

---------------

10. Install all of the downloaded and built RPMs in order
of their dependencies, (not into the local user RPM
directories, but as root as done for other RPM installs):

> su -
Password:
> rpm -U java-1.4.2-sun-1.4.2.01-7jpp.i586.rpm
> rpm -U java-1.4.2-sun-devel-1.4.2.01-7jpp.i586.rpm
> rpm -U java-1.4.2-sun-fonts-1.4.2.01-7jpp.i586.rpm
> rpm -U jaf-1.0.2-3jpp.noarch.rpm .
> rpm -U jta-1.0.1-0.b.3jpp.noarch.rpm .
> rpm -U javamail-1.3.1-1jpp.noarch.rpm .
> rpm -U xml-commons-1.0-0.b2.6jpp.noarch.rpm 
> rpm -U xml-commons-apis-1.0-0.b2.6jpp.noarch.rpm 
> rpm -U xerces-j2-2.4.0-3jpp.noarch.rpm           
> rpm -U ant-1.5.4-2jpp.noarch.rpm       
> rpm -U xalan-j2-2.5.1-1jpp.noarch.rpm
> rpm -U mx4j-1.1.1-5jpp.noarch.rpm
> rpm -U regexp-1.3-1jpp.noarch.rpm
> rpm -U servletapi4-4.0.4-3jpp.noarch.rpm
> rpm -U jakarta-commons-collections-2.1-4jpp.noarch.rpm 
> rpm -U jakarta-commons-logging-1.0.3-4jpp.noarch.rpm 
> rpm -U jakarta-commons-beanutils-1.6.1-4jpp.noarch.rpm 
> rpm -U jakarta-commons-daemon-1.0.cvs20030227-6jpp.noarch.rpm 
> rpm -U jakarta-commons-pool-1.0.1-5jpp.noarch.rpm 
> rpm -U jakarta-commons-dbcp-1.0-4jpp.noarch.rpm   
> rpm -U jakarta-commons-digester-1.5-3jpp.noarch.rpm 
> rpm -U jakarta-commons-fileupload-1.0-1jpp.noarch.rpm 
> rpm -U jakarta-commons-modeler-1.1-2jpp.noarch.rpm    
> rpm -U tyrex-1.0-3jpp.noarch.rpm         
> rpm -U tomcat4-4.1.27-2jpp.noarch.rpm
> exit

Note that for the older JVM versions, these may be
installed immediately before the Tomcat4-4.1.27-2jpp
RPM in sequence:

> rpm -U jaas-ext-1.0.1-2jpp.noarch.rpm .
> rpm -U jdbc-stdext-ext-2.0-12jpp.noarch.rpm .
> rpm -U jndi-ext-1.2.1-10jpp.noarch.rpm .
> rpm -U jsse-ext-1.0.3.02-5jpp.noarch.rpm
> rpm -U oro-2.0.7-1jpp.noarch.rpm
> rpm -U ldapjdk-4.1-5jpp.noarch.rpm

---------------

Here are a few other notes about this Jpackage RPM
installation:

Java JVM/JRE components can be found in /usr/lib/jvm. Other
Jpackage Java library JARs and their alias links live in
/usr/share/java.

As with most Linux system RPMs, Jpackage also adds links
to the JVM/JRE executable in /usr/bin. The installation of
the JVM, compiler, and tools can be checked using the
following and similar commands:

> /usr/bin/java -version

Remember to also validate your user PATH settings to these!

Jpackage tends to make heavy use of the /etc/java/java.conf
setup. That is a good place to look for any Java environment
issues, (i.e. JAVA_HOME settings).

The Tomcat installation now lives in /usr/share/tomcat4
instead of the old /var/tomcat4. As before, most of the
real directories are scattered around in /etc/tomcat4,
/var/lib/tomcat4, /var/cache/tomcat4, and /var/log/tomcat4.

As with the old Tomcat 4.1.24 RPMs, the Jpackage RPMs use
the /etc/java/tomcat4.conf configuration file. Because
Jpackage assumes a homogenous RPM installation, this file
is slightly modified over the old RPM version. Note that
CATALINA_TMPDIR is explicitly set, so that can cause some
issues if CATALINA_BASE is being used and the
/usr/bin/dtomcat4 script is being used to launch Tomcat.

Believe it or not, this Jpackage install "just worked" for
for us!

Reply via email to