StackDoc

StackDoc

當前位置: 主頁 > 服務器軟件 > Tomcat >

Ubuntu 10.10配置Tomcat6

時間:2011-02-28 17:21來源:互聯網 作者:互聯網 點擊:
1 、 tomcat6下載地址: http://archive.apache.org/dist/tomcat/tomcat-6/ 版本: v6.0.29 2 、在/usr/local/share下創
?

1tomcat6下載

地址: http://archive.apache.org/dist/tomcat/tomcat-6/

版本: v6.0.29

2 、在/usr/local/share下創建tomcat6目錄

sudo mkdir /usr/local/share/tomcat6

3 、複製安裝文件到/usr/local/share/tomcat6/目錄下,並解壓

sudo cp /home/silver/下載/apache-tomcat-6.0.29.tar.gz /usr/local/share/tomcat6/ apache-tomcat-6.0.29.tar.gz

sudo tar -zxvf apache-tomcat-6.0.29.tar.gz

4 、分別配置startup.shshutdown.sh文件

sudo gedit /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/startup.sh

sudo gedit /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/shutdown.sh

exec "$PRGDIR"/"$EXECUTABLE" start "$@"之前加入以下配置內容

#environment varible for tomcat

JAVA_HOME=/usr/lib/jvm/java/jdk1.6.0_22

JRE_HOME=/usr/lib/jvm/java/jdk1.6.0_22/jre

PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

TOMCAT_HOME=/usr/local/share/tomcat6/apache-tomcat-6.0.29

5 、測試是否能正常使用

cd /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/

sudo ./startup.sh

輸出:

Using CATALINA_BASE: /usr/local/share/tomcat6/apache-tomcat-6.0.29

Using CATALINA_HOME: /usr/local/share/tomcat6/apache-tomcat-6.0.29

Using CATALINA_TMPDIR: /usr/local/share/tomcat6/apache-tomcat-6.0.29/temp

Using JRE_HOME: /usr/lib/jvm/java/jdk1.6.0_22

Using CLASSPATH: /usr/local/share/tomcat6/apache-tomcat-6.0.29/bin/bootstrap.jar

則表示服務已經正常啟動,輸入http://localhost:8080/查看

6 、關閉服務

sudo ./shutdown.sh

7 、配置conf/server.xml文件

cd /usr/local/share/tomcat6/apache-tomcat-6.0.29/conf

sudo gedit server.xml

編輯

<Connector port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />

將端口改成 8090 ,添加 URIEncoding="UTF-8" 以支持中文參數傳遞處理

<Connector port="8090" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" URIEncoding="UTF-8"/>

頂一下
(0)
0%
踩一下
(0)
0%
------分隔線----------------------------
發表評論
請自覺遵守互聯網相關的政策法規,嚴禁發布色情、暴力、反動的言論。
評價:
表情:
用戶名: 驗證碼:點擊我更換圖片
欄目列表
推薦內容
GOOGLE提供的廣告