The Remarkable Everyday

Setup Java, Tomcat, MySQL, on Ubuntu Linux Machine for JSP hosting

Posted by leejeok on August 14, 2008

** If you had downloaded and installed Ubuntu 8.04 LTS Desktop Edition, you can skip the step below and goto step 8.


Install Ubuntu Ubuntu 8.04 LTS Server


  1. Download the Ubuntu Server from http://www.ubuntu.com/
  2. Burn the ISO file into CD and boot your machine from CD.
  3. Follow the installation step closely and it is easy to do it.
  4. Once install successfully, you will require to login.
  5. After login, perform the necessary updates. Make sure you have the internet connections ready. Type sudo apt-get update to do the update.


Install the GNOME desktop (mostly used within this tutorial)


  1. Type sudo apt-get  install ubuntu-desktop to download and install.
  2. Type startx to start the GNOME

** You can install KDE desktop instead of GNOME.

To install KDE, type the command sudo apt-get install kubuntu-desktop


Install JDK 6 and JRE (Java)


  1. Within the GNOME, open the terminal. Applications à Accessories à Terminal
  2. Type sudo apt-get install sun-java6-jdk
  3. After successful install, you can do some verification to find out the installed JDK and JRE version. At the terminal, type javac –version for JDK and java –version for JRE.


Install Apache Tomcat 5.5


**Before installing the Tomcat 5.5, you will need to ensure that you had installed JDK and JRE.


  1. Download the tomcat 5.5 from http://tomcat.apache.org/ and saved it to desktop. Here, apache-tomcat-5.5.26.tar.gz been used.
  2. Right click apache-tomcat-5.5.26.tar.gz and click on Extract Here
  3. After extract, rename the folder to tomcat for easier to remember the folder name.
  4. Is good idea to move the tomcat to /usr/local directory. Type the command sudo mv “tomcat on desktop” to “/usr/local”


You need to tell the tomcat where the JDK has been installed and to do this you need to define the JAVA_HOME environment variable in .bashrc file.


  1. You are about to edit the .bashrc file. Please backup the file first before make any changes. The .bashrc is a hidden file and is located in your home directory.
  2. Open the terminal and type the command gedit ~/.bashrc (GNOME) or kate ~/.bashrc (KDE)
  3. At the end of the file type export JAVA_HOME=/usr/lib/jvm/java-6-sun- and save the file.


Start and Stop tomcat


  1. At terminal, type sh /usr/local/tomcat/bin/startup.sh
  2. You can verify the success installation by open the Mozilla Firefox browser and browse to http://localhost:8080
  3. To shutdown tomcat – at terminal type sh /usr/local/tomcat/bin/shutdown.sh


Install the MySQL Server 5.0


  1. At terminal, type sudo apt-get install mysql-server


Install MySQL Query Browser.


  1. At terminal, type sudo apt-get install mysql-query-browser


Install MySQL Administrator


  1. Open the terminal and type sudo apt-get install mysql-admin

Here are the screen capture



4 Responses to “Setup Java, Tomcat, MySQL, on Ubuntu Linux Machine for JSP hosting”

  1. I love you man, at least as a beginner I could find some useful and simple tutorial on the web! Thank you!

  2. […] Googling may be more helpful for this kind of work https://leejeok.wordpress.com/2008/08…r-jsp-hosting/ […]

  3. Thanks a lot for this tutorial… This and my book helped me to install Tomcat.

    The problem was my book had the windows tutorial… But this helped me install on ubuntu…


  4. Rajesh said

    absolutely … fantastic tutorial thank you so much pal…………..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: