真是夠吐血的,記錄下來,方便以后查閱了。
實現(xiàn)效果:
http://localhost ?訪問一個項目例如一個助學(xué)網(wǎng)。
http://localhost1 訪問一個項目例如一個辦公系統(tǒng)
實現(xiàn)方案,需要修改兩個地方
一個是C:\WINDOWS\system32\drivers\etc\hosts文件,改為
127.0.0.1?????? localhost
127.0.0.1?????? localhost1
另一個要改的就是server.xml,修改后如下:
- <?xml?version= '1.0' ?encoding= 'utf-8' ?> ??
- ??
- <Server?port= "8005" ?shutdown= "SHUTDOWN" > ??
- ??
- ??<Listener?className= "org.apache.catalina.core.AprLifecycleListener" ?SSLEngine= "on" ?/> ??
- ??
- ??<Listener?className= "org.apache.catalina.core.JasperListener" ?/> ??
- ??
- ??<Listener?className= "org.apache.catalina.mbeans.ServerLifecycleListener" ?/> ??
- ??<Listener?className= "org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" ?/> ??
- ??
- ? ??
- ??<GlobalNamingResources> ??
- ??? ??
- ????<Resource?name= "UserDatabase" ?auth= "Container" ??
- ??????????????type= "org.apache.catalina.UserDatabase" ??
- ??????????????description= "User?database?that?can?be?updated?and?saved" ??
- ??????????????factory= "org.apache.catalina.users.MemoryUserDatabaseFactory" ??
- ??????????????pathname= "conf/tomcat-users.xml" ?/> ??
- ??</GlobalNamingResources> ??
- ??
- ? ??
- ??<Service?name= "Catalina" > ??
- ?? ??
- ??? ??
- ????<Connector?port= "80" ?protocol= "HTTP/1.1" ? ??
- ???????????????connectionTimeout= "20000" ? ??
- ???????????????redirectPort= "8443" ?/> ??
- ??? ??
- ????<Connector?port= "8009" ?protocol= "AJP/1.3" ?redirectPort= "8443" ?/> ??
- ??
- ????<Engine?name= "Catalina" ?defaultHost= "localhost" > ??
- ??
- ??????<Realm?className= "org.apache.catalina.realm.UserDatabaseRealm" ??
- ?????????????resourceName= "UserDatabase" /> ??
- ??
- ??????<Host?name= "localhost" ?appBase= "webapps" ??
- ?????????????unpackWARs= "true" ?autoDeploy= "true" ?debug= "0" > ??
- ????<Context?path= "" ?docBase= "E:\Tomcat6\webapps\YangFan\"?reloadable=" true "?crossContext=" true "/> ??
- ??????</Host> ??
- ??
- ??????<Host?name= "localhost1" ?appBase= "webapps" ??
- ?????????????unpackWARs= "true" ?autoDeploy= "true" ?debug= "0" > ??
- ????<Context?path= "" ?docBase= "E:\Tomcat6\webapps\hiccOffice\"?reloadable=" true "?crossContext=" true "/> ??
- ??????</Host> ??
- ??
- ????</Engine> ??
- ??
- ??</Service> ??
- </Server>??
轉(zhuǎn)載: http://www.iteye.com/topic/487682
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
