博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

java in learning(2)-配置tomcat

Posted on 2007-05-11 12:59  qqhe325  阅读(275)  评论(0编辑  收藏  举报
1.修改默认站点目录,修改server.xml,docs位于webapps中,workDir为绝对路径。默认为root。
      <Host name="localhost"  appBase="webapps"
            unpackWARs
="true" autoDeploy="true"
            xmlValidation
="false" xmlNamespaceAware="false">
  
<Context   path=""   docBase="docs"   workDir="C:\Program Files\Apache Software Foundation\Tomcat 6.0\work"   reload="true" 

  
/>

      
</Host>

2.修改默认访问文件,修改web.xml
   <welcome-file-list>
        
<welcome-file>abc.html</welcome-file>
        
<welcome-file>index.html</welcome-file>
        
<welcome-file>index.htm</welcome-file>
        
<welcome-file>index.jsp</welcome-file>
    
</welcome-file-list>

3.修改默认端口8080,修改server.xml
  <Service name="Catalina">
    
<Connector port="8000" protocol="HTTP/1.1" 
               maxThreads
="150" connectionTimeout="20000" 
               redirectPort
="8443" />

4.修改Tomcat应用程序目录
   <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
   autoDeploy
="true" xmlValidation="false" xmlNamespaceAware="false">
  // 修改成
   
<Host name="localhost" debug="0" appBase="mytest" unpackWARs="true"
   autoDeploy
="true" xmlValidation="false" xmlNamespaceAware="false">
  // mytest目录是和webapps在同一父目录下。