These are the steps I took to install Jakarta Tomkat 5.5 in conjunction with Java 2 SDK in Ubuntu server.
- Login as root, you can also use “su” though I prefer to login as root.
- apt-get install sun-java5-jdk
- This will install Java 2 SDK (1.5), ubuntu will start downloading packages that are not found in your system.
- Of course jakarta-tomcat 5.5, I’m using 5.5 since this supports java 1.5
- Java’s location is in /usr/lib/jvm/java-1.5.0-sun
- Jakarta-Tomcat’s location is in /usr/share/tomcat5.5
- We will need these location for the export configurations to be written in the .bashrc
...Connector port="8180" maxHttpHeaderSize="8192"...
and change 8180 to 8080. Save and exit. Now your ready to test the server.
Using CATALINA_BASE: /usr/share/tomcat5.5
Using CATALINA_HOME: /usr/share/tomcat5.5
Using CATALINA_TMPDIR: /usr/share/tomcat5.5/temp
Using JRE_HOME: /usr/lib/jvm/java-1.5.0-sun
remove the ‘#’ and change it to…
or wherever your java directory is.After that, restart the server and see if tomcat was successfully started.
Edit: Problem encountered:
- Tomcat does not load in Ubuntu 8.04
Found a little problem loading Tomcat 5.5 under Ubuntu 8.04, it either fails or white screen just appears. I don’t know what happened from 6.04 to 8.04 but once I compared the init.d/tomcat5.5 startup script from 6.04 and 8.04, there WERE changes to the scripts. I replaced the new tomcat5.5 script in 8.04 with the old one from 6.04 and the server started properly after a server restart. I don’t know why but this may have something to do with permissions and I have yet to trace the script.
- java.lang.ClassNotFoundException: org.apache.jasper.tagplugins.jstl.If
- The problem here is that the above name is incomplete… what it should have been is org.apache.jasper.tagplugins.jstl.core.*
- Now, to fix the problem, locate
/var/lib/tomcat5.5/webapps/jsp-examples/WEB-INF/tagPlugins.xml and open it with your text editor… I used vim. Now edit each line of code that has org.apache.jasper.tagplugins.jstl in it and add “.core” after jstl. What you will see after editing the code will be…
- SEVERE: The scratchDir you specified: [folder_path] is unusable.
- Sidenote: took me 2 days to figure out why this was happening (X_x)
- Based from the Catalina logs, the folders under webapps was not accessible by tomcat5.
- Now looking under all processes running ( ps command ), most bootup services were running under root (mysql, apache, etc ) but tomcat5 was not.
- If I start tomcat5 when I logged into the console as root, the problem disappears. This lead me to believe this might have been the Tomcat5 user was not given the correct privileges.
- Work-around 1: Elevate Tomcat5 user to root access level.
- Work-around 2: Go to /etc/init.d/ and open Tomcat5.5 under any text editor ( I used vim ). Locate the line TOMCAT5_USER=tomcat55 and change it to TOMCAT5_USER=root . Restart your server or you can also execute the restart command for Tomcat5.5 in init.d folder