OSChina 的 Tomcat 配置 server.xml

下载 Tomcat 后,第一件事就是把繁杂的 server.xml 清理干净,然后删掉 webapps 目录下所有内容,清理一下 logging.properties ,以免产生不必要的日志文件。
server.xml

<Server port="9005" shutdown="SHUTDOWN">
  <Service name="Catalina">
    <Executor name="tomcatThreadPool" namePrefix="HTTP-9081-exec-"
        maxThreads="500" minSpareThreads="10" maxIdleTime="600000"/>
    <Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol"
        connectionTimeout="20000" executor="tomcatThreadPool" acceptorThreadCount="4"
        redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost"  appBase="webapps" unpackWARs="false" autoDeploy="false">
        <Context path="" docBase="D:\WORKDIR\oschina\webapp" reloadable="false" />
     </Host>
    </Engine>
  </Service>
</Server>
<Server port="9005" shutdown="SHUTDOWN">
  <Service name="Catalina">
    <Executor name="tomcatThreadPool" namePrefix="HTTP-9081-exec-"
        maxThreads="200" minSpareThreads="10" maxIdleTime="60000"/>
    <!--
    <Connector port="9082" protocol="org.apache.coyote.http11.Http11NioProtocol"
        connectionTimeout="20000" executor="tomcatThreadPool"
        redirectPort="8443" acceptorThreadCount="4"/>
    -->
    <Connector port="9081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" executor="tomcatThreadPool"/>
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost"  appBase="webapps"
            unpackWARs="false" autoDeploy="false"
            xmlValidation="false" xmlNamespaceAware="false">
        <Context path="" docBase="/data/oschina/webapp" reloadable="false"/>
     </Host>
    </Engine>
  </Service>
</Server>

catalina.sh

## Linux 下的配置
CATALINA_OPTS="-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.EPollSelector
Provider -Djava.library.path=/usr/local/apr/lib"
JAVA_OPTS="-server -Xms1024m -Xmx1524m"

还没有评论,快来抢沙发!

发表评论

  • 😉
  • 😐
  • 😡
  • 😈
  • 🙂
  • 😯
  • 🙁
  • 🙄
  • 😛
  • 😳
  • 😮
  • emoji-mrgree
  • 😆
  • 💡
  • 😀
  • 👿
  • 😥
  • 😎
  • ➡
  • 😕
  • ❓
  • ❗
  • 69 queries in 0.411 seconds