码迷,mamicode.com
首页 > 其他好文 > 详细

maven中tomcat怎么配置本地虚拟路径

时间:2019-03-24 23:07:19      阅读:419      评论:0      收藏:0      [点我收藏+]

标签:name   ctp   amp   cti   路径   logs   res   esc   sof   

1.server.xml

<?xml version="1.0" encoding="UTF-8"?>

<Server port="8005" shutdown="SHUTDOWN">
  
  
  <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="8001" 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.LockOutRealm">
        
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
               <Context path="/img" docBase="D:\images" reloadable="false"  privileged="false"></Context>
        <!-- <Context path="" docBase="E:\javaeclipse\mysoftware\apache-tomcat-8.5.32\apache-tomcat-8.5.32\webapps\web" reload="false"></Context> -->
      </Host>
    </Engine>
  </Service>
</Server>

2.tomcat插件配置

<plugins>
            <!-- 配置Tomcat插件 -->
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <serverXml>src/main/resources/tomcat/server.xml</serverXml>
                </configuration>
            </plugin>
        </plugins>

 

maven中tomcat怎么配置本地虚拟路径

标签:name   ctp   amp   cti   路径   logs   res   esc   sof   

原文地址:https://www.cnblogs.com/mollie-x/p/10591075.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!