Changes between Version 5 and Version 6 of waue/2009/0806
- Timestamp:
- Aug 6, 2009, 3:13:39 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
waue/2009/0806
v5 v6 9 9 = 一、安裝 = 10 10 == 1.1 安裝 == 11 * 大部分的使用者都不建議用apt-get 安裝tomcat 因此建議用tarball方式解壓縮 12 * 下載 [http://ftp.twaren.net/Unix/Web/apache/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz tomcat 6.0.20 2009/08/06] 13 * 安裝 11 * 注意: 12 13 大部分的使用者都不建議用apt-get 安裝tomcat 因此建議用tarball方式解壓縮 14 15 * 下載: 16 [http://ftp.twaren.net/Unix/Web/apache/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz tomcat 6.0.20 2009/08/06] 17 18 * 安裝: 19 14 20 {{{ 15 21 sudo mv ~/Desktop/apache-tomcat-6*.gz /opt/ … … 21 27 22 28 == 1.2 bootstrap == 29 30 若要系統開機就載入tomcat 23 31 24 32 {{{ … … 36 44 == 1.3 啟動停止tomcat == 37 45 38 * 建立 /etc/init.d/tomcat ,內容為: 46 建立 /etc/init.d/tomcat ,內容為: 47 39 48 {{{ 40 49 #!text … … 66 75 esac 67 76 }}} 68 * 77 * 使用方法: 78 * 開啟 /etc/init.d/tomcat start 79 * 關閉 /etc/init.d/tomcat stop 69 80 70 = 二、 = 81 = 二、 Hello World = 82 83 == 2.1 撰寫 hello.jsp == 84 85 {{{ 86 cd /opt/tomcat/webapps/ROOT/ 87 mkdir test 88 cd test 89 touch hello.jsp 90 chmod 755 hello.jsp 91 }}} 92 93 hello.jsp 的內容為 94 {{{ 95 #!text 96 97 <html> 98 <head> 99 <title> 100 Hello World 101 </title> 102 </head> 103 104 <body> 105 <% String s = "Eric"; %> 106 <h1>Hello <%=s%></h1> 107 </body> 108 </html> 109 }}} 110 111 {{{ 112 /etc/init.d/tomcat restart 113 }}} 114 115 * 瀏覽: http:localhost:8080/test/hello.jsp