启动服务,解决 the BASEDIRenvironmentvariable is not defined correctly 分类: ubuntu 2013-07-09 17:10 292人阅读 评论(0) 收藏
Linux下安装Tomcat(apache-tomcat-6.0.29.zip):
操作系统:Redhat Linux 5
1、安装Tomcat
解压缩apache-tomcat-6.0.29.zip到任意一个有权限的目录即可,如/home/its/apache-tomcat-6.0.29。
2、下载安装JDK(jdk1.6.0_24-linux-i586.bin):
下载后执行./jdk1.6.0_24-linux-i586.bin命令安装,假设安装后路径为/home/its/jdk1.6.0_24
设置环境变量:vi ~/.bash_profile如下:
JAVA_HOME=/home/its/jdk1.6.0_24
PATH=$PATH:$HOME/bin
PATH=$JAVA_HOME/bin:$PATH
CLASS_PATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export CLASS_PATH
export TOMCAT_HOME=/home/its/apache-tomcat-6.0.29
export CATALINA_HOME=/home/its/apache-tomcat-6.0.29
export PATH
注:红色字体部分为必须,其他设置非必须。
3、启动Tomcat
$ cd /home/its/apache-tomcat-6.0.29/bin
$ ./startup.sh
报错如下:
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
解决办法:
添加/home/its/apache-tomcat-6.0.29/bin下所有.sh文件可执行权限如下:
$ cd /home/its/apache-tomcat-6.0.29/bin
$ chmod +x *.sh
重新启动Tomcat即可。