1. 修改host下,接收要设置的域名:
进入C:\WINDOWS\system32\drivers\etc,先取消host文件的只读属性。然后添加一句:
127.0.0.1 docviewer.com.cn
所以配置完之后的host可能如下:
127.0.0.1 localhost
127.0.0.1 docviewer.com.cn
2. 修改tomcat的server.xml,增加host一段,可以参考server.xml中原来配置的localhost。例如:
<Host name="docviewer.com.cn" appBase="webapps_docviewer" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" > <Context path="" reloadable="true" docBase="F:\docviewer\public" /> </Host> <Host name="www.docviewer.com.cn" appBase="webapps_docviewer" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" > <Context path="" reloadable="true" docBase="F:\docviewer\public" /> </Host>
OK,搞定~