天天看點

Linux下Tomcat安裝與啟動

從官網 www.apache.org 下載下傳Tomcat 的相應Linux下的版本,本文以tomcat-5.5.33為例。

1) 解壓成檔案夾,視具體的檔案格式而定。

2)  $ vi /etc/profile                         #用vi編輯器打開該檔案進行編輯(添加環境變量)

      然後在檔案的最尾部加入以下代碼:

      CATALINA_HOME=/tools/apache-tomcat-5.5.33                             #(tomcat版本視自己的安裝版本而定 )

      export CATALINA _HOME                       

      儲存退出.

3) 現在在終端運作指令: 

     $ /tools/tomcat*/bin/startup.sh             #開啟TOMCAT伺服器     

     然後打開浏覽器,輸入http://localhost:8080或者 http://127.0.0.1:8080 如果你看到那隻可愛的小貓了,就證明安裝成功了!

備注:安裝過程中遇到幾個問題

問題1 : can't find the file 'setclasspath.sh'

在網絡上找到如下解釋,意思就是需要再設定

Then all you need to do is to include the complete paths for the BASEDIR and CATALINA_HOME variables in the files setclasspath.sh and catalina.sh respectively.

This should be done even if CATALINA_HOME has been defined and exported previously on the command line and/or in /etc/profile as well. Moreover, this error message persists even though the file setclasspath.sh is present in Tomcat's bin directory.

繼續閱讀