首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Tomcat 6.0怎么配置虚拟目录

2012-01-06 
Tomcat 6.0如何配置虚拟目录我是新手刚装了Tomcat6.0但发现的配置文件server.xml与Tomcat5.0的配置文件有

Tomcat 6.0如何配置虚拟目录
我是新手刚装了Tomcat   6.0   但发现的配置文件server.xml   与Tomcat5.0的配置文件有所不同,所以我配置虚拟目录几次都没有成功。请大虾帮忙说一下,如下为Tomcat   6里server.xml文件的内容:
<!--   Note:     A   "Server "   is   not   itself   a   "Container ",   so   you   may   not
          define   subcomponents   such   as   "Valves "   at   this   level.
          Documentation   at   /docs/config/server.html
  -->
<Server   port= "8005 "   shutdown= "SHUTDOWN ">

    <!--APR   library   loader.   Documentation   at   /docs/apr.html   -->
    <Listener   className= "org.apache.catalina.core.AprLifecycleListener "   SSLEngine= "on "   />
    <!--Initialize   Jasper   prior   to   webapps   are   loaded.   Documentation   at   /docs/jasper-howto.html   -->
    <Listener   className= "org.apache.catalina.core.JasperListener "   />
    <!--   JMX   Support   for   the   Tomcat   server.   Documentation   at   /docs/non-existent.html   -->
    <Listener   className= "org.apache.catalina.mbeans.ServerLifecycleListener "   />
    <Listener   className= "org.apache.catalina.mbeans.GlobalResourcesLifecycleListener "   />

    <!--   Global   JNDI   resources
              Documentation   at   /docs/jndi-resources-howto.html
    -->
    <GlobalNamingResources>
        <!--   Editable   user   database   that   can   also   be   used   by
                  UserDatabaseRealm   to   authenticate   users
        -->
        <Resource   name= "UserDatabase "   auth= "Container "
                            type= "org.apache.catalina.UserDatabase "
                            description= "User   database   that   can   be   updated   and   saved "
                            factory= "org.apache.catalina.users.MemoryUserDatabaseFactory "
                            pathname= "conf/tomcat-users.xml "   />
    </GlobalNamingResources>

    <!--   A   "Service "   is   a   collection   of   one   or   more   "Connectors "   that   share
              a   single   "Container "   Note:     A   "Service "   is   not   itself   a   "Container ",  
              so   you   may   not   define   subcomponents   such   as   "Valves "   at   this   level.


              Documentation   at   /docs/config/service.html
      -->
    <Service   name= "Catalina ">

        <!--   A   "Connector "   represents   an   endpoint   by   which   requests   are   received
                  and   responses   are   returned.   Documentation   at   :
                  Java   HTTP   Connector:   /docs/config/http.html   (blocking   &   non-blocking)
                  Java   AJP     Connector:   /docs/config/ajp.html
                  APR   (HTTP/AJP)   Connector:   /docs/apr.html
                  Define   a   non-SSL   HTTP/1.1   Connector   on   port   8080
        -->
        <Connector   port= "8080 "   protocol= "HTTP/1.1 "  
                              maxThreads= "150 "   connectionTimeout= "20000 "  
                              redirectPort= "8443 "   />

        <!--   Define   a   SSL   HTTP/1.1   Connector   on   port   8443
                  This   connector   uses   the   JSSE   configuration,   when   using   APR,   the  
                  connector   should   be   using   the   OpenSSL   style   configuration
                  described   in   the   APR   documentation   -->
        <!--
        <Connector   port= "8443 "   protocol= "HTTP/1.1 "   SSLEnabled= "true "  
                              maxThreads= "150 "   scheme= "https "   secure= "true "  
                              clientAuth= "false "   sslProtocol= "TLS "   />
        -->

        <!--   Define   an   AJP   1.3   Connector   on   port   8009   -->
        <Connector   port= "8009 "   protocol= "AJP/1.3 "   redirectPort= "8443 "   />


        <!--   An   Engine   represents   the   entry   point   (within   Catalina)   that   processes
                  every   request.     The   Engine   implementation   for   Tomcat   stand   alone
                  analyzes   the   HTTP   headers   included   with   the   request,   and   passes   them


                  on   to   the   appropriate   Host   (virtual   host).
                  Documentation   at   /docs/config/engine.html   -->

        <!--   You   should   set   jvmRoute   to   support   load-balancing   via   AJP   ie   :
        <Engine   name= "Standalone "   defaultHost= "localhost "   jvmRoute= "jvm1 ">                  
        -->  
        <Engine   name= "Catalina "   defaultHost= "localhost ">

            <!--For   clustering,   please   take   a   look   at   documentation   at:
                    /docs/cluster-howto.html     (simple   how   to)
                    /docs/config/cluster.html   (reference   documentation)   -->
            <!--
            <Cluster   className= "org.apache.catalina.ha.tcp.SimpleTcpCluster "/>
            -->                

            <!--   The   request   dumper   valve   dumps   useful   debugging   information   about
                      the   request   and   response   data   received   and   sent   by   Tomcat.
                      Documentation   at:   /docs/config/valve.html   -->
            <!--
            <Valve   className= "org.apache.catalina.valves.RequestDumperValve "/>
            -->

            <!--   This   Realm   uses   the   UserDatabase   configured   in   the   global   JNDI
                      resources   under   the   key   "UserDatabase ".     Any   edits
                      that   are   performed   against   this   UserDatabase   are   immediately
                      available   for   use   by   the   Realm.     -->
            <Realm   className= "org.apache.catalina.realm.UserDatabaseRealm "
                          resourceName= "UserDatabase "/>

            <!--   Define   the   default   virtual   host
                      Note:   XML   Schema   validation   will   not   work   with   Xerces   2.2.


              -->
            <Host   name= "localhost "     appBase= "webapps "
                        unpackWARs= "true "   autoDeploy= "true "
                        xmlValidation= "false "   xmlNamespaceAware= "false ">

                <!--   SingleSignOn   valve,   share   authentication   between   web   applications
                          Documentation   at:   /docs/config/valve.html   -->
                <!--
                <Valve   className= "org.apache.catalina.authenticator.SingleSignOn "   />
                -->

                <!--   Access   log   processes   all   example.
                          Documentation   at:   /docs/config/valve.html   -->
                <!--
                <Valve   className= "org.apache.catalina.valves.AccessLogValve "   directory= "logs "    
                              prefix= "localhost_access_log. "   suffix= ".txt "   pattern= "common "   resolveHosts= "false "/>
                -->

         
            </Host>
        </Engine>
    </Service>
