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

2024-01-08 21:38
文章标签 安装 界面 mac tomcat 管理 osx

本文主要是介绍Mac OSX 上安装 Tomcat 7 及管理界面,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Installing Tomcat 7 on MacOSX

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.

这篇关于Mac OSX 上安装 Tomcat 7 及管理界面的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/584906

相关文章

最详细安装 PostgreSQL方法及常见问题解决

《最详细安装PostgreSQL方法及常见问题解决》:本文主要介绍最详细安装PostgreSQL方法及常见问题解决,介绍了在Windows系统上安装PostgreSQL及Linux系统上安装Po... 目录一、在 Windows 系统上安装 PostgreSQL1. 下载 PostgreSQL 安装包2.

Maven如何手动安装依赖到本地仓库

《Maven如何手动安装依赖到本地仓库》:本文主要介绍Maven如何手动安装依赖到本地仓库问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、下载依赖二、安装 JAR 文件到本地仓库三、验证安装四、在项目中使用该依赖1、注意事项2、额外提示总结一、下载依赖登

SpringBoot内嵌Tomcat临时目录问题及解决

《SpringBoot内嵌Tomcat临时目录问题及解决》:本文主要介绍SpringBoot内嵌Tomcat临时目录问题及解决,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录SprinjavascriptgBoot内嵌Tomcat临时目录问题1.背景2.方案3.代码中配置t

HTML5中的Microdata与历史记录管理详解

《HTML5中的Microdata与历史记录管理详解》Microdata作为HTML5新增的一个特性,它允许开发者在HTML文档中添加更多的语义信息,以便于搜索引擎和浏览器更好地理解页面内容,本文将探... 目录html5中的Mijscrodata与历史记录管理背景简介html5中的Microdata使用M

Spring 基于XML配置 bean管理 Bean-IOC的方法

《Spring基于XML配置bean管理Bean-IOC的方法》:本文主要介绍Spring基于XML配置bean管理Bean-IOC的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一... 目录一. spring学习的核心内容二. 基于 XML 配置 bean1. 通过类型来获取 bean2. 通过

如何在Mac上安装并配置JDK环境变量详细步骤

《如何在Mac上安装并配置JDK环境变量详细步骤》:本文主要介绍如何在Mac上安装并配置JDK环境变量详细步骤,包括下载JDK、安装JDK、配置环境变量、验证JDK配置以及可选地设置PowerSh... 目录步骤 1:下载JDK步骤 2:安装JDK步骤 3:配置环境变量1. 编辑~/.zshrc(对于zsh

python uv包管理小结

《pythonuv包管理小结》uv是一个高性能的Python包管理工具,它不仅能够高效地处理包管理和依赖解析,还提供了对Python版本管理的支持,本文主要介绍了pythonuv包管理小结,具有一... 目录安装 uv使用 uv 管理 python 版本安装指定版本的 Python查看已安装的 Python

如何在pycharm安装torch包

《如何在pycharm安装torch包》:本文主要介绍如何在pycharm安装torch包方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录在pycharm安装torch包适http://www.chinasem.cn配于我电脑的指令为适用的torch包为总结在p

在PyCharm中安装PyTorch、torchvision和OpenCV详解

《在PyCharm中安装PyTorch、torchvision和OpenCV详解》:本文主要介绍在PyCharm中安装PyTorch、torchvision和OpenCV方式,具有很好的参考价值,... 目录PyCharm安装PyTorch、torchvision和OpenCV安装python安装PyTor

Python Transformer 库安装配置及使用方法

《PythonTransformer库安装配置及使用方法》HuggingFaceTransformers是自然语言处理(NLP)领域最流行的开源库之一,支持基于Transformer架构的预训练模... 目录python 中的 Transformer 库及使用方法一、库的概述二、安装与配置三、基础使用:Pi