如何解决单服务器发布多网站问题呢?
将D:\apache-tomcat-7.0.40\conf下的server.xml中的
<Host name="localhost" appBase="webapps"unpackWARs="true" autoDeploy="true">
拷贝出来,新建一个host的主机,新建立的主机中应该把appBase路径删除掉。才可以访问到我们配置的网站。
<host>
<Host name="shuxin" appBase="webapps"unpackWARs="true" autoDeploy="true">
</host>
将name改为你想发布的名称,并且加上
<context path=”/” docBase=”D:\java\JSP\shuxin\WebContent” reloadable=”true”/>
这段虚拟路径的代码了。
这时我们在浏览器中输入shuxin却找不到站点,是为什么呢?
因为在:C:\Windows\System32\drivers\etc
下的hosts文件中没有配置shuxin的这个站点。