tomcat7.0 server.xml修改(預設目錄,連接埠,多個網域名稱)

來源:互聯網
上載者:User

標籤:odi   之間   修改   code   pac   webapps   protocol   設定   web   

tomcat目錄下的conf檔案夾, server.xml

1、修改預設webapps

1 <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">2   ...3 </Host>

appBase 可以修改成你的網站位置如:D:/web

2、修改預設目錄ROOT

具體是是在<Host></Host>之間加上Content標籤,你可以理解為每個Content都代表一個應用。

1 <Context path="" docBase="/myweb" debug="0" reloadable="true"/>

path是說明虛擬目錄的名字,如果你要只輸入ip地址就顯示首頁,則該索引值留為空白;
docBase是虛擬目錄的路徑,它預設的是$tomcat/webapps/ROOT目錄,現在我在webapps目錄下建了一個myweb目錄,讓該目錄作為我的預設目錄。
debug和reloadable一般都分別設定成0和true。

3、預設連接埠

1 <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

將port改成你的連接埠

4、綁定網域名稱

1 <Host name="xx.com"  appBase="webapps" unpackWARs="true" autoDeploy="true">2   <Alias>www.xx.com</Alias> <!--多個網域名稱-->3 </Host>

5、多重專案

1 <Host name="aa.com"  appBase="webapps" unpackWARs="true" autoDeploy="true">2 ...3 </Host>4 5 <Host name="bb.com"  appBase="webapps" unpackWARs="true" autoDeploy="true">6 ...7 </Host>

6、中文圖片名字顯示不出來解決辦法

1 <Connector port="8080" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>

附錄:參考自:http://www.cnblogs.com/ilovecss/archive/2013/04/28/3049098.html

tomcat7.0 server.xml修改(預設目錄,連接埠,多個網域名稱)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.