5步搞定TOMCAT
发表于:2007-06-08来源:作者:点击数:
标签:
[b:e6cc489b14]5步搞定TOMCAT(入门版)[/b:e6cc489b14] 李高峰 lushanlee@hotmail.com 注意: 1.本文的jakarta- tomcat -5.0.18.tar.gz是放在/opt/software目录下的,大家可以按照自己的目录层次做相应调整。 2.该操作是在完成安装和配置JDK的前提下进行的
[b:e6cc489b14]5步搞定TOMCAT(入门版)[/b:e6cc489b14]
李高峰
lushanlee@hotmail.com
注意:
1.本文的jakarta-
tomcat-5.0.18.tar.gz是放在/opt/software目录下的,大家可以按照自己的目录层次做相应调整。
2.该操作是在完成安装和配置JDK的前提下进行的,如果没有,请参考相关部分进行安装和配置。
3.本文没有对TOMCAT进行配置,如需要请参考相关部分。
[b:e6cc489b14][size=18:e6cc489b14]1 进入到安装目录,解压jakarta-tomcat-5.0.18.tar.gz[/size:e6cc489b14][/b:e6cc489b14]
[root@localhost root]# [b:e6cc489b14]cd /opt/software[/b:e6cc489b14]
[root@localhost software]# [b:e6cc489b14]ls[/b:e6cc489b14]
j2sdk-1_4_2_05-
linux-i586.rpm jakarta-tomcat-5.0.18.tar.gz
[root@localhost software]# [b:e6cc489b14]tar -zxvf jakarta-tomcat-5.0.18.tar.gz[/b:e6cc489b14]
。。。。。。
[root@localhost software]#[b:e6cc489b14] ls[/b:e6cc489b14]
j2sdk-1_4_2_05-linux-i586.rpm jakarta-tomcat-5.0.18.tar.gz
jakarta-tomcat-5.0.18
[b:e6cc489b14][size=14:e6cc489b14]备注①[/size:e6cc489b14][/b:e6cc489b14]
[b:e6cc489b14][size=18:e6cc489b14]2 设置TOMCAT环境变量[/size:e6cc489b14][/b:e6cc489b14]
[root@localhost software]# [b:e6cc489b14]vi /etc/profile[/b:e6cc489b14]
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
# Path manipulation
if [ `id -u` = 0 ] && ! echo $PATH | /bin/grep -q "/sbin" ; then
PATH=/sbin:$PATH
fi
if [ `id -u` = 0 ] && ! echo $PATH | /bin/grep -q "/usr/sbin" ; then
PATH=/usr/sbin:$PATH
fi
if [ `id -u` = 0 ] && ! echo $PATH | /bin/grep -q "/usr/local/sbin" ; then
PATH=/usr/local/sbin:$PATH
fi
if ! echo $PATH | /bin/grep -q "/usr/X11R6/bin" ; then
PATH="$PATH:/usr/X11R6/bin"
fi
# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
USER=`id -un`
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -r $i ]; then
. $i
fi
done
unset i
JAVA_HOME=/usr/
java/j2sdk1.4.2_05
export JAVA_HOME
[b:e6cc489b14]CATALINA_HOME=/opt/software/jakarta-tomcat-5.0.18
export CATALINA_HOME[/b:e6cc489b14]
"/etc/profile" 52L, 1077C written
[b:e6cc489b14][size=18:e6cc489b14]3 检验环境变量[/size:e6cc489b14][/b:e6cc489b14]
[root@localhost software]# [b:e6cc489b14]echo $CATALINA_HOME[/b:e6cc489b14]
/opt/software/jakarta-tomcat-5.0.18
[b:e6cc489b14][size=14:e6cc489b14]注:如果得到的是空行,请重新登录linux,再试一次。[/size:e6cc489b14][/b:e6cc489b14]
[root@localhost software]# [b:e6cc489b14]ls[/b:e6cc489b14]
j2sdk-1_4_2_05-linux-i586.rpm jakarta-tomcat-5.0.18.tar.gz
jakarta-tomcat-5.0.18
[b:e6cc489b14][size=18:e6cc489b14]4 启动TOMCAT[/size:e6cc489b14][/b:e6cc489b14]
[root@localhost software]# [b:e6cc489b14]cd jakarta-tomcat-5.0.18[/b:e6cc489b14]
[root@localhost jakarta-tomcat-5.0.18]# [b:e6cc489b14]ls[/b:e6cc489b14]
bin conf logs RUNNING.txt shared webapps
common LICENSE RELEASE-NOTES server temp work
[root@localhost jakarta-tomcat-5.0.18]# [b:e6cc489b14]cd bin[/b:e6cc489b14]
[root@localhost bin]# [b:e6cc489b14]ls[/b:e6cc489b14]
bootstrap.jar setclasspath.sh
catalina.bat shutdown.bat
catalina.sh shutdown.sh
catalina.xml shutdown-using-launcher.bat
commons-daemon.jar shutdown-using-launcher.sh
commons-launcher.jar startup.bat
commons-logging-api.jar startup.sh
cpappend.bat startup-using-launcher.bat
digest.bat startup-using-launcher.sh
digest.sh tomcat.exe
jsvc.tar.gz tomcatw.exe
LauncherBootstrap.class tool-wrapper.bat
launcher.properties tool-wrapper.sh
service.bat tool-wrapper-using-launcher.bat
setclasspath.bat tool-wrapper-using-launcher.sh
[root@localhost bin]# [b:e6cc489b14]sh startup.sh[/b:e6cc489b14]
Using CATALINA_BASE: /opt/software/jakarta-tomcat-5.0.18
Using CATALINA_HOME: /opt/software/jakarta-tomcat-5.0.18
Using CATALINA_TMPDIR: /opt/software/jakarta-tomcat-5.0.18/temp
Using JAVA_HOME: /usr/java/j2sdk1.4.2_05
[b:e6cc489b14][size=18:e6cc489b14]5 打开自己的浏览器进行测试[/size:e6cc489b14]http://localhost:8080[/b:e6cc489b14]
[b:e6cc489b14][size=14:e6cc489b14]备注①:[/size:e6cc489b14][/b:e6cc489b14]
如果感觉jakarta-tomcat-5.0.18太繁琐,可以创建一个连接目录,并命名为TOMCAT。
root@localhost software]# [b:e6cc489b14]ln -s jakarta-tomcat-5.0.18 tomcat[/b:e6cc489b14]
[root@localhost software]#[b:e6cc489b14] ls[/b:e6cc489b14]
j2sdk-1_4_2_05-linux-i586.rpm jakarta-tomcat-5.0.18.tar.gz
jakarta-tomcat-5.0.18 tomcat
[/img]
yuipr 回复于:2004-09-25 14:36:30
|
太罗嗦了吧.列那么多东西唬人啊
|
yuipr 回复于:2004-09-25 14:42:07
|
1\解压
cd /opt/software
tar -zxvf jakarta-tomcat-5.0.18.tar.gz
ln -s /opt/software/jakarta-tomcat-5.0.18 tomcat
2 设置TOMCAT环境变量
在/etc/profile中加入
JAVA_HOME=/usr/java/j2sdk1.4.2_05
export JAVA_HOME
CATALINA_HOME=/opt/software/jakarta-tomcat-5.0.18
export CATALINA_HOME
3\启动测试
/opt/software/bin/startup.sh
测试http://localhost:8080
|
骑墙男人 回复于:2004-09-26 21:58:20
|
本贴专对入门者,并且会有一些解释.
|
我菜我怕谁 回复于:2004-09-27 09:02:25
|
支持
|
seacaptain 回复于:2004-09-28 15:05:47
|
都是命令输出什么地方有注释啊。反而看不明白了
|
hqagg 回复于:2004-09-29 08:50:06
|
绝对支持!
|
lc1111 回复于:2004-09-30 09:37:36
|
请问去那下载安装包
|
lc1111 回复于:2004-09-30 09:38:26
|
如有能给我发一个么?多谢我的邮箱lichao0312@exavio.com.cn
|
zujuhu 回复于:2004-10-03 10:34:23
|
you could write an article about "how to configure TOMACT" .
|
legumer 回复于:2004-11-16 13:09:16
|
为什么我启动之后没有监听端口8080呢?这是为什么?
|
xfox1 回复于:2004-11-16 22:55:10
|
环境变量没有设置正确。楼主没有把整合后的步骤发上来,那可不是5步的问题了。
|
原文转自:http://www.ltesting.net