目錄架構
"bin"資料夾-主要是存放Tomcat服務啟動相關的執行檔(可設定)
"conf"資料夾-主要是存放Tomcat伺服器(容器系統)相關的設定。
"webapps"資料夾-主要是存放Tomcat管理網站及JSP網站佈署的地方
"lib"資料夾-網站所需套件如servlet-api.jar和jsp-api.jar
"log"資料夾-檢查error messages
1.安裝jdk後
設定環境變數path
C:\Program Files (x86)\Java\jdk1.8.0_25\bin
classpath
.;C:\Program Files (x86)\Java\jdk1.8.0_25\lib;C:\Program Files (x86)\Java\jdk1.8.0_25\lib\tools.jar
2.下載tomcat zip解壓縮後
設定環境變數
或cmd命令提示字元執行
或在bin資料夾底下setclasspath.bat這個檔案,按右鍵"編輯"加入此兩行
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_25
set JRE_HOME=C:\Program Files (x86)\re1.8.0_25
執行servlet或JSP
set CLASSPATH=%CLASSPATH%;d:\tomcat7\lib\servlet-api.jar;d:\tomcat7\lib\jsp-api.jar
若有設定 CATALINA_HOME
set CATALINA_HOME=C:\tomcat7
就可以改寫成下列形式
執行servlet加入 %CATALINA_HOME%\common\lib\servlet-api.jar
執行JSP加入 %CATALINA_HOME%\common\lib\jsp-api.jar
跑tomcat指令改為
要設定CATALINA_HOME代表tomcat安裝的目錄
In the remainder of this manual, example shell scripts assume that you have set an environment variable
Optionally, if Tomcat has been configured for multiple instances, each instance will have its own
打開瀏覽器
[Apache_Tomcat] Tomcat 安裝教學或在bin資料夾底下setclasspath.bat這個檔案,按右鍵"編輯"加入此兩行
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_25
set JRE_HOME=C:\Program Files (x86)\re1.8.0_25
執行servlet或JSP
set CLASSPATH=%CLASSPATH%;d:\tomcat7\lib\servlet-api.jar;d:\tomcat7\lib\jsp-api.jar
若有設定 CATALINA_HOME
set CATALINA_HOME=C:\tomcat7
就可以改寫成下列形式
執行servlet加入 %CATALINA_HOME%\common\lib\servlet-api.jar
執行JSP加入 %CATALINA_HOME%\common\lib\jsp-api.jar
跑tomcat指令改為
cmd命令提示字元執行
- Execute the shell command: %CATALINA_HOME%\bin\startup (Windows)或是
cd %CATALINA_HOME%\bin (Windows) startup (Windows)
要設定CATALINA_HOME代表tomcat安裝的目錄
In the remainder of this manual, example shell scripts assume that you have set an environment variable
CATALINA_HOME
that contains the pathname to the directory in which Tomcat has been installed. Optionally, if Tomcat has been configured for multiple instances, each instance will have its own
CATALINA_BASE
configured.tomcat有多個user使用該tomcat環境才要設定打開瀏覽器
http://localhost:8080/
http://127.0.0.1:8080/
關掉tomcat
cmd執行
%CATALINA_HOME%\bin\shutdown (Windows)
或是
cd %CATALINA_HOME%\bin (Windows) shutdown (Windows)
不想用預設8080port 改 $CATALINA_HOME/conf/server.xml設定
出現"out of environment space" error錯誤可更改startup.bat的Memory設定
找不到localhost要設定瀏覽器proxy configuration
參考:
http://tomcat.apache.org/tomcat-4.1-doc/RUNNING.txt
http://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt
http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html
http://web.nchu.edu.tw/~jlu/cyut/tomcat7.shtml
How to set CATALINA_HOME variable in windows 7?Tomcat安裝步驟
沒有留言:
張貼留言