Installing Tomcat on Mac OS X

本文提供了一步一步的指导,教你如何在MacOSX上下载并安装Apache Tomcat 5.5。包括配置环境变量、启动及停止Tomcat服务的方法,以及如何验证安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

To get Tomcat, visit the following link: http://tomcat.apache.org/. Once there, click on the Tomcat 5.5 link under the Download heading. Under Core, select the tar.gz file.

Download the tar.gz file. Mac OS X will probably extract the file to a .tar file in your downloads directory. Move this .tar file to a location on your computer where you would like tomcat. For purposes of this guide, the location will be /Users/user. Double-click the tar to extract it. This should create a directory in /Users/user named something like apache-tomcat . . . Rename this to something simple like tomcat. At this point, you should have the following directory on your machine:

/Users/user/tomcat

There is a file called startup.sh located in the the /Users/user/tomcat/bin directory that needs edited. Open EditRocket and open startup.sh Add the following two lines after the line in startup.sh that starts with EXECUATBLE. Note that for Snow Leopard, you can use 1.6 instead of 1.5 after the Versions text in the first line listed below.

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
export CATALINA_HOME=/Users/user/tomcat

To start Tomcat, open up a Terminal window (Applications -> Utilities -> Terminal). cd to the tomcat bin directory by typing the following:

cd /Users/user/tomcat/bin

Type the following:

sh startup.sh

This will start Tomcat. To shutdown tomcat, type sh shutdown.sh

To test the tomcat installation, enter the following in your web browser:

http://localhost:8080/

If the apache tomcat page shows up, the installation was successful.

There is a sample web application called jsp-examples located in the webapps directory under the tomcat installation directory. This location can be used to test your own JSP pages, or you can use the files contained in this directory as a template for creating your own web application.

The jsp-examples can be accessed in your web browser using the following URL: http://localhost:8080/jsp-examples/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值