Mac OSX 上安装 Tomcat 7 及管理界面

Installing Tomcat 7 on MacOSX

July
30, 2012
CodingTechnology

I’ve made the switch over to Apple on my development machines and as I’m starting my new company soon I’ve got myself a new MacBook Pro machine of which I will be transporting to and from the office so I’ve been
installing my entire development on it and thought I’d blog about how to set-up Tomcat 7 on MacOSX to use as a development environment… It’s rather straight forward but thought I’d post it up anyway to help others!

Tomcat 7 is the first release of Tomcat to support the Servlet 3.0, EL 2.2 and JSP 2.2 specifications.

Tomcat 7 requires Java 1.6 to be installed on your Apple Mac based computer, if your running Leopard (10.5) or Snow Leopard (10.6) you are good to go already as these versions of OSX comes pre-installed with Java,
however users of OSX Lion (10.7) and more than likely Mountain Lion (10.8) will need to enable Java of which I’ll now explain how to do so, if your not using Lion or Mountain Lion you can skips to the main install notes now!

Enabling Java on OSX Lion and OSX Mountain Lion

You can enable and install Java on Lion and Mountain Lion using the following guide: http://helpx.adobe.com/x-productkb/global/install-java-jre-mac-os.html

You can also check (to be on the safe side) your version of Java that you have installed on your machine by running the following command from the terminal:-

java -version

Installing Tomcat 7 on your Mac

1) First step is to download Tomcat from the Apache Tomcat website or which can be found here: http://tomcat.apache.org/download-70.cgi,
Scroll down to the ‘Binary distrubutions’ section and download the ‘.tar.gz’ file. At the time of writing the version I downloaded and installed was 7.0.29

2) Opening or un-archiving the download will now create a new folder – more than likely this will be in your downloads folder unless you choose a different folder to download the file to.

3) Our next step is to ‘move’ the extracted folder to a system location of which we will run Tomcat from, we do this like so (obviously change your version number/download directory to suite your requirements):-

sudo mkdir /usr/local
sudo mv ~/Downloads/apache-tomcat-7.0.29  /usr/local

To make it easy to switch and upgrade Tomcat versions in future we’ll use a symbolic link to alias the tomcat folder, we do this like so:-

sudo ln -s /usr/local/apache-tomcat-7.0.29  /Library/Tomcat

We now need to change the ownership of the /Library/Tomcat folder:-

sudo chown -R <your OSX username>  /Library/Tomcat

We now need to set all the scripts under ‘/Library/Tomcat/bin’ to executable, we do this like so:-

