1 使用虚拟主机可以将项目部署成顶级域名 2 3 1.在server.xml文件 4 1.端口修改为80 5 2. 配置主机 6 <Host name="www.customer.com" appBase="D:\java1110\workspace\day19_2" 7 unpackWARs="true" autoDeploy="true"> 8 9 10 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 11 prefix="localhost_access_log." suffix=".txt" 12 pattern="%h %l %u %t "%r" %s %b" /> 13 14 <Context path="" docBase="D:\java1110\workspace\day19_2\WebRoot" /> 15 </Host> 16 3.在hosts文件中配置(C:\Windows\System32\drivers\etc\HOSTs文件) 17 127.0.0.1 www.customer.com 18 4.将引擎engine:中修改掉defaultHost:"www.customer.com"; 19 20