配置TomCat

来源:互联网 发布:手机淘宝首页代码 编辑:程序博客网 时间:2024/04/30 09:57
配置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文件。
添加以上需要修改的内容
原创粉丝点击