您的位置:首页 > 运维架构 > Tomcat

Linux下Tomcat安装与启动

2011-06-28 22:27 411 查看
从官网 www.apache.org
下载Tomcat 的相应Linux下的版本,本文以tomcat-5.5.33为例。

1) 解压成文件夹,视具体的文件格式而定。

2)
$ vi /etc/profile

#用vi编辑器打开该文件进行编辑(添加环境变量)

然后在文件的最尾部加入以下代码:

CATALINA_HOME=/tools/apache-tomcat-5.5.33

#(tomcat版本视自己的安装版本而定 )

export
CATALINA
_HOME

保存退出.

3) 现在在终端运行命令:

$ /tools/tomcat*/bin/startup.sh
#开启TOMCAT服务器

然后打开浏览器,输入http://localhost:8080或者 http://127.0.0.1:8080
如果你看到那只可爱的小猫了,就证明安装成功了!

备注:安装过程中遇到几个问题

问题1



can't find the file 'setclasspath.sh'

在网络上找到如下解释,意思就是需要再设置

Then all you need to do is to include the complete
paths for the BASEDIR and CATALINA_HOME variables in the files
setclasspath.sh and catalina.sh respectively.

This
should be done even if CATALINA_HOME has been defined and exported
previously on the command line and/or in /etc/profile as well.
Moreover, this error message persists even though the file
setclasspath.sh is present in Tomcat's bin directory.

$ echo "BASEDIR=/path/to/tomcat" >> setclasspath.sh                        # /path/to  表示你的具体目录

$ echo "CATALINA_HOME=/path/to/tomcat" >> catalina.sh

但是在设置了如上的设置后,使用export命令查看环境变量,发现CATALINA_HOME仍没有改变,所以就是使用如下命令做修改

$ export CATALINA_HOME="/home/owner/tomcat-5.5.33"

问题2:

找不到JAVA_HOME 或者 JRE,由于未设置,因而Tomcat无法找到相应的环境变量,而无法启动

解决方法很简单,在终端中:

$ export JAVA_HOME="/home/owner/tools/jdk1.6.0_26"

最发张Linux下,Firfox启动Tomcat的时候,虽然这种图片见的很多,但是,还是很喜欢看到这个画面的

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