Tomcat 在Win7下使用

首先得要有tomcat,到tomcat官網下載最新版,這裡下載的是tomcat 7 的64-bit Windows zip (pgp, md5),因為我的環境是Win7 64bit,JAVA 64bit,所以當然使用64bit tomcat的ZIP(免安裝)。

把壓縮檔解壓縮得到一個apache-tomcat-7.0.21目錄,暫時隨便你放在哪都行,免安裝就是要有強大的可攜性(除非必要不使用絕對路徑),再到目錄下的bin子目錄執行startup.bat,如果無法順利執行或告訴你找不到JAVA_HOME那就編輯 startup.bat 裡加上 set "JAVA_HOME=C:\Program Files\Java\jre6" 這一句指定JAVA的所在目錄(這就是不得已的絕對路徑),再一次執行 startup.bat 就會看到執行畫面。


Tomcat 目錄架構

  • bin          Tomcat程式相關指令
  • conf         Tomcat設定檔
  • lib           Tomcat  jar函式庫
  • logs         日誌檔
  • temp        存放暫存檔
  • webapps   網頁程式存放目錄
  • work         存放編譯好的Servlet


打開瀏覽器 就可以看到網頁顯示,而顯示的內容來自 webapps\ROOT ,如果要看他自帶的的範例則在網址後加上 examples 就會看到 webapps\examples 的內容。

重點是要在網頁上管理tomcat就要輸入 結果是要你輸入帳號密碼,但不管輸入啥咪都沒用也沒任何提示,此時就要到 conf 子目錄下去編輯 tomcat-users.xml 擋案,在 <tomcat-users> 節點裡加上以下設定:

  <role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>



1 則留言:

匿名 提到...

The reviewers are dedicated to providing the readers with accurate and timely info. The details talked about in this evaluation could also be} subject to alter as casinos seek to enhance their websites to offer their patrons a better gambling expertise. If you ever get tired of spinning the 메리트카지노 reels, Bovada also hosts one of the best bonus code selections for sports betting online. Wild Casino has been within the business for fairly a while and currently stands out with a number of the} highest RTP slot video games on the market. The Canadian legal code states that only provincial governments and charitable organizations licensed by provincial governments might function a casino in Canada.