习惯了用IIS,老觉得在tomcat中配置虚拟目录太不方便,还得找到server.xml。在里面加上context.然后加一大堆属性。还老是出不了结果。郁闷,开源的东西就这点不好。后来看了一下。才知道tomcat也支持可视化配置:
打开localhost:8080.在主页面左上角:有一个Tomcat Manager
Administration |
Status Tomcat Administration Tomcat Manager |
Applications | ||||
Path | Display Name | Running | Sessions | Commands |
/ | Welcome to Tomcat | true | 0 | Start Stop Reload Undeploy |
/FCKeditor | FCKeditor Test Application | true | 0 | Start Stop Reload Undeploy |
/Manager | true | 0 | Start Stop Reload Undeploy | |
/admin | Tomcat Administration Application | true | 0 | Start Stop Reload Undeploy |
/balancer | true | 0 | Start Stop Reload Undeploy | |
/fckEdit | FCKeditor Test Application | true | 0 | Start Stop Reload Undeploy |
/jsp-examples | JSP 2.0 Examples | true | 0 | Start Stop Reload Undeploy |
/manager | Tomcat Manager Application | true | 0 | Start Stop Reload Undeploy |
/servlets-examples | Servlet 2.4 Examples | true | 0 | Start Stop Reload Undeploy |
/tomcat-docs | Tomcat Documentation | true | 0 | Start Stop Reload Undeploy |
/webdav | Webdav Content Management | true | 0 | Start Stop Reload Undeploy |
/webshop | FCKeditor Test Application | true | 1 | Start Stop Reload Undeploy |
Deploy | |
Deploy directory or WAR file located on server | |
第二项是配置的xml,可以不添。
第三项为目录的所在位置。格式是(file://d:/shop).我刚一开始写的d:/shop怎么也找不到。
保证上面的正确之后。点Deploy。OK。一个虚拟目录就好了。
方便吧。
然后我去server.xml中找配置项,怎么找不到,到底放那儿了。难道还有其它的配置文件不成。翻遍conf下面所有的目录才发现conf\Catalina\localhost下放了好多xml文件。好家伙原来是这儿放得了。打开一看果然有个<context>. 好了谜团解开。要填的第二项也就是要生成的xml文件名吧。
上面还有更多功能,去发现吧
http://hi.baidu.com/deangle/blog/item/1ca157a7b5759794d14358a8.html