Download the latest jdk fromcd /usr/local/src
http://www.oracle.com/technetwork/java/ ... 80260.html
Download the rpm file for eg : jdk-7u21-linux-x64.rpm
Install uisngmv jdk-7u21-linux-x64.rpm\?AuthParam\=1368006222_2c6faa20e11d439c32634260112ed060 jdk-7u21-linux-x64.rpm
If it shows an errorrpm -ivh jdk-7u21-linux-x64.rpm
Package jdk-7u21-linux-x64.rpm is not signed
you can fix that using :
viewtopic.php?f=42&t=129
Download tomcat latest version from :cd /usr/share/
http://apache.techartifact.com/mirror/t ... .39.tar.gz
Untar the file and enter the "bin" folder
tar -xvzf apache-tomcat-7.0.39.tar.gz
cd apache-tomcat-7.0.39/bin
Change the variable "JAVA_HOME" as mentioned below :vi catalina.sh
You can now start stop tomcat usingJAVA_HOME=/usr/java/jdk1.7.0_21
Now we can add tomcat as a service./startup.sh
./shutdown.sh
cd /etc/init.d
Add the below lines to the filevi tomcat
Code: Select all
#!/bin/bash
# chkconfig: 234 20 80
# description: Tomcat Server basic start/shutdown script
# processname: tomcat
JAVA_HOME=/usr/java/jdk1.7.0_21
export JAVA_HOME
TOMCAT_HOME=/usr/share/apache-tomcat-7.0.39/bin
START_TOMCAT=/usr/share/apache-tomcat-7.0.39/bin/startup.sh
STOP_TOMCAT=/usr/share/apache-tomcat-7.0.39/bin/shutdown.sh
start() {
echo -n "Starting tomcat: "
cd $TOMCAT_HOME
${START_TOMCAT}
echo "done."
}
stop() {
echo -n "Shutting down tomcat: "
cd $TOMCAT_HOME
${STOP_TOMCAT}
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
service tomcat restart
chkconfig --add tomcat
chkconfig tomcat on
You should now view the tomcat manager from the URL : IP_ADDRESS:8080
How to bind tomcat to port 80 of a specific Ip address :
On line 70 change the below :vi /usr/share/apache-tomcat-7.0.39/conf/server.xml
to<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
How to configure tomcat manager<Connector port="80"
protocol="HTTP/1.1"
address="68.171.223.6"
connectionTimeout="20000"
redirectPort="8443" />
Follow :
viewtopic.php?f=121&t=130&p=145&hilit=manager#p145