sudo chmod +x /Library/Tomcat/apache-tomcat-7.0.29/bin/*.sh

You’ve done  it! – You can start Tomcat manually by running:-

/Library/Tomcat/bin/startup.sh

You can stop it by running:-

/Library/Tomcat/bin/shutdown.sh

Tomcat is now installed and working, you should be able to access it on your machine using this URL: http://localhost:8080/

A handy little GUI tool to start and stop Tomcat

In a development environment, instead of having to open up the console each time, I have found a handy little tool that allows you to easily Stop, Start and open up the Tomcat enviroment… Its called ‘Tomcat Controller’
and can be downloaded from here: http://www.activata.co.uk/tomcatcontroller/

It provides a nice interface as shown below:-

  

You will however need to open up the ‘Preferences’ and change the Tomcat location to match your new set-up.

时间: 2024-11-02 08:59:30

Mac OSX 上安装 Tomcat 7 及管理界面的相关文章

《Hadoop实战第2版》——2.2节在Mac OSX上安装与配置Hadoop

2.2 在Mac OSX上安装与配置Hadoop 由于现在越来越多的人使用Mac Book,故笔者在本章中增加了在Mac OS X上安装与配置Hadoop的内容,供使用Mac Book的读者参考. 2.2.1 安装Homebrew Mac OS X上的Homebrew是类似于Ubuntu下apt的一种软件包管理器,利用它可以自动下载和安装软件包,安装Homebrew之后,就可以使用Homebrew自动下载安装Hadoop.安装Homebrew的步骤如下: 1)从Apple官方下载并安装内置GCC

在Mac OSX上安装与配置Hadoop

在Mac OSX上 安装与配置Hadoop 博客分类: Hadoop hadoopbrewxcodegccosx&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 由于现在越来越多的人使用Mac Book,故笔者在本章中增加了在Mac OS X上安装与配置Hadoop的内容,供使用Mac Book的读者参考. 2.2.1 安装Homebrew Mac OS X上的Homebrew是类似于 Ubuntu下apt的一种

在Mac OS上安装Tomcat服务器的教程_java

对于Apache Tomcat 估计很多童鞋都会,那么今天就简单说下在mac上进行tomcat的安装:    第一步:下载Tomcat      这里Himi下载的tomcat version:7.0.27 直接上下载地址:http://tomcat.apache.org/download-70.cgi 直接下载如下选中即可: 第二步:   下载完成后 ,然后随意放目录吧,这里Himi放入    /usr/local/ 右键你的mac的Finder->前往文件夹->/usr/local  将刚

Mac OS上安装Tomcat服务器的简单步骤_java

一. 下载tomcat 首先要到tomcat官网去下载安装包,官网下载地址如下:http://tomcat.apache.org/download-70.cgi , 注意请下载飞windows版本.和windows操作系统不一样,这个里面没有令人厌烦的注册表. 将压缩包解压到任意一个目录,我这里是存放到/ProgramFile/tomcat 目录下面   二. 修改授权 tomcat中的几个运行服务程序都是以*.sh结尾的,在运行之前需要授权.打开终端输入如下命令: 输入如下命令: sudo c

如何在Mac OS上安装pytest、setuptools、wget

本文主要介绍如何在Mac OS上安装pytest,以自己实际安装为例. 同时补充介绍了Mac OS上安装setuptools和Mac OS上安装wget的方法 Mac OS上安装pytest 由于Mac OS上自带python2.7,已是目标版本,不需要更新了,在此基础上介绍安装pytest的主要步骤: 安装pip,在终端中输入: sudo easy_install pip 接着安装pytest: sudo pip install -U pytest 测试是否安装成功: py.test --ve

《Python入门经典》——1.3 在Mac OS上安装Python

1.3 在Mac OS上安装Python 在本节,将介绍在Mac OS上安装Python的方法,并安装一个文本编辑器. 1.3.1 安装Python 如果你使用的是Mac OS计算机,那你已经安装了Python了!不需要再下载任何额外的东西.但是较早的Mac OS版本上的Python类型可能有一些细微差异,但这些差异不会影响本书中所有的操作. 1.3.2 运行Python 无论什么时候要运行Python Shell,都需要启动IDLE.有时需要你运行一个文件. 在这种情况下,启动IDLE并打开文

mac 系统上安装lua后 lua:commond not found 求救

问题描述 mac 系统上安装lua后 lua:commond not found 求救 TazideMacBook-Pro:~ aqzre$ cd lua-5.3.1 TazideMacBook-Pro:lua-5.3.1 aqzre$ make macosx test cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make macosx /Applications/Xcode.app/Contents/Devel

mac mysql-Mac上安装MySQL之后,连接测试报错

问题描述 Mac上安装MySQL之后,连接测试报错 不能连接到127.0.0.1(61)求教怎么解决.昨天弄了一宿都没弄好,不知道该怎么配置.求教大神. 解决方案 http://blog.sina.cn/dpool/blog/s/blog_9ea3a4b70101ihl3.html? 解决方案二: phpMyAdmim和Yii 连接Mysql报错.MySql连接报错1045 解决方案三: 楼主解决了么?我也是这个问题,用桌面客户端连接不行,换了2个了,都是这样..用终端我试过是可以创库创表的

在Mac OS上安装Vagrant和Docker的教程_Redis

当听到很多人在说Docker是多么多么的棒,很多新潮的孩子都在使用它时,我决定在我的开发环境上也来尝试下.在下面的这篇文章中,我将讲解在Mac OS X怎样建立Postgres,Elasticsearch和Redis. 什么是Docker Docker用轻量容器把一个APP从它运行的OS中隔离开.它把APP放入到一个孤立的盒子中,对外只呈现需要使用的文件夹和端口. 这样,基于建立和使用APP的容器是可重用,共享的.目前,在Docker集中已经存在了15,000种以上的容器.Docker就像一个商