当前位置: 技术问答>linux和unix
linux下的Tomcat
来源: 互联网 发布时间:2017-02-17
本文导语: 谁那有linux下的tomcat文件,和一些安装文档。因为是第一次装,对这些还不太了解。希望好心人的帮助。留个QQ MSN。聊聊也可以 | 下载apache-tomcat-5.5.34.tar.gz Tomcat解压即可使用 #tar –xzvf apache-...
谁那有linux下的tomcat文件,和一些安装文档。因为是第一次装,对这些还不太了解。希望好心人的帮助。留个QQ MSN。聊聊也可以
|
下载apache-tomcat-5.5.34.tar.gz
Tomcat解压即可使用
#tar –xzvf apache-tomcat-5.5.34.tar.gz
#cp apache-tomcat-5.5.34 /usr/local
启动tomcat
#/usr/local/apache-tomcat-5.5.34/bin/./startup.sh
停止tomcat
#/usr/local/apache-tomcat-5.5.34/bin/./shutdown.sh
配置tomcat自启动
#vi /etc/rc.d/init.d/tomcat
#!/bin/bash
# chkconfig: 345 99 10
# description: Startup Script for tomcat
# /etc/rc.d/init.d/tomcat
#JDK Settings
export JAVA_HOME=/usr/java/jdk1.5.0_22
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/toos.jar
export PATH=$PATH:$JAVA_HOME/bin
case "$1" in
start)
echo "Starting tomcat: "
/usr/local/tomcat5/bin/./startup.sh
echo "OK......tomcat started"
;;
stop)
echo "Shutdown tomcat: "
/usr/local/tomcat5/bin/./shutdown.sh
echo "OK.....tomcat stoped"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0
改变用户组、添加执行权限等
#chown oracle.oinstall /etc/rc.d/init.d/ tomcat
#chmod +x /etc/rc.d/init.d/ tomcat
#chkconfig –add tomcat
使用service tomcat start 启动
使用service tomcat stop 停止
Tomcat解压即可使用
#tar –xzvf apache-tomcat-5.5.34.tar.gz
#cp apache-tomcat-5.5.34 /usr/local
启动tomcat
#/usr/local/apache-tomcat-5.5.34/bin/./startup.sh
停止tomcat
#/usr/local/apache-tomcat-5.5.34/bin/./shutdown.sh
配置tomcat自启动
#vi /etc/rc.d/init.d/tomcat
#!/bin/bash
# chkconfig: 345 99 10
# description: Startup Script for tomcat
# /etc/rc.d/init.d/tomcat
#JDK Settings
export JAVA_HOME=/usr/java/jdk1.5.0_22
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/toos.jar
export PATH=$PATH:$JAVA_HOME/bin
case "$1" in
start)
echo "Starting tomcat: "
/usr/local/tomcat5/bin/./startup.sh
echo "OK......tomcat started"
;;
stop)
echo "Shutdown tomcat: "
/usr/local/tomcat5/bin/./shutdown.sh
echo "OK.....tomcat stoped"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0
改变用户组、添加执行权限等
#chown oracle.oinstall /etc/rc.d/init.d/ tomcat
#chmod +x /etc/rc.d/init.d/ tomcat
#chkconfig –add tomcat
使用service tomcat start 启动
使用service tomcat stop 停止