默认情况下,在tomcat根目录下的webapps下的web项目,在tomcat启动的时候都会被发布,同时发布的情况会通过下面黄色部分的日志记录。但是没有放在放在webapps目录下的web项目,通过在conf/server.xml也是可以将其配置进入tomcat的,启动的时候也会将这些web项目部署好的,但是确没有在启动的时候把发布的项目的情况通过日志打印出来,这个确实让人头痛。
在conf/server.xml配置非webapps下的外部web项目的具体实例如下所示:
配置了一个21.11项目和配置了一个MP3Eden项目:
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context docBase="D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\wtpwebapps\21.11" path="/21.11" reloadable="true" source="org.eclipse.jst.jee.server:21.11"/>
<Context docBase="D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\wtpwebapps\MP3Eden" path="/MP3Eden" reloadable="true" source="org.eclipse.jst.jee.server:MP3Eden"/></Host>
七月 29,2015 2:51:03 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:21.11' did not find a matching property.七月 29,2015 2:51:03 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MP3Eden' did not find a matching property.
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.57
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 3 2014 08:39:16 UTC
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.57.0
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME: D:\root\jdk7u21\jre
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_21-b11
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\wtpwebapps
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\endorsed
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xms256M
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xmx512M
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:PermSize=256m
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxPermSize=512m
七月 29,2015 2:51:03 下午 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=GBK
七月 29,2015 2:51:03 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Loaded APR based Apache Tomcat Native library 1.1.32 using APR version 1.5.1.
七月 29,2015 2:51:03 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR capabilities: IPv6 [true],sendfile [true],accept filters [false],random [true].
七月 29,2015 2:51:04 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1j 15 Oct 2014)
七月 29,2015 2:51:04 下午 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
七月 29,2015 2:51:04 下午 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
七月 29,2015 2:51:04 下午 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1414 ms
七月 29,2015 2:51:04 下午 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
七月 29,2015 2:51:04 下午 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
七月 29,2015 2:51:05 下午 org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\webapps\ROOT 七月 29,2015 2:51:05 下午 org.apache.catalina.startup.HostConfig deployDirectory INFO: Deployment of web application directory D:\root\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\webapps\ROOT has finished in 29 ms 七月 29,2015 2:51:05 下午 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-apr-8080"] 七月 29,2015 2:51:05 下午 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-apr-8009"] 七月 29,2015 2:51:05 下午 org.apache.catalina.startup.Catalina start INFO: Server startup in 670 ms