时间:2023-06-28 18:27:01 | 来源:网站运营
时间:2023-06-28 18:27:01 来源:网站运营
【20201103】Tomcat虚拟主机配置的案例大全:<!--one port one host--><Service name="service1"> <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Engine name="engine1" defaultHost="localhost"> <Host name="localhost" appBase="onePortOneHost" unpackWARs="true" autoDeploy="true"> </Host> </Engine></Service>
<!--one port multi host--><Service name="service2"> <Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Engine name="engine1" defaultHost="localhost"> <Host name="localhost" appBase="onePortMultiHost" unpackWARs="true" autoDeploy="true"> </Host> <Host name="host1.tongfu.net" appBase="onePortMultiHost1" unpackWARs="true" autoDeploy="true"> </Host> <Host name="host2.tongfu.net" appBase="onePortMultiHost2" unpackWARs="true" autoDeploy="true"> </Host> </Engine></Service>
<!--multi port multi host--><Service name="service5"> <Connector port="8085" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Engine name="engine1" defaultHost="localhost"> <Host name="localhost" appBase="multiPortMultiHost8085" unpackWARs="true" autoDeploy="true"> </Host> </Engine></Service><Service name="service6"> <Connector port="8086" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Engine name="engine1" defaultHost="localhost"> <Host name="localhost" appBase="multiPortMultiHost8086" unpackWARs="true" autoDeploy="true"> </Host> </Engine></Service>
<!--multi context--><Service name="service8"> <Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Engine name="engine1" defaultHost="localhost"> <Host name="localhost" appBase="" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="oneHostMultiContext" privileged="true"> </Context> <Context path="/context1" docBase="oneHostMultiContext1" privileged="true"> </Context> <Context path="/context2" docBase="oneHostMultiContext2" privileged="true"> </Context> </Host> </Engine></Service>
关键词:配置,虚拟,主机