Linux下Tomcat开机自动启动
1、向/etc/profile中加入环境变量,内容如下:
JAVA_HOME=/usr/java/jdk1.5.0_09
export JAVA_HOME
JRE_HOME=/usr/java/jdk1.5.0_09/jre
export JRE_HOME
#APACHE_HOME=/usr/local/apache
#APACHE2_HOME=/usr/local/apache
TOMCAT_HOME=/usr/share/tomcat5
CATALINA_BASE=/usr/share/tomcat5
CATALINA_HOME=/usr/share/tomcat5
export TOMCAT_HOME CATALINA_BASE CATALINA_HOME
#ANT_HOME=/usr/local/apache-ant
#export ANT_HOME
#JAMES_HOME=/usr/local/james
#export JAMES_HOME
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$TOMCAT_HOME/webapps
#CLASSPATH=$CLASSPATH:/var/www/html/webapps/WEB-INF/lib:/var/www/html/webapps/WEB-INF/classes
export CLASSPATH
#MYSQL_HOME=/usr/local/mysql
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export PATH
2、创建Tomcat启动Shell脚本/usr/share/tomcat5/bin/tomcatd.sh,内容如下:
JAVA_HOME=/usr/java/jdk1.5.0_09
export JAVA_HOME
JRE_HOME=/usr/java/jdk1.5.0_09/jre
export JRE_HOME
#APACHE_HOME=/usr/local/apache
#APACHE2_HOME=/usr/local/apache
TOMCAT_HOME=/usr/share/tomcat5
CATALINA_BASE=/usr/share/tomcat5
CATALINA_HOME=/usr/share/tomcat5
export TOMCAT_HOME CATALINA_BASE CATALINA_HOME
#ANT_HOME=/usr/local/apache-ant
#export ANT_HOME
#JAMES_HOME=/usr/local/james
#export JAMES_HOME
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$TOMCAT_HOME/webapps
#CLASSPATH=$CLASSPATH:/var/www/html/webapps/WEB-INF/lib:/var/www/html/webapps/WEB-INF/classes
export CLASSPATH
#MYSQL_HOME=/usr/local/mysql
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export PATH
cd $TOMCAT_HOME/bin; ./startup.sh
3、添加启动项到/etc/rc.local中。
/usr/share/tomcat5/bin/tomcatd.sh > /dev/null &
- 默认分类(20)
- J2EE(25)
- Java(56)
- PHP(55)
- SEO(10)
- 网页设计(20)
- 网站建设(37)
- 数据库(7)
- JavaScript(17)
- JQuery(6)
- MySQL(20)
- SQL Server(6)
- Access(1)
- Oracle(6)
- office(6)
- Dreamweaver(4)
- Photoshop(12)
- Flash(9)
- Fireworks(13)
- CSS(14)
- HTML(4)
- .NET(7)
- ASP(2)
- DB2(1)
- Ajax(2)
- Linux(12)
- Struts(7)
- Hibernate(8)
- Spring(2)
- Jsp(22)
- Asp(8)
- C#(3)
- C++(1)
- 网络安全(5)
- 软件工程(7)
- XML(1)
- English(2)
- 计算机等级考试(2)
- 计算机病毒(4)
- 个人日志(76)
- 互联网(15)
- ActionScript(10)
- Android(3)
- 数据结构与算法(1)
- 游戏策略(3)
- 美文翻译(2)
- 编程开发(19)
- 计算机应用(4)
- 计算机(10)
- Unity3d(6)
- 其他(1)
- egret(1)