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:
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.
I went through all the above up to the point where it says
Step 3 – Add tomcat
Place the uncompressed package in:
I am not able to move the Uncompressed package in to the /usr/local/ directory by coping or cut and pasting.
Please advice on
How tomcat 5 should be installed and Is there a better way than the above? How to move tomcat5 Uncompressed package in to the /usr/local/ directory or is there a better location than this What is the default setting of privileges and permissions regarding file access in a Linux system There is no tocmcat5 in apt-cache in such a situation what is the normally used way of installing?
Varuna Seneviratna wrote:How tomcat 5 should be installed and Is there a better way than the above?
The way mentioned above sounds perfectly reasonable to me.
Varuna Seneviratna wrote:How to move tomcat5 Uncompressed package in to the /usr/local/ directory or is there a better location than this
Personally I tend to use /opt for any packages I install that are not in a package management system. But that is just personal preference. Others have different views. If you are truly interested, you may wish to read such discussions as Point/Counterpoint - /opt vs. /usr/local.
Technically speaking, you do not need to move it to a "common" location unless there are multiple people using it. You can run Tomcat from within your home directory if you wished. I have a personal preference to move it, but it is certainly not mandatory.
As for how to move it - from the instructions you provided, you should have already been at the command prompt so you could issue the tar command. At this point, depending on the permissions of the /usr/local directory, you could:
mv jakarta-tomcat-5.5.9 /usr/local (if you have write access to /usr/local)
sudo mv jakarta-tomcat-5.5.9 /usr/local (if you do not have write access to /usr/local)
Side note: if you have to use sudo to move the Tomcat directory, you may wish to think about how you are running Tomcat. If you start Tomcat using your own user account, it will create the working and log directories with permissions for you to write to them, but probably nobody else. You may wish to verify that at least the group permissions are set correctly so that other users of your computer who are in the same group can also start it. Or set up a specific user/group to always start Tomcat as a daemon service. Or get your system administrator to set it up.
Varuna Seneviratna wrote:What is the default setting of privileges and permissions regarding file access in a Linux system
Your question is far too vague. The default settings for your home directory are probably different to the default setting for your Documents directory which will be different again to the default settings for the /usr directory which may still be different to the default settings for /usr/local
Varuna Seneviratna wrote:There is no tocmcat5 in apt-cache in such a situation what is the normally used way of installing?
Usually the same steps are followed as per the instructions you copied and pasted. Sometimes there are additional steps. Sometimes there are fewer steps. But the basic concept is typically the same.
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.
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.
Tomcat will determine which JDK to run under from the current OS environment, if it can. You can be more specific by setting the JRE_HOME environment variable, either in the sequence commands that you use to launch Tomcat or by adding a "TOMCAT_HOME/bin/setenv.sh" script that does the assignment.
Tomcat actually runs with multiple classpaths, and which one is used depends on where in the Tomcat system you're working. The actual startup of Tomcat only requires the defaults of the JDK that Tomcat was launched under. Tomcat itself will build the other classpaths where/as needed. For example, when a WAR is deployed, Tomcat builds a classpath that includes the base JDK classes, all the jar files in the CATALINA_HOME directory, all the jar files in the webapp-s WEB-INF/WAR directory, and the WEB-INF/classes directory. So as you can see, each webapp would be provided its very own unique classpath.
In the case of the servlet-api and jsp-api jars, they'd integrate in via the CATALINA_HOME/lib part of the classpath, so that means that you should not include them explicitly in the WAR, nor do you need to explicitly pull them in in any other way (and if you try, it will come back and bite you!).
Of course, while the servlet-api and jsp-api jars may not be something that you'd actually include IN a WAR, they define interfaces such as HTTPServletRequest that are required to BUILD a WAR. So those 2 classes should be explicitly provided to the application compiler classpath. Just not to the runtime classpath.
Customer surveys are for companies who didn't pay proper attention to begin with.
I'm completely new to Ubuntu &/Linux, have installed it yesterday after my hard disk having windows 7 crashed and needed to be replaced.
I followed this post for setting tomcat up. When I use the command prompt, and run Java -version, it shows me :-
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10)
OpenJDK Server VM (build 20.0-b11, mixed mode)
As per this post, I entered the following path in the said file.
#Stuff we added to make tomcat go
I tested it and got the following result:-
pramod@pramod-Inspiron-1440:~$ sh /usr/local/apache-tomcat-6.0.33/bin/startup.shUsing CATALINA_BASE: /usr/local/apache-tomcat-6.0.33
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.33
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.33/temp
Using JRE_HOME: /usr/lib/jvm/java-6-openjdk/
Using CLASSPATH: /usr/local/apache-tomcat-6.0.33/bin/bootstrap.jar
Is this right? The post mentions about java 2sdk 1.5 but I've entered Openjdk details and still when I check with java -version , it shows me 1.6.23 and some openjdk details. Is it right?
Is there any difference between Open jdk & sun jdk ?