How to move the 'lib' folder in a rpm-based tomcat installation.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Tomcat 6

Issue

  • How to move the 'lib' folder in a rpm-based tomcat installation.
  • Customer jars are deployed to the 'lib' folder; however, there is not enough space on the filesystem to hold these jars by default. How is this directory moved?

Resolution

  1. Copy over the bin/ and lib/ directories and their contents to this directory.
  2. Remove the three broken symlinks in lib/:

    tomcat6-el-2.1-api-6.0.24.jar
    tomcat6-jsp-2.1-api-6.0.24.jar
    tomcat6-servlet-2.5-api-6.0.24.jar
    
  3. Create symlinks pointing to the correct location (this should have been /usr/share/java):

    # cd /apps/tomcat
    # ln -s /usr/share/java/tomcat6-el-2.1-api-6.0.24.jar .
    # ln -s /usr/share/java/tomcat6-jsp-2.1-api-6.0.24.jar .
    # ln -s /usr/share/java/tomcat6-servlet-2.5-api-6.0.24.jar .
    
  4. Adjust the CATALINA_HOME and JASPER_HOME directives to point to /apps/tomcat; these should be identical to CATALINA_BASE.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments