实践补充 Installing Tomcat 7.0.x on OS X
我的 Mac 下是1.6的 SDK,下载 Tomcat 8.0 执行后,訪问 http://127.0.0.1:8080 并无反应,并且关闭脚本会报错 :
Unsupported major.minor version 51.0
看来安装 Tomcat 8.0 须要至少 JDK 1.7 或 JDK 1.8 才行,只是我的 Mac 上没有提示。我也就不更新了。
故又一次下载 Tomcat 6.0 ,按例如以下操作。一切正常。并能正常訪问 8080 port打开页面。
再次下载 Tomcat 7.0 ,按例如以下操作反复,一切正常,并能正常訪问 8080 port打开页面。
只是有一点,须要注意,就是 link 生成的 /Library/Tomcat 须要先 unlink:
sudo unlink /Library/Tomcat
1、mv 下载并解压出来的Tomcat文件夹 /usr/local
这一步,我是先输入个 mv,然后从 Finder 中把文件夹拖到 console 中,自己主动显示路径串,然后再输入 /L 然后按 Tab 键自己主动补齐 Library ,假设你的文件夹中存在多个 L 开头的文件或文件夹,那就再多输几个字符,确保唯一就能够自己主动补全了。再输入 /T 。继续按 Tab 键自己主动补全
2、sudo unlink /Library/Tomcat
取消之前安装时创建的 /Library/Tomcat 链接
3、sudo ln -s /usr/local/apache-tomcat-7.0.56/ /Library/Tomcat
4、sudo chown -R 当前用户 /Library/Tomcat
5、sudo chmod +x /Library/Tomcat/bin/*.sh
将 Tomcat 文件夹下的 .sh 脚本改动为可执行
6、/Library/Tomcat/bin/startup.sh
启动 Tomcat ,当前链接到哪个版本号的 Tomcat 。启动的就是哪个版本号的 Tomcat
7、http://127.0.0.1:8080
使用浏览器打开这个地址port。能正常显示 Tomcat 的欢迎页面。就表示布署 Tomcat 成功
8、/Library/Tomcat/bin/shutdown.sh
关闭 Tomcat 服务
9、下载并安装 Tomcat Controller。UI 启停 Tomcat
注意。默认的 Tomcat Home Directory 是指向 /usr/local/tomcat,能够在这里更改成特定版本号的 Tomcat。也能够按下图指定。然后通过上面的链接来更改当前的 Tomcat 版本号。
感觉前者更方便些。也免于创建链接了。
Tomcat 6.0 下载链接:http://mirrors.hust.edu.cn/apache/tomcat/tomcat-6/v6.0.43/bin/apache-tomcat-6.0.43.zip (2015-02-10 更新)
Tomcat 7.0 下载链接:http://mirrors.hust.edu.cn/apache/tomcat/tomcat-7/v7.0.59/bin/apache-tomcat-7.0.59.zip (2015-02-10 更新)
Tomcat 8.0 下载链接:http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.0.18/bin/apache-tomcat-8.0.18.zip
Tomcat Controller 下载链接:http://www.activata.co.uk/downloads_files/TomcatController_1_2.dmg.zip
接下来,研究 Spring Mvc 框架,以及 mybatis 操作 mysql 数据库,并由 Spring 管理数据库连接事务。
逐步研究步骤:
1、Spring Mvc 框架 + SQLHelper 读写 mysql 数据库;
据说 Spring Mvc 要比 Structs2 效率高一些,并且如今在招聘站点上搜相似的招聘。基本都是 Spring 的 Mvc 框架,
别理解错了。上招聘站点一不是为找工作。二不是为招人。招聘站点是技术走向的风向标。在一段时间内的统计结果。非常有代表性。
2、mybatis 操作 mysql
3、Spring 管控 mybatis 数据库连接池
4、三者整合研究
同一样技术,不同的人有不同的研究过程和理解。但结果都是一样的,能把它们用起来。
不一定真正用得到。但至少能知道别人做得对不正确,问题出在哪儿。这就够了。
_____________________________________________________
Installing Tomcat 7.0.x on OS X
by Wolf Paulus | Dec 14, 2013 | Mac OS X | 281 comments
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
sudo is a program for Unix-like operating systems, allowing you to run programs with the security privileges of another user (normally the superuser, or root). Since we are creating directories, outside of your home folder, administrator right are required. I.e., when executing sudo you will be asked to enter your password; and your Mac User account needs to be an ‘Admin’ account.
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
.entry-content You can start editing here.
实践补充 Installing Tomcat 7.0.x on OS X的更多相关文章
- Linux Tomcat 6.0安装配置实践总结
系统环境: Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64位 Tomcat下载 从官方网站 http://tomcat.apache ...
- 【Tomcat 6.0官方文档翻译】—— 简介
Tomcat作为使用最多的web容器,研究其原理过程,对掌握java web开发有很重要的影响. 因此下定决心,从官方文档入手,好好学学web相关的知识. 介绍 本篇是Apache Tomca ...
- Tomcat 8.0的并发优化 - 优化server.xml的配置
目录 1 Tomcat的3种运行模式 1.1 BIO - 同步阻塞IO模式 1.2 NIO - 同步非阻塞IO模式 1.3 APR - 可移植运行时模式 2 Tomcat的并发配置(配置Connect ...
- Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds
错误:Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds 错误提示就是我们限定了部署的时间导致的错 ...
- Could not publish server configuration for Tomcat v6.0 Server at localhost.
经常在使用tomcat服务器的时候 总会发生一些莫名其妙的错误. 就像下面这个错误: 在配置文件中存在多个/MyWeb的配置,导致不能发布服务. 错误信息: Could not publish ser ...
- Server Tomcat v7.0 Server at localhost was unable to&nbs 报错问题解决
在eclipse启动tomcat时遇到超时45秒的问题: Server Tomcat v7.0 Server at localhost was unable to start within 45 se ...
- Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds...
仰天长啸 Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds... 当启动tomcat时候出现 ...
- Tomcat 7.0的配置
一.安装JDK 1.7 1.添加环境变量:在我的电脑->属性->高级->环境变量 2.新建系统变量,变量名:JAVA_HOME 变量值:C:\Program Fi ...
- Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds -----》myeclipse2015
错误:Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds 错误提示就是我们限定了部署的时间导致的错 ...
随机推荐
- HDU 2732 Leapin' Lizards(拆点+最大流)
HDU 2732 Leapin' Lizards 题目链接 题意:有一些蜥蜴在一个迷宫里面,有一个跳跃力表示能跳到多远的柱子,然后每根柱子最多被跳一定次数,求这些蜥蜴还有多少是不管怎样都逃不出来的. ...
- TeamTalk Android代码分析(业务流程篇)---消息发送和接收的整体逻辑说明
第一次纪录东西,也没有特别的顺序,想到哪里就随手画了一下,后续会继续整理- 6.2消息页面动作流程 6.2.1 消息页面初始化的总体思路 1.页面数据的填充更新直接由页面主线程从本地数据库请求 2.数 ...
- BZOJ4031——HEOI小z的房间
题意:求某网格图生成树个数,对1e9取模 题解:题目是裸的Matrix-Tree定理,这不是我要说的重点,重点是对于这个取模的处理. 由于这不是个质数,所以不能直接乘逆元来当除法用.直接高斯消元肯定是 ...
- OpenCV+海康威视摄像头的实时读取
OpenCV+海康威视摄像头的实时读取 本文由 @lonelyrains出品.转载请注明出处. 文章链接: http://blog.csdn.net/lonelyrains/article/detai ...
- Java中的作用域有哪些
在Java语言中,变量的类型主要有3种:成员变量.静态变量和局部变量 首先说静态变量跟局部变量 静态变量不依赖于特定的实例,而是被所有实例共享,也就是说,只要一个类被加载,JVM就会给类的静态变量分配 ...
- Ubuntu下推荐安装软件
前言:都是全平台软件,通用性好. 1.搜狗输入法 官网下载: 不能双击.deb安装成功,需要安装依赖,可参考:https://www.cnblogs.com/chendeqiang/p/1017741 ...
- js判断传入时间和当前时间大小
//判断时间是否过期 function judgeTime(time){ var strtime = time.replace("/-/g", "/");//时 ...
- Python写99乘法表
#!/usr/bin/python# -*- encoding:utf-8 -*- for i in range(1,10): s='' for j in range(1,i+1): ...
- 解决JSP页面中文乱码插入到数据库的问题
在JSP页面使用表单注册一个用户名的时候,查看到数据库里面的表中文显示乱码的情况有两种: 1.JSP页面传进来的参数中文就是乱码,则是前台的问题,这个时候写一个过滤器就好了,可以写如下的一个过滤器 p ...
- hdu 3416 Marriage Match IV 【 最短路 最大流 】
求边不可重复的最短路条数 先从起点到终点用一次dijkstra,再从终点到起点用一次dijkstra,来判断一条边是否在最短路上 如果在,就将这条边的两个端点连起来,容量为1 再跑一下dinic(), ...