tomcat免重启+去掉项目名访问

 

tomcat免重启

1、打开eclipse中的tomcat,点击Arguments,在VM arguments:配置如下

 

-noverify -javaagent:D:\softbak\jar\jrebel4.0.2\jrebel.jar    //下载一个jrebeljar包

-Drebel.dirs=D:\eclipse-   workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\项目名称\WEB-INF\classes    //目录指向项目的classes底下

-Drebel.spring_plugin=true     //如果有spring插件则为true

-Drebel.struts2-plugin=true    //如果有struts2插件则为true

 

-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=下面是默认的-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=

-Dcatalina.base="D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1" -Dcatalina.home="D:\eclipse-workspace\apache-tomcat-6.0.24" -Dwtp.deploy="D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps" -Djava.endorsed.dirs="D:\eclipse-workspace\apache-tomcat-6.0.24\endorsed"

 

去掉项目名访问:

 

 

1、tomcat6.0:<Host></Host>间加了一句<Context path="" docBase="/fts" debug="0" reloadable="true"/>
2、tomcat7.0 <Host></Host>间加了一句<Context path="/" docBase="fts" debug="0" reloadable="true"/>
<?xml version="1.0" encoding="utf-8"?>
<Server port="8001" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <Service name="Catalina">
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="1000" minSpareThreads="10"/>

    <Connector executor="tomcatThreadPool" port="8081" protocol="HTTP/1.1"  maxHttpHeaderSize="8192" useBodyEncodingForURI="true"
               maxThreads="1000" enableLookups="false" redirectPort="8443" acceptCount="100"
               compression="off" compressionMinSize="2048" 
               compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"
               connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>
    
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost"  appBase="webapps"
            unpackWARs="false" autoDeploy="false">
            <Context path="" docBase="/data/wwwroot/alo" reloadable="false" crossContext="false" privileged="true"/>
      </Host>
    </Engine>
  </Service>
</Server>
/data/app/apache-tomcat-7.0.20/bin/shutdown.sh -config conf/server_alo.xml
/data/app/apache-tomcat-7.0.20/bin/startup.sh -config conf/server_alo.xml

 <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />这句话注意了,某些版本中没有这句话,tomcat7版本里面有,他注意是防止threadLocal内存泄漏。之前版本使用

ContextClassLoader / Threads spawned by webapps

>=6.0.24

In 6.0.24-6.0.26 TimerThread are stopped but it may lead to problems. Optional from 6.0.27 with theclearReferencesStopTimerThreads flag. Other threads may be stopped with theclearReferencesStopThreads flag, but it's unsafe.

Fix the application to stop the thread when the application is stopped

ContextClassLoader / Threads spawned by classes loaded by the common classloader

>=6.0.24

In 6.0.24-6.0.26 TimerThread are stopped but it may lead to problems. Optional from 6.0.27 with theclearReferencesStopTimerThreads flag. Other threads may be stopped with theclearReferencesStopThreads flag, but it's unsafe.

你可能感兴趣的:(tomcat)