Tomcat 7 (Virtual hosts?)

ぐ巨炮叔叔 提交于 2019-12-13 17:22:46

问题


I want use my web application on port 8082 (for example), and it is working correctly. But I want to leave connection on port 8080 (with default Tomcat page), can I do it and how?


回答1:


you need edit the conf/server.xml to add another Service, such as

<Service name="for_host1"> 
    <Connector port="8082" .. />
     <Engine name="Catalina_host1" defaultHost="stimpy">
        <Host name="stimpy" appBase="stimpyapps"/>
    </Engine> 
</Service> 
<Service name="default"> 
    <Connector port="8080" .. />
     <Engine name="Catalina" defaultHost="ren">
        <Host name="ren"    appBase="renapps"/>
    </Engine> 
</Service> 



回答2:


you could install and run 2 or more tomcat servers simultaneous and have each tomcat listen to different ports



来源:https://stackoverflow.com/questions/12001282/tomcat-7-virtual-hosts

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