Ubuntu Feisty and Tomcat 6.x

Setting up Tomcat on Ubuntu Feisty is a real breeze because it’s already contained in the universe repository. The only drawback is that it is version 5.5 and not the current 6.x release. Being the version number whore i am i installed version 6.x:

  • Download Tomcat 6.x from tomcat.apache.org/. The most recent version at the time of writing was 6.0.14.
  • Unpack it to a place you like. I choose /usr/local/
  • You can now run the standalone Tomcat:

    frank@dexter:~$ /usr/local/tomcat/bin/startup.sh
    Using CATALINA_BASE:   /usr/local/tomcat
    Using CATALINA_HOME:   /usr/local/tomcat
    Using CATALINA_TMPDIR: /usr/local/tomcat/temp
    Using JRE_HOME:       /usr/lib/jvm/java-6-sun/

  • If you get this instead:

    frank@dexter:~$ /usr/local/tomcat/bin/startup.sh
    Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
    At least one of these environment variable is needed to run this program

    you have to setup your JAVA_HOME variable. For Feisty set it to "/usr/lib/jvm/java-6-sun/".

  • You should now get the Tomcat  default page when you point your browser to http://localhost:8080.
  • The next step is to setup the connector between Apache and Tomcat so your Apache will be able to serve Java generated content.
    apt-get install libapache2-mod-jk will install the needed apache module.
  • Copy /usr/share/doc/libapache2-mod-jk/httpd_example_apache2.conf to /etc/apache2/conf.d/tomcat.conf.
  • Edit /etc/libapache2-mod-jk/workers.properties to match your local environment. Set workers.tomcat_home to /usr/local/tomcat/ and workers.java_home to /usr/lib/jvm/java-6-sun/.
  • To test if everything is fine we will make the Tomcat examples directory available through Apache. Edit /etc/apache2/conf.d/tomcat.conf. Add the line JkMount /examples/* ajp13_worker. You should now get the Tomcat examples page when you type "http://localhost/examples/" into your browser. Now we are done.

댓글

이 블로그의 인기 게시물

도꾜여행~! 여기는 꼭 가봐라

Wumpus World

NASA가 알아주는 우주과학자 정재훈 박사d