Wednesday, February 3, 2010

Installing Apache Tomcat server in ubuntu 9.04

To install Apache tomcat 6 server, we will follow some steps, they are described below:

Step1 : [ Adding sources ]

In this step we will add a third party source.
source Address:

deb jaunty multiverse
deb-src jaunty multiverse

just copy this and paste to ur sources.list file
To know how to add sources please visit this post.

step2 : [ Installing java jdk6 ]

To install this open the terminal and type or copy paste the following command.
" sudo apt-get install sun-java6-jdk "

Now jdk will be start installing please follow the on screen commands.

step3: [ Installing Tomcat server ]

" sudo apt-get install tomcat6 "
write the above command on the terminal and follow the on screen command.

step4 : [ Installing tomcat docs, examples and admin panel]

" sudo apt-get install tomcat6-docs tomcat6-examples tomcat6-admin "

write the following command on the terminal and follow the onscreen command.


Your Installation is done.
now open any web browser and on its address bar type
" http://localhost:8080"
if you get a page containg IT WORKS message ur server is running Ok.


Important Notes:

1. This server starts automatically every time when the system starts.

2. If you manually start or stop this server please follow the following commands and put them on the terminal.
" sudo /etc/init.d/tomcat6 start " [ To start the server ]
" sudo /etc/init.d/tomcat6 stop " [To stop the server ]
" sudo /etc/init.d/tomcat6 restart " [ To restart the server ]

3. All files regarding this server installation are located at this Location:
" /
usr/share/tomcat6 "

4. Webapps folder located at " /var/lib/tomcat6/webapps " location.

Adding package repository sources to source list in ubuntu

To add sources to source list we can follow either Terminal mode Or from the GUI mode we can add sources to source.list file.
I will describe both the ways....
From Terminal:
# At first open the terminal [ Application>>Accessories>>Terminal ]
# Then write the following command on the terminal [Except the "" marks]
" sudo gedit /etc/apt/sources.list "
# If required provide the sudo password or your user password.
# Then a new window will open.
# In that window at last of that window just add your sourcess and save the file and close. You are done.
# Now write " sudo apt-get update " in the terminal.
Now it is updated.

From GUI Mode:
To add sources from GUI mode,
#Click on System>>Administration>>Software sources.
#If required give ur sudo password.
#A new window will come , in that window select Third party software tab and at the bottom left corner u will get an ADD button. Click on that, A text box will appear and paste your source there and press ok.
#Now close the window and u will be prompted to update ur aptitude list. click ok there. You are done.