Install tomcat on linux

how to install tomcat webserver in Fedora
assume your server installed “Development Tools” and “Legacy Software Developement”, I will explain in 2 mainly parts

First, Install JAVA (jdk1.6.0_20)
1. Download the binary file from sun website

# wget http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u20-linux-i586.bin?BundledLineItemUUID=LyeJ_hCwEsMAAAEotLQDhXiA&OrderID=w8.J_hCwR3cAAAEonLQDhXiA&ProductID=guBIBe.oc_wAAAEnaDJHqPYe&FileName=/jdk-6u20-linux-i586.bin

2. Rename file for readable

# mv http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u20-linux-i586.bin?BundledLineItemUUID=LyeJ_hCwEsMAAAEotLQDhXiA&OrderID=w8.J_hCwR3cAAAEonLQDhXiA&ProductID=guBIBe.oc_wAAAEnaDJHqPYe&FileName=/jdk-6u20-linux-i586.bin jdk-6u20-linux-i586.bin

3. Change permission to run file

# chmod a+x jdk-6u20-linux-i586.bin

4. Running installer and follow a step

# ./jdk-6u20-linux-i586.bin

5. Copy folder to /usr/java

# mkdir /usr/java
# mv jdk-6u20-linux-i586 /usr/java

6. Setting path

# vi /etc/profile

add to last line

export PATH=.:/usr/java/jdk1.6.0_20/bin
export JAVA_HOME=/usr/java/jdk1.6.0_20

7. Logout and login again your java will be work

Second, Install tomcat
8. Download tomcat package file from

# wget http://mirror.tourismthai.org/apache/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz

9. Extract file

# tar xvzf apache-tomcat-6.0.26.tar.gz

10. Move folder to /usr/local/tomcat6

# mv apache-tomcat-6.0.26 /usr/local/tomcat6

11. Adduser tomcat6

# adduser tomcat6

12. Changing permission

# chown -R tomcat6:tomcat6 /usr/local/tomcat6

13. Go to folder

# cd /usr/local/tomcat6/bin/

14. Extract jsvc

# tar xvzf jsvc.tar.gz

15. Go into folder

# cd jsvc-src

16. Prepare to setup

# autoconf

17. Checking environment

# ./configure

18. Compiling

# make

19. Copy binary file to parent folder

# cp jsvc ..

20. Make symbolic link for running service

# ln -s /usr/local/tomcat6/bin/catalina.sh /etc/init.d/tomcat6

21. Start tocat

# /etc/init.d/tomcat6 start

22. Test your webserver

# w3m http://localhost:8080

Optional, Install jdbc driver
23. Download jdbc package from

# wget http://mirror-fpt-telecom.fpt.net/mysql/Downloads/Connector-J/mysql-connector-java-5.1.12.tar.gz

24. Extract file

# tar xvzf mysql-connector-java-5.1.12.tar.gz

25. Go into folder

# cd mysql-connector-java-5.1.12

26. Copy library driver file to library path

# mv mysql-connector-java-5.1.12-bin.jar /usr/java/jdk1.6.0_20/jre/lib/ext/

ball Written by:

Teerapat Khunpech Live, Tech, Beers, Bike, Cafe Racer, Docker, Devops, Eco-System