Installing Tomcat on Ubuntu
Versions:
SDK: 1.5
JRE: 1.5
Tomcat: 5.5
Step 1 – Install JRE and SDK
Download and install the Java Software Development Kit (SDK) and J2SE Runtime Environment (JRE). These packages are available through Synaptic (the extra repositories have to be added).
Or in terminal type:
N.B. SDK is 146MB and JRE is 84.7MB.
You can verify that both items were installed corectly, by checking that you get a response when typing in terminal:
Step 2 – Get tomcat
Download tomcat 5.5 from http://jakarta.apache.org/site/downloads/
In this example I am using jakarta-tomcat-5.5.9.tar.gz
Uncompress the file:
N.B. To make things simpler I also renamed the package to just 'tomcat'. If you do not do this, make sure you adjust these tutorial instructions to the name of your package whenever you see 'tomcat' written.
Step 3 – Add tomcat
Place the uncompressed package in:
/usr/local/
Step 4 – Set JAVA_HOME and CLASSPATH
You need to point out where you installed Java SDK. You will have to edit the file '.bashrc'. Backup this file first!
In terminal type:
Add the following lines to the file:
N.B. remember to change the word tomcat to the name of the package you placed in /usr/local.
Save and close. You will have to log out and back in again before these changes take effect.
The next steps are optional. They are for setting tomcat up to be used as a development environment. Skip to the last step ( Step 8 ) if you just want to start tomcat how it is.
Step 5 – Change default port number
Tomcats default port number is 8080. To change it to 80 or another number do the following.
In terminal type:
Find the lines:
Adjust the port number to 80 (or any other port number you want to use), save and close.
Step 6 – Turn on Servlet reloading
In terminal type:
Find:
Change it to:
Save and close.
Step 7 – Enable Invoker Servlet
In terminal type:
Find and uncomment (remove the <-- and --> wrapped around the tags):
Also find and uncomment:
Save and close.
Step 8 – Start tomcat
Tomcat should now be ready to run.
In terminal type:
If everything is working fine, you will see the following lines:
In your browser head to http://localhost/ and test if it is serving. If you didn't change the port number it was serving on, head to http://localhost:8080/
To stop tomcat type:
-----
I hope this helped!
If you have any problems, I recommend this site for more details: http://www.coreservlets.com/
Step 3 – Add tomcat
Place the uncompressed package in:
/usr/local/
Varuna Seneviratna
Varuna Seneviratna wrote:How tomcat 5 should be installed and Is there a better way than the above?
Varuna Seneviratna wrote:How to move tomcat5 Uncompressed package in to the /usr/local/ directory or is there a better location than this
Varuna Seneviratna wrote:What is the default setting of privileges and permissions regarding file access in a Linux system
Varuna Seneviratna wrote:There is no tocmcat5 in apt-cache in such a situation what is the normally used way of installing?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Varuna Seneviratna
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Andrew Monkhouse wrote:Most people do not set the classpath anymore - try not setting it and confirm that tomcat starts up correctly. If it is unable to determine paths by itself, then you can set CATALINA_HOME to the location where you installed tomcat (/usr/local/tomcat) and it will determine the location of the directories based on that.
Often the most important part of the news is what they didn't tell.
Thanks,
Pramod
Nothing up my sleeve ... and ... presto! A tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|