现在最新版本为tomcat6.0.18,地址为:http://dev.xiaonei.com/apache-mirror/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz
tomcat的启动需要java的支持,请确保已经设置JAVA环境变量
在终端中进入解压后的bin目录下,./startup.sh启动tomcat,./shutdown.sh关闭tomcat。
当看到类似以下输出时,你已经成功启动tomcat了:
lym@lym-laptop:~/System/ubuntu/software/apache-tomcat-6.0.18/bin$ ./startup.sh
Using CATALINA_BASE: /home/lym/System/ubuntu/software/apache-tomcat-6.0.18
Using CATALINA_HOME: /home/lym/System/ubuntu/software/apache-tomcat-6.0.18
Using CATALINA_TMPDIR: /home/lym/System/ubuntu/software/apache-tomcat-6.0.18/temp
Using JRE_HOME: /usr/lib/jvm/java-6-sun
如果你没有配置JAVA环境变量,你会看到如下的错误信息:
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
tomcat启动成功后,就可以访问http://localhost:8080来检测tomcat是否成功启动了。
注:tomcat默认端口是8080,端口号可以在config目录的server.xml中进行更改,但要注意,在Linux中1000以内的端口号必须需要root权限,使用时要加sudo命令,1000以外的OK,所以想要在类似eclipse的IDE中用tomcat的话还是设置在1000以外为宜。
最新评论