brew install tomcat

I recently installed Tomcat 7 and got it working with Eclipse Helios on Mac OSX Lion.
Install Homebrew: 
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
Install Tomcat: 
sudo brew install tomcat
Test the Tomcat install by starting the server: 
sudo catalina start
Set it so that you can start it without using sudo: 
sudo chgrp -R your_user_name
sudo chmod -R g+rw /usr/local/Cellar/tomcat/
Stop the Tomcat server (if you have not already): 
sudo catalina stop
Test the change to the file permissions for Tomcat by starting the server as yourself without sudo: 
catalina startca
Stop the Tomcat server (we want Eclipse to do the starting and stopping): 
catalina stop
In Eclipse, open the 'Servers' view and add a new Tomcat server. Key point is to make sure to change the name of the server so that it does not contain any spaces! If you don't have a 'Servers' view, you need to go download 'Eclipse IDE for Java EE Developers'.
All done! You should now be able to start and stop Tomcat from Eclipse. :)


首先保证brew命令能够正常使用;
1. 搜索tomcat是否存在:

brew search tomcat

2. 安装tomcat:
brew install tomcat
3. 检查是否安装成功:
catalina -h
4. 运行tomcat:
catalina run
Tomcat的默认端口是8080,如果运行成功可通过http://localhost:8080访问

webapp的根目录(CATALINA_HOME)为:/usr/local/Cellar/tomcat/7.0.33/libexec/webapps/ROOT/



附:

Mac OSX软件包管理工具brew怎么安装?应该有很多朋友有用到这个brew工具,那么这个工具如何安装及下载的呢?

brew 又叫Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件, 只需要一个命令, 非常方便,brew类似ubuntu系统下的apt-get的功能。

 

  brew安装方法

  brew 的官方网站对brew的用法进行了详细的描述安装方法:

   在Mac中打开Termal: 输入命令:

  ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

    brew list 列出已安装的软件


  brew update 更新brew


  brew home 用浏览器打开brew的官方网站


  brew info 显示软件信息


  brew deps 显示包依赖
  
  brew search /wge*/


  /wge*/是个正则表达式, 需要包含在/中
  
  brew install wget


  使用brew卸载软件,卸载更方便了


  brew uninstall wget
  
   brew install git

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值