Mac OS X 系统安装 Tomcat 7.0.x 简明教程
来源:互联网 发布:php框架怎么用 编辑:程序博客网 时间:2024/05/01 07:27
Installing Tomcat 7.0.x on OS X
While Tomcat 8 is close to be released (Tomcat 8.0.0-RC5 (alpha) is released already), Tomcat 7 was the first Apache Tomcat release to support the Servlet 3.0, JSP 2.2, and EL 2.2 specifications. Please note that Tomcat 7 requires Java 1.6 or better, which shouldn’t be a problem, if you are running OS X 10.5 or 10.6.
On OS X 10.7, 10.8 (Mnt Lion), and 10.9 (Mavericks) however, Java is not installed anymore, at least not initially. The easiest way to get Java onto your Mac is probably to open the Terminal app and enter java. You will be asked if you want to install it and OS X takes care of the rest – you would end up with Java 6.
Prerequisite: Java
On 10.9 (Mavericks), Apple changed this once again, now sending you to Oracle’s Java SE web page, where you can download the JDK, (currently 7 jdk-7u45-macosx-x64.dmg). While at Oracle, I usually also download the Java SE Development Kit 7 Documentation, allowing me to stay away from their site for many months.
The JDK installer package come in an dmg and installs easily on the Mac; and after opening the Terminal app again,
java -version
now shows something like this:
java version "1.7.0_45"Java(TM) SE Runtime Environment (build 1.7.0_45-b18)Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Whatever you do, when opening Terminal and running java -version, you should see something like this, with a version of at least 1.6.x
Installing Tomcat
Here are the easy to follow steps to get it up and running on your Mac
- Download a binary distribution of the core module: apache-tomcat-7.0.47.tar.gz from here. I picked the tar.gz in Binary Distributions / Core section.
- Opening/unarchiving the archive will create a folder structure in your Downloads folder: (btw, this free Unarchiver app is perfect for all kinds of compressed files and superior to the built-in Archive Utility.app)
~/Downloads/apache-tomcat-7.0.47 - Open to Terminal app to move the unarchived distribution to /usr/local
sudo mkdir -p /usr/local
sudo mv ~/Downloads/apache-tomcat-7.0.47 /usr/local
- To make it easy to replace this release with future releases, we are going to create a symbolic link that we are going to use when referring to Tomcat (after removing the old link, you might have from installing a previous version):
sudo rm -f /Library/Tomcat
sudo ln -s /usr/local/apache-tomcat-7.0.47 /Library/Tomcat - Change ownership of the /Library/Tomcat folder hierarchy:
sudo chown -R <your_username> /Library/Tomcat
- Make all scripts executable:
sudo chmod +x /Library/Tomcat/bin/*.sh
Instead of using the start and stop scripts, like so:Last login: Sun Aug 14 15:20:38 on ttys000
wpbookpro:~ wolf$ /Library/Tomcat/bin/startup.sh
Using CATALINA_BASE: /Library/Tomcat
Using CATALINA_HOME: /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME: /Library/Java/Home
Using CLASSPATH: /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
wpbookpro:~ wolf$ /Library/Tomcat/bin/shutdown.sh
Using CATALINA_BASE: /Library/Tomcat
Using CATALINA_HOME: /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME: /Library/Java/Home
Using CLASSPATH: /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
wpbookpro:~ wolf$
you may also want to check out Activata’s Tomcat Controller, a tiny freeware app, providing a UI to quickly start/stop Tomcat. It may not say so, but Tomcat Controller works on OS X 10.8 and 10.9 just fine.
Finally, after your started Tomcat, open your Mac’s Web browser and take a look at the default page:http://localhost:8080
- Mac OS X 系统安装 Tomcat 7.0.x 简明教程
- Git简明教程 Mac OS X
- mac OS X 安装Tomcat
- MAC OS X系统安装.
- 在MAC os x系统中安装Tomcat
- portaudio 安装教程(mac OS X系统 + Xcode)
- 苹果MAC OS X双系统安装教程
- 【git】Mac OS X Git安装教程
- Mac OS X Git安装教程
- Mac OS X Git安装教程
- VMwareworkstation 11安装 mac os x教程
- Mac OS X Git安装教程
- Mac OS X Git安装教程
- MAC OS X LION 系统下 TOMCAT 7X 安装与配置说明
- MAC OS X系统
- ADM CPU安装mac os x系统
- VirtualBox下安装Mac OS X系统
- Mac OS X 10.11+系统 安装CocoaPods
- 怎么计算两个日期之间相差几天及时几分
- 插入排序java
- cf 240 div2
- 阶乘的0(nyoj 84)
- MFC对话框添加菜单、状态栏,并在状态栏显示菜单提示信息
- Mac OS X 系统安装 Tomcat 7.0.x 简明教程
- android 中使用gles基础
- Java synchronized详解
- 价目表价格分段测试
- Ogre教程框架
- 第三章:文件I/O
- Lucene 学习笔记 01 —— Lucene 的使用简介和开发步骤
- poj2155(树状数组)
- java 集合类