Hi there, as part of my new linux server installation, I planed to document everything I install and setup, so that anyone who need help installing thoese packages [including me in the future] can refer to this information. On this series I will explain how to setup Java & tomcat7 (current version as of writing).
First, Download jdk, you can install jre itself, but in my case need jdk as I compile my sourcecodes on the same server.
Download Tomcat, you can choose the tar.gz archive. move it to the system-wide location, such as /usr/local and extract the contents.
#wget <URL_OF_YOUR_VERSION_OF_TOMCAT.tar.gz>
#mv <URL_OF_YOUR_VERSION_OF_TOMCAT.tar.gz> /usr/local/
#cd /usr/local
#tar -zxvf <URL_OF_YOUR_VERSION_OF_TOMCAT.tar.gz>
This will create a tomcat directory under the /usr/local, you can make a symlink to the directory with a nick name,
To set the PATH veriable permanently, with these bin directories for a perticular user you need to add the path entries to that users .bash_profile file. If you want to set these variables for all users you may have to add the path entries in the /etc/profile
Either case, you will have to add the following script to the end of the file whichever you choose (Single User/ All Users).
JAVA_HOME=/usr/java/jdk
CATALINA_HOME=/usr/local/tomcat7
PATH=$PATH:JAVA_HOME/bin:CATALINA_HOME/bin
export JAVA_HOME
export CATALINA_HOME
export PATH
Now logout and login to see whether you get java commands.
#java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
To test tomcat, run it using the startup.sh command and browse the page localhost:8080/ ot <ip>:8080/
you should see the default page of tomcat.
Thanks for reading...
First, Download jdk, you can install jre itself, but in my case need jdk as I compile my sourcecodes on the same server.
#wget <URL_OF_YOUR_VERSION_OF_JAVA.bin>To install to a system-wide location create a directoy under /usr
#mkdir /usr/javaChange the file mode to executable and run.
#mv <URL_OF_YOUR_VERSION_OF_JAVA.bin> /usr/java/
#cd /usr/javaThis will install java on the server. A new directiory will be created under the current directory with java tools. you can creat a softlink to the directory as jdk.
#chmod a+x <URL_OF_YOUR_VERSION_OF_JAVA.bin>
#./<URL_OF_YOUR_VERSION_OF_JAVA.bin>
#ln -s jdk1.6.0_25 jdkI will tell you where to set the Environment veriables shortly after installing the tomcat.
Download Tomcat, you can choose the tar.gz archive. move it to the system-wide location, such as /usr/local and extract the contents.
#wget <URL_OF_YOUR_VERSION_OF_TOMCAT.tar.gz>
#mv <URL_OF_YOUR_VERSION_OF_TOMCAT.tar.gz> /usr/local/
#cd /usr/local
#tar -zxvf <URL_OF_YOUR_VERSION_OF_TOMCAT.tar.gz>
This will create a tomcat directory under the /usr/local, you can make a symlink to the directory with a nick name,
#ln -s apache-tomcat-7.0.19 tomcat7Now we need to tell the system where is the java bin directory and the tomcat bin directory.
To set the PATH veriable permanently, with these bin directories for a perticular user you need to add the path entries to that users .bash_profile file. If you want to set these variables for all users you may have to add the path entries in the /etc/profile
Either case, you will have to add the following script to the end of the file whichever you choose (Single User/ All Users).
JAVA_HOME=/usr/java/jdk
CATALINA_HOME=/usr/local/tomcat7
PATH=$PATH:JAVA_HOME/bin:CATALINA_HOME/bin
export JAVA_HOME
export CATALINA_HOME
export PATH
Now logout and login to see whether you get java commands.
#java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
To test tomcat, run it using the startup.sh command and browse the page localhost:8080/ ot <ip>:8080/
you should see the default page of tomcat.
Thanks for reading...