首页 > 代码库 > Tomcat常用操作

Tomcat常用操作

1.修改端口(conf/server.xml)

    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->

 

2.ip跳转项目(conf/server.xml)

      <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="" docBase="../webapps/Channel" debug="0" reloadable="true"/>
      </Host>

备注:docBase里的Channel是项目名(路径 实际修改)

 

3.内存分配(bin/catalina.bat)

set JAVA_OPTS= -Xms2048M -Xmx4096M -XX:PermSize=512M -XX:MaxNewSize=256M -XX:MaxPermSize=1024M

 

Tomcat常用操作