tomcat按域名配置多应用
程序员文章站
2022-05-28 16:13:17
...
步骤1:端口改80
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
步骤2:多host,改hostName
<Host name="hello.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="D:\\myopen\\test-web\\WebContent"> </Context> </Host> <Host name="hello2.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="D:\\myopen\\test-web2\\WebContent"> </Context> </Host>
步骤3:修改hosts文件
127.0.0.1 hello.com 127.0.0.1 hello2.com