Thursday, May 8, 2008

Installing Tomcat6 in Centos

I have installed the tomcat6 in my centos server recently. It was pretty simple and straight forward. After installing tomcat6, I need to do some multi instances of tomcat6, I will post the steps of setting multi instances in later post. These are the steps:

1. Download tomcat6 (core) from official web site.

2. Extract, move and renamed it as /var/tomcat6/

3. Download Administration Web Application and extract it into /var/tomca6/ accordingly.

4. Set JAVA_HOME, PATH, CLASSPATH, CATALINA_HOME in /etc/profile, for example:
export JAVA_HOME=/var/local/java/j2sdk
export PATH=${PATH}:/usr/local/java/j2sdk/jre/bin
export CLASSPATH=.:/usr/local/java/j2sdk/lib:/usr/local/java/j2sdk/jre/bin
export CATALINA_HOME=/var/tomcat6

5. Open firewall for port 8080 in /etc/sysconfig/iptables , for example:
# Tomcat default port
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

6. Restart firewall by inserting command as "service iptables restart"

7. Download 2 jar files from this link. These jar files are commons-fileupload-(version).jar and commons-io-(version).jar

8. Put 2 jar files into $CATALINA_HOME/common/lib. These jar files will be used for uploading war files.

9. Adding user login and password in $CATALINA_HOME/conf/tomcat-users.xml

10. Start tomcat service by executing $CATALINa_HOME/bin/startup.sh

11. Try to access tomcat web page by using http://localhost:8080

12. It considered success if the URL is valid.

No comments: