Tomcat 6 and JDK 1.6

Installing Tomcat 6
===================
yum only gives tomcat5. So,

yum remove tomcat5 -y
cd /usr/share
wget http://lawyersdb.com/mirrors/apache/ant/binaries/apache-ant-1.8.1-bin.tar.gz
tar xvzf apache-ant-1.8.1-bin.tar.gz
ln -s /usr/share/apache-ant-1.7.1/bin/ant /usr/local/bin

mkdir /usr/local/tomcat
wget http://lawyersdb.com/mirrors/apache/tomcat/tomcat-6/v6.0.28/bin/apache-tomcat-6.0.28.tar.gz
tar xvzf apache-tomcat-6.0.28.tar.gz
mv apache-tomcat-6.0.28/* ./
rm -rf apache-tomcat-6.0.28

Go get /etc/init.d/tomcatd startup script frm ns38 or google around.

chown -R root:tomcat /usr/local/tomcat/
chown -R tomcat:tomcat /usr/local/tomcat/temp/
chown -R tomcat:tomcat /usr/local/tomcat/logs/
chown -R root:root /usr/local/tomcat/bin/

Next, test,

maybe cannot start. Why? make sure this details are acordingly in /etc/init.d/tomcatd

# chkconfig: 345 84 16
# description: Tomcat jakarta JSP server

TOMCAT_HOME=/usr/local/tomcat
TOMCAT_START=$TOMCAT_HOME/bin/startup.sh
TOMCAT_STOP=$TOMCAT_HOME/bin/shutdown.sh
TMP_FILE=/tmp/tomcat_process_count.txt

# Necessary environment variables
export JAVA_HOME=/usr/bin
export JRE=$JAVA_HOME/jre
export CATALINA_HOME=$TOMCAT_HOME
export ANT_HOME=/usr/share/apache-ant-1.8.1
export CLASSPATH=$JAVA_HOME/lib:$JRE/lib:$CATALINA_HOME/bin/:$CATALINA_HOME/common/lib:.

And make sure work/Catalina is chmod to 755, and tomcat:tomcat chown.. blablabla..

Installing JDK + JRE 1.6
========================

NOT AS ROOT!!
vi ~/.rpmmacros

%_topdir /home//rpmbuild
%_tmppath %{_topdir}/tmp

:wq
mkdir /home//rpmbuild
mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}
yum install -y rpm-build gcc gcc-c++ redhat-rpm-config

im using Centos 5.2, so,

yum install jpackage-utils

then, need to get the JDK (in this case JDK 1.6) from Sun Java download or the Sun JDK archive and put it in ~/rpmbuild/SOURCES/ folder.

cd ~/rpmbuild/SOURCES/
wget http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u14-linux-x64.bin?BundledLineItemUUID=c7iJ_hCySKYAAAEpe8tFv8T9&OrderID=xMaJ_hCylT4AAAEpaMtFv8T9&ProductID=tPxIBe.oz2IAAAEhmh0zLjfT&FileName=/jdk-6u14-linux-x64.bin

Browse the JPackage archive for the proper nosrc.rpm file. At the time of writing it is: java-1.6.0-sun-1.6.0.14-1jpp.nosrc.rpm

cd ~/rpmbuild/
curl -L -O http://mirrors.dotsrc.org/jpackage/5.0/generic/SRPMS.non-free/java-1.6.0-sun-1.6.0.14-1jpp.nosrc.rpm
rpmbuild --rebuild java-1.6.0-sun-1.6.0.14-1jpp.nosrc.rpm

then it will execute for quite some time, just wait, patient, wash hand.. then something like this appear:

rote: /root/rpmbuild/RPMS/x86_64/java-1.6.0-sun-alsa-1.6.0.14-1jpp.x86_64.rpmWrote: /root/rpmbuild/RPMS/x86_64/java-1.6.0-sun-jdbc-1.6.0.14-1jpp.x86_64.rpmExecuting(%clean): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.24651+ umask 022+ cd /root/rpmbuild/BUILD+ cd jdk1.6.0_14+ rm -rf /root/rpmbuild/tmp/java-1.6.0-sun-1.6.0.14-1jpp-buildroot+ exit 0Executing(--clean): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.24651+ umask 022+ cd /root/rpmbuild/BUILD+ rm -rf jdk1.6.0_14+ exit 0

Then means OKie oredi.. so next, we put them in our local yum repository or install them:

yum --nogpgcheck localinstall ~/rpmbuild/RPMS/x86_64/java-1.6.0-sun-1.6.0.14-1jpp.x86_64.rpm

alternatives --config java (to check which is which)
refer here for adding new if not auto : http://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-difference-between-gcj-and-jre-806269/#2

And check:

[root@nplay-03 rpmbuild]# java -versionjava version "1.6.0_14"Java(TM) SE Runtime Environment (build 1.6.0_14-b08)Java HotSpot(TM) 64-Bit Server VM (build 14.0-b16, mixed mode)

Ref :
http://de0ris.blogspot.com/2008/08/installing-tomcat-6x-on-centos-5.html
http://www.velocityreviews.com/forums/t133231-java-net-connectexception-connection-refused.html
http://wiki.centos.org/HowTos/JavaOnCentOS#head-98e26dc0ed04622c86be3e0d9cdb2baf63c07b19

kudos : hmlee, cllee

//alak

Comments

Popular posts from this blog

SAP: Segregate Different SMTP Mail Server Based on Sender Domain

SAP Client Copy Error: Errors occurred during export of container object FINB-TR-DERIVATION

Quick Dirty Script for Checking Oracle Data Gurad Gap and Emailing it