Tomcat configuration help: multiple ports not responding

為{幸葍}努か 提交于 2019-11-30 21:09:54

I think you're on the right track, but you're just missing some of the child elements that are listed in the specification for the Service element.

I think you're just forgetting the Engine and Host elements, which are grandparent and parent respectively to the Context element.

<Service name="stable">

     <Connector port="80" protocol="HTTP/1.1" 
           maxThreads="150" connectionTimeout="20000"/>

     <Engine name="stable" defaultHost="localhost">
         <Host name="localhost1" appBase="webapp1">
             <Context docBase="C:\websites\test\stable\" />
        </Host>
     </Engine>

</Service>


<Service name="release">

    <Connector port="81" protocol="HTTP/1.1" 
           maxThreads="150" connectionTimeout="20000"/>

    <Engine name="release" defaultHost="localhost2">
         <Host name="localhost2" appBase="webapp2">
             <Context docBase="C:\websites\test\release\" />
         </Host>
     </Engine>

</Service>

For more information and a more detailed example, which defines two Service elements, one on port 8080 and one on port 9080, see this mailing list post:

http://www.mail-archive.com/users@tomcat.apache.org/msg44729.html

This is working for me:

<Service name="Stable">
    <Connector 
        port="80" 
        protocol="HTTP/1.1"                
        connectionTimeout="20000" />

    <Engine name="Stable" defaultHost="localhost">
        <Host 
            name="localhost"  
            appBase="C:\websites\test\stable\">

            <Context docBase="C:\websites\test\stable\" path="" />              
        </Host>
    </Engine>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!