(原)CenOS Linux Tomcat安裝和配置

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.