源:http://blog.csdn.net/zhuying_linux/article/details/6583096
评:部分 内容 原文多
Linux下Tomcat的安装配置
一.下载安装对应的jdk,并配置Java环境。
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fhttp://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin;"
yum -y install httpd* php* mysql*
yum -y install lrzsz rz上传工具
tar zxf jdk1.6.0_33_x64.tar.gz -C /usr/local/
ln -s /usr/local/jdk1.6.0_33 /usr/local/jdk
#set jdk
cat >> /etc/profile << EOF
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=\${JAVA_HOME}/jre
export CLASSPATH=.:\${JAVA_HOME}/lib:\${JRE_HOME}/lib
export PATH=\${JAVA_HOME}/bin:\$PATH
EOF
#
rm -rf /usr/bin/java
ln -s /usr/local/jdk1.6.0_33/bin/java /usr/bin/
#source jdk
source /etc/profile
java -version
官网下载地址:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html
下载将jdk加压后放到/usr/local目录下:
#chmod 755 jdk-6u5-linux-x64.bin
# ./jdk-6u5-linux-x64.bin
#mv jdk1.6.0_05 /usr/local
建立/usr/local/下的jdk软连接方便以后版本升级 :
# ln -s /usr/local/jdk1.6.0_05/ /usr/local/jdk
配置环境变量:
在 /etc/profile 中加入以下内容:
JAVA_HOME=/usr/local/jdk1.6.0_05
JAVA_BIN=/usr/local/jdk1.6.0_05/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
保存退出
source /etc/profile
查看java环境变量是否生效
# java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)
测试成功
二.下载安装tomcat(http://tomcat.apache.org/)
# unzip apache-tomcat-6.0.30.zip
# mv apache-tomcat-6.0.30/ /usr/local/
cd /usr/local/
# ln -s /usr/local/apache-tomcat-6.0.30/ /usr/local/tomcat
# cd tomcat/bin/
#ls
#vim catalina.sh
添加以下内容:
CATALINA_HOME=/usr/local/apache-tomcat-6.0.30/
#chmod +x *.sh
三.启动tomcat服务器
# /usr/local/tomcat /bin/catalina.sh start
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.30/
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.30/
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.30//temp
Using JRE_HOME: /usr/local/jdk1.6.0_05
Using CLASSPATH: /usr/local/apache-tomcat-6.0.30//bin/bootstrap.jar
# cd /usr/local/tomcat/logs/
# tail -f catalina.out
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Jul 4, 2011 11:06:57 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jul 4, 2011 11:06:58 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jul 4, 2011 11:06:58 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
评:部分 内容 原文多
Linux下Tomcat的安装配置
一.下载安装对应的jdk,并配置Java环境。
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fhttp://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin;"
yum -y install httpd* php* mysql*
yum -y install lrzsz rz上传工具
tar zxf jdk1.6.0_33_x64.tar.gz -C /usr/local/
ln -s /usr/local/jdk1.6.0_33 /usr/local/jdk
#set jdk
cat >> /etc/profile << EOF
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=\${JAVA_HOME}/jre
export CLASSPATH=.:\${JAVA_HOME}/lib:\${JRE_HOME}/lib
export PATH=\${JAVA_HOME}/bin:\$PATH
EOF
#
rm -rf /usr/bin/java
ln -s /usr/local/jdk1.6.0_33/bin/java /usr/bin/
#source jdk
source /etc/profile
java -version
官网下载地址:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html
下载将jdk加压后放到/usr/local目录下:
#chmod 755 jdk-6u5-linux-x64.bin
# ./jdk-6u5-linux-x64.bin
#mv jdk1.6.0_05 /usr/local
建立/usr/local/下的jdk软连接方便以后版本升级 :
# ln -s /usr/local/jdk1.6.0_05/ /usr/local/jdk
配置环境变量:
在 /etc/profile 中加入以下内容:
JAVA_HOME=/usr/local/jdk1.6.0_05
JAVA_BIN=/usr/local/jdk1.6.0_05/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
保存退出
source /etc/profile
查看java环境变量是否生效
# java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)
测试成功
二.下载安装tomcat(http://tomcat.apache.org/)
# unzip apache-tomcat-6.0.30.zip
# mv apache-tomcat-6.0.30/ /usr/local/
cd /usr/local/
# ln -s /usr/local/apache-tomcat-6.0.30/ /usr/local/tomcat
# cd tomcat/bin/
#ls
#vim catalina.sh
添加以下内容:
CATALINA_HOME=/usr/local/apache-tomcat-6.0.30/
#chmod +x *.sh
三.启动tomcat服务器
# /usr/local/tomcat /bin/catalina.sh start
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.30/
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.30/
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.30//temp
Using JRE_HOME: /usr/local/jdk1.6.0_05
Using CLASSPATH: /usr/local/apache-tomcat-6.0.30//bin/bootstrap.jar
# cd /usr/local/tomcat/logs/
# tail -f catalina.out
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Jul 4, 2011 11:06:57 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jul 4, 2011 11:06:58 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jul 4, 2011 11:06:58 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080