Skip to content


CentOs5.2安装tomcat

查看当前版本

  1. java -version
  2. java version "1.4.2"

卸载1.4

  1. rpm -qa |grep java
  2. java-1.4.2-gcj-compat-1.4.2.0-26jpp
  3. ......
  4. rpm   -e   java-1.4.2-gcj-compat-1.4.2.0-26jpp
======================
2010-11-5更新 jdk6 6u2364位版
http://www.java.net/download/jdk6/6u23/promoted/b03/binaries/jdk-6u23-ea-bin-b03-linux-amd64-18_oct_2010-rpm.bin
======================

安装jdk1.6

  1. wget http://www.java.net/download/jdk6/6u18/promoted/b04/binaries/jdk-6u18-ea-bin-b04-linux-i586-28_oct_2009-rpm.bin
  2. chmod 755 jdk-6u18-ea-bin-b04-linux-i586-28_oct_2009-rpm.bin\?e\=1257754475\&h\=106947ca348d71bef632eb95d717de05
  3. ./jdk-6u18-ea-bin-b04-linux-i586-28_oct_2009-rpm.bin\?e\=1257754475\&h\=106947ca348d71bef632eb95d717de05

一路空格后健入yes

查看当前版本

  1. java -version
  2. java version "1.6.0"
  3. OpenJDK  Runtime Environment (build 1.6.0-b09)
  4. OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)
=======================
2010-11-5更新
tomcat 新的版本及下载地址
http://labs.renren.com/apache-mirror/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
=======================

安装tomcat

  1. wget http://labs.xiaonei.com/apache-mirror/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz
  2. tar zxvf apache-tomcat-6.0.20.tar.gz
  3. mv apache-tomcat-6.0.20 /opt/tomcat

设置环境变量

  1. vi /etc/profile
  2. JAVA_HOME=/usr/java/jdk1.6.0_20
  3. export JAVA_HOME
  4. PATH=$PATH:$JAVA_HOME/bin
  5. export PATH
  6. CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
  7. export CLASSPATH
  8. export JDK_HOME=${JAVA_HOME}
  9. export CATALINA_BASE=/opt/tomcat
  10. export CATALINA_HOME=/opt/tomcat

启动tomcat

  1. source /etc/profile
  2. /opt/tomcat/bin/startup.sh

打开8080防火墙

  1. iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
  2. service iptables save
  3. service iptables restart

http://localhost:8080

参考:
http://blog.c1gstudio.com/archives/142
tomcat安全设置
http://blog.c1gstudio.com/archives/865
优化tomcat 内存
http://blog.c1gstudio.com/archives/276

Posted in Tomcat, 技术.

Tagged with .


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.