标签:
tomcat的conf目录下的server.xml文件中
<!-- <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> 恢复默认要取消这边的注释 --> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> 恢复默认要取消这边的注释 --> <!-- 配置虚拟路径 --> <Host name="localhost" appBase="webapps"></Host> <Host name="www.juyuanmeihui.com" appBase="juyuanmeihui"> <Context path="/" docBase="D:\JYCJ\shop\WebContent" ></Context> </Host>
然后修改host文件
#默认配置,不必修改 127.0.0.1 localhost 127.0.0.1 www.juyuanmeihui.com
这时只需要运行tomcat而且不需要部署这个项目
如图
但是可能会出现下面这种情况
严重: Error configuring application listener of class com.enation.eop.sdk.listener.EopSessionListener java.lang.ClassNotFoundException: com.enation.eop.sdk.listener.EopSessionListener
class文件找不到报异常
这时关闭tomcat,设置项目的class输出目录,设置为javamall/WebContent/WEB-INF/classes
然后确定,重启tomcat即可,这时你可以通过访问
www.juyuanmeihui.com来访问本地的javamall项目了。
标签:
原文地址:http://www.cnblogs.com/nbkyzms/p/5109068.html