Mac 上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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM