配置TomCat

配置TomCat
1.改端口
在conf/server.xml裏改
<Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 

               redirectPort="8443" />


2.添加虛擬目錄
conf/server.xml
虛擬目錄的根路徑下必須包含webapps/ROOT/WEB-INF文件夾
<Context path="/zhe" docBase="D:/Java/web">

3.目錄列表顯示功能
conf/web.xml
  <init-param>
        <param-name>listings</param-name>
        <param-value>true</param-value>
  </init-param>

false ->true

4.改主頁
conf/web.xml
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
建議不要改這個公共的,可以改虛擬目錄下的WEB-INF/web.xml文件。
添加以上需要修改的內容
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章