</Server>




[解决办法]
太新了.没用过.你还是装个TOMCAT5.X吧.
[解决办法]
新的 没用过,tomcat5 够用
[解决办法]
程序员总结开发的学习资料、项目代码

1.JSP编程技巧集锦(一个问题一段代码) 40RMB
2.ASP编程技巧集锦(一个问题一段代码) 30RMB
3.JavaScript编程技巧集锦(一个问题一段代码) 20RMB
4.Web 网上书店系统(全套源码 安装即用) 200RMB
5.Web 学生成绩管理系统(全套源码 安装即用) 200RMB
6.Web OA-办公自动化系统(全套源码 安装即用) 300RMB
7.Web ERP-企业产供销管理系统(全套源码 安装即用) 300RMB
[解决办法]
用tomcat5的配法,可以啊,我试过,没问题?
[解决办法]
在 </host>
前加入
<Context path= "/test " docBase= "d:\test "/>


[解决办法]
<Context path= "/test " docBase= "/test " debug= "0 " reloadable= "true ">
</Context>
将上面的代码放到 </Host> 前

test 是我假设的项目名
------解决方案--------------------


就跟T5一样的配么,区别不大啊!
[解决办法]
http://www.vip888.net/blog/exurl.php/reply/382.html

1 编辑server文件(x:\tomcat\conf\server.xml)
2 只要在server.xml文件中加入如下代码即可:
注意:(在server.xml中,此语句 <Host name= "localhost " appBase= "webapps "
unpackWARs= "true " autoDeploy= "true "
xmlValidation= "false " xmlNamespaceAware= "false "> 后面添加如下语句:)

<!-- This is my site path,power by aaa -->
<Context path= "/aaa " docBase= "C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\aaa " debug= "0 "
reloadable= "true " crossContext= "true ">
</Context>
<!-- Site setup end -->
3 因为在tomcat启动时要读取server文件的信息,所以更改server文件后,一定要重新启动tomcat。

-----------------------------------
哈哈手记:本方案有效

[解决办法]
来私聊,我告诉你...
[解决办法]
顶 ywjq

热点排行