zoukankan      html  css  js  c++  java
  • (原)CenOS Linux Tomcat安装和配置

    CenOS Linux Tomcat安装和配置
    一、Tomcat
    我下的是apache-tomcat-6.0.36.tar.gz

    二、安装
    1、解压
    #tar -zxvf apache-tomcat-6.0.36.tar.gz
    2、拷贝到我要放的文件夹中
    #cp -R apache-tomcat-6.0.36 /opt/tomcat
    3、删除Tomat中无用的文件夹
    #cd /opt/tomcat/webapps
    #rm -rf ROOT
    #rm -rf manager
    #rm -rf host-manager
    #rm -rf examples
    #rm -rf docs
    我是觉得没什么用

    4、配制Tomcat,我的配置文件如下

    <?xml version='1.0' encoding='utf-8'?> 
    
    <Server port="8005" shutdown="SHUTDOWN"> 
    
      <!--APR library loader. Documentation at /docs/apr.html -->
      <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
      <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
      <Listener className="org.apache.catalina.core.JasperListener" />
      <!-- Prevent memory leaks due to use of particular java/javax APIs-->
      <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
      <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
      <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
      <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> 
    
      <!-- Global JNDI resources
           Documentation at /docs/jndi-resources-howto.html
      -->
      <GlobalNamingResources>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users
        -->
        <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> 
    
      <!-- A "Service" is a collection of one or more "Connectors" that share
           a single "Container" Note:  A "Service" is not itself a "Container", 
           so you may not define subcomponents such as "Valves" at this level.
           Documentation at /docs/config/service.html
       -->
      <Service name="Catalina">
        <Connector port="8080" protocol="HTTP/1.1" 
                   connectionTimeout="20000" 
                   redirectPort="8443" /> 
    
        <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> 
    
        <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">         
    
          <!--For clustering, please take a look at documentation at:
              /docs/cluster-howto.html  (simple how to)
              /docs/config/cluster.html (reference documentation) -->
          <!--
          <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
          -->        
    
          <!-- The request dumper valve dumps useful debugging information about
               the request and response data received and sent by Tomcat.
               Documentation at: /docs/config/valve.html -->
          <!--
          <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
          --> 
    
          <!-- This Realm uses the UserDatabase configured in the global JNDI
               resources under the key "UserDatabase".  Any edits
               that are performed against this UserDatabase are immediately
               available for use by the Realm.  -->
          <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                 resourceName="UserDatabase"/> 
    
          <!-- Define the default virtual host
               Note: XML Schema validation will not work with Xerces 2.2.
           -->
          <Host name="localhost"  appBase="webapps"
                unpackWARs="true" autoDeploy="true"
                xmlValidation="false" xmlNamespaceAware="false">
            <Context path="" docBase="/opt/www" debug="0" />
          </Host>
        </Engine>
      </Service>
    </Server>


    5、启动Tomcat
    #/opt/tomcat/bin/startup.sh

    Using CATALINA_BASE:   /opt/tomcat
    Using CATALINA_HOME:   /opt/tomcat
    Using CATALINA_TMPDIR: /opt/tomcat/temp
    Using JRE_HOME:        /usr
    Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar

  • 相关阅读:
    【bzoj3566】[SHOI2014]概率充电器 树形概率dp
    【bzoj1419】Red is good 期望dp
    【bzoj2698】染色 期望
    【bzoj2134】单选错位 期望
    【bzoj1022】[SHOI2008]小约翰的游戏John 博弈论
    【bzoj3170】[Tjoi 2013]松鼠聚会 旋转坐标系
    【bzoj2338】[HNOI2011]数矩形 计算几何
    【bzoj2085】[Poi2010]Hamsters Hash+倍增Floyd
    【bzoj1014】[JSOI2008]火星人prefix Splay+Hash+二分
    【bzoj2795】[Poi2012]A Horrible Poem Hash+分解质因数
  • 原文地址:https://www.cnblogs.com/skyblue/p/3079574.html
Copyright © 2011-2022 走看看