Base OS: redhat5.4.
JDK version: jdk-6u22-linux-i586-rpm.bin
Tomcat version: APACHE-Tomcat-5.5.31
Download JDK form Official Website: http://java.sun.com/
Jdk-6u22-linux-i586-rpm.bin
Download Tomcat from official website: http://tomcat.apache.org/
Apache-tomcat-5.5.31.tar.gz
1. Setup JDK
[Root @ rh5 opt] # cp jdk-6u22-linux-i586-rpm.bin/usr
[Root @ rh5 opt] # cd/usr
[Root @ rh5 USR] # chmod 755 jdk-6u20-linux-i586-rpm.bin
[Root @ rh5 USR] # sh jdk-6u22-linux-i586-rpm.bin
Excute this package, it will auto extra jdk rpm package and finish the installation, after the installation you will see/usr/Java/jdk1.6.0 _ 22 fold, This is the JDK home directory.
2. Configure Java environment, edit/etc/profile, add these content:
- Java_home = "/usr/Java/jdk1.6.0 _ 22"
- Export java_home
- Path = $ java_home/bin: $ path
- Export path
- Classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. jar: $ classpath
- Export classpath
3. Bring the enviroment effect with this command:
[Root @ rh5 USR] # source/etc/profile
4. You can check the enviroment with ECHO command in terminal:
[Root @ rh5 USR] # echo $ java_home
[Root @ rh5 USR] # echo $ classpath
[Root @ rh5 USR] # echo $ path
If you find the echo value incorrect, please check the content previous.
5. Checking if JDK install correctly:
[Root @ rh5 USR] # Java-version
Java version "1.6.0 _ 22"
Java (TM) se Runtime Environment (build 1.6.0 _ 22-b04)
Java hotspot (TM) Client VM (build 17.1-b03, mixed mode, sharing)
You can see the Java version info, if you see the info like these, it mean you make it, successfully!
6. tomcat installation
[Root @ fig] # cp apache-tomcat-5.5.31.tar.gz/usr/local/
[Root @ rh5 opt] # cd/usr/local/
[Root @ rh5 local] # tar-zxpf apache-tomcat-5.5.29.tar.gz
[Root @ rh5 local] # Music apache-tomcat-5.5.31.tar.gz tomcat5.5
7. configrate Tomcat enviroment, edit/etc/profile, add these content:
- Export catalina_home = "/usr/local/tomcat5.5"
- Export catalina_base = "/usr/local/tomcat5.5"
8. Bring the enviroment effect.
[Root @ rh5 opt] # source/etc/profile
In here, the configration almost finished, now we can start Tomcat:
[Root @ rh5 opt] #/usr/local/tomcat5.5/bin/startup. Sh
Using catalina_base:/usr/local/tomcat5.5
Using catalina_home:/usr/local/tomcat5.5
Using catalina_tmpdir:/usr/local/tomcat5.5/temp
Using jre_home:/usr/Java/jdk1.6.0 _ 22
Using classpath:/usr/local/tomcat5.5/bin/Bootstrap. Jar
If startup failed, you can try to run this first/Usr/local/tomcat5.5/bin/shutdown. Sh,
And then/Usr/local/tomcat5.5/bin/startup. Sh
9. Checking the services:
[Root @ rh5 bin] # ps-Ef | grep Tomcat
Root 11362 1 0 00:00:02 pts/0/usr/Java/jdk1.6.0 _ 22/bin/Java-djava. util. logging. config. file =/usr/local/tomcat5.5/CONF/logging. properties-djava. util. logging. manager = org. apache. juli. classloaderlogmanager-djava. endorsed. dirs =/usr/local/tomcat5.5/common/endorsed-classpath/usr/local/tomcat5.5/bin/Bootstrap. jar-dcatalina. base =/usr/local/tomcat5.5-dcatalina. home =/usr/local/tomcat5.5-djava. io. tmpdir =/usr/local/tomcat5.5/temp Org. apache. catalina. startup. bootstrap start
[Root @ rh5 bin] # netstat-tanpen
Active Internet connections (servers and established)
PROTO Recv-Q send-Q local address foreign address State user inode PID/program name
TCP 0 0 127.0.0.1: 2208 0.0.0.0: * Listen 0 8964 2601/hpiod
TCP 0 0 127.0.0.1: 631 0.0.0.0: * Listen 0 9096 2638/cupsd
TCP 0 0 127.0.0.1: 25 0.0.0.0: * Listen 0 9221 2662/sendmail: acce
TCP 0 0 127.0.0.1: 2207 0.0.0.0: * Listen 0 8982 2606/Python
TCP 0 0: FFFF: 127.0.0.1: 8005: * Listen 0 54411 11362/Java
TCP 0 0: 8009: * Listen 0 54410 11362/Java
TCP 0 0: 8080: * Listen 0 54389 11362/Java
TCP 0 0: 22: * Listen 0 9043 2624/sshd
TCP 0 180: FFFF: 192.168.1.12: 22: FFFF: 192.168.1.2: 63571 established 0 10849 2940/0
From here, you can see the services if working normally.
10. Now we access the server 8080 port with browser, this is the normal Website: