Serving JSP from Tomcat 5.5 on Ubuntu 7.10
- Tomcat installed on Ubuntu 7.10, used Synaptic package manager.
- /etc/init.d/tomcat5.5 start
- /etc/init.d/tomcat5.5 stop
- /usr/share/tomcat5.5 is where tomcat lives.
- /usr/share/tomcat5.5-webapps is where the webapps live.
Create /usr/share/tomcat5.5-webapps/ROOT/test.jsp with the following contents:
<html>
<body>
<%java.util.Date d = new java.util.Date();%>
Todays date is <%= d.getDate()%> and this jsp page worked!
</body>
</html>
---
Subnote: To get the less than and greater than signs for the tags I use < and > There is a nice page that will do the conversion for you at : http://www.stanford.edu/~bsuter/js/convert.html
Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts
Wednesday, November 7, 2007
Wednesday, October 24, 2007
Installing and Running Tomcat on Ubuntu
This link was pretty helpful: http://ubuntuforums.org/showthread.php?t=44006 except that the instructions for installing sun-jre and sun-j2sdk don't work. So of course Tomcat doesn't run.
How to fix? It seemed like java was installed. In fact java -version and javac -help gave good results. But where? It took some digging. I found the update-alternatives helpful. It helped me find where java was REALLY installed. On my system when I do:
$ update-alternatives --display java
I get the following:
java - status is auto.
link currently points to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
/usr/bin/gij-4.2 - priority 42
slave java.1.gz: /usr/share/man/man1/gij-4.2.1.gz
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java - priority 53
slave java.1.gz: /usr/lib/jvm/java-1.5.0-sun/jre/man/man1/java.1.gz
Current `best' version is /usr/lib/jvm/java-1.5.0-sun/jre/bin/java.
So the trick to getting Tomcat to start per the instructions was to set
$ export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
How to fix? It seemed like java was installed. In fact java -version and javac -help gave good results. But where? It took some digging. I found the update-alternatives helpful. It helped me find where java was REALLY installed. On my system when I do:
$ update-alternatives --display java
I get the following:
java - status is auto.
link currently points to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
/usr/bin/gij-4.2 - priority 42
slave java.1.gz: /usr/share/man/man1/gij-4.2.1.gz
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java - priority 53
slave java.1.gz: /usr/lib/jvm/java-1.5.0-sun/jre/man/man1/java.1.gz
Current `best' version is /usr/lib/jvm/java-1.5.0-sun/jre/bin/java.
So the trick to getting Tomcat to start per the instructions was to set
$ export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
Subscribe to:
Posts (Atom)