`
tianci8693
  • 浏览: 8380 次
  • 性别: Icon_minigender_1
  • 来自: 济南
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论
  • tianci8693: 好像是网了设置ant的环境变量导致。
    ant

tomcat数据源 server.xml

阅读更多
<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
-->
<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" />
  <!-- 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" />
     <Resource name="jdbc/myjdbc"
            auth="Container"
            type="javax.sql.DataSource"
            username="test"
            password="test"
            driverClassName="oracle.jdbc.driver.OracleDriver"
            url="jdbc:oracle:thin:@192.168.10.112:1521:test"
            maxActive="8"
            maxIdle="4"/>        
  </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">
 
    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->
   
   
    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="9080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="GBK" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->          
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">        
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--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">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->
<Context docBase="E:/workspace/group_ecare/webapp" path="/groupecare" reloadable="true" workDir="E:\workspace\myproj">
  <ResourceLink global="jdbc/myjdbc" name="jdbc/myjdbc" type="javax.sql.DataSource"/>
</Context>
      </Host>
    </Engine>
  </Service>
</Server>
分享到:
评论

相关推荐

    Tomcat 服务器server.xml的关键参数配置

    在这个例子中,创建了一个名为`/xkb`的应用程序,并且为它配置了一个指向SQL Server数据库的数据源。通过`Resource`元素及其子元素`ResourceParams`,可以详细地定义数据源的各种属性,如最大活动连接数(`maxActive`...

    tomcat服务器的Server.xml配置详解.docx

    《Tomcat服务器的Server.xml配置详解》 Tomcat作为一款广泛应用的开源轻量级Web应用服务器,其核心配置文件Server.xml对于服务器的管理和优化至关重要。本文将深入解析Server.xml的结构和配置要素,帮助读者更好地...

    tomcat6 server.xml 详解

    在server.xml中,可以通过GlobalNamingResources配置全局的JNDI资源,如数据源和邮件会话。这些资源可以在任何Context中被应用使用。 9. **Valves**: Valves是处理请求的中间件,可以进行权限验证、日志记录、...

    有关jsp+struts+hibernate+MSSQLServer项目中Tomcat5的server.xml配置

    根据提供的文件信息,本文将详细解释在JSP + Struts + Hibernate + MSSQLServer项目中配置Tomcat 5 的 `server.xml` 文件的关键步骤与重要设置。这些知识点将涵盖如何在Tomcat环境下顺利运行SQL Server数据库,以及...

    详细解读server.xml文件

    在Apache Tomcat服务器中,`server.xml`是核心配置文件,它定义了服务器的整体结构、端口设置、数据源、连接器以及其他关键组件。本文将深入解析`server.xml`文件中的各个元素及其重要性,帮助你更好地理解和管理你...

    TOMCAT连接池DBCP,在server.xml中配置全局数据源详细的介绍,很有好用啊!!

    下面将详细介绍如何在TOMCAT中配置DBCP连接池,并在`server.xml`中设置全局数据源。 首先,确保你的开发环境中已经安装了TOMCAT服务器,并且你已经拥有一个适用于Java的数据库驱动,这里是MySQL的驱动程序`mysql-...

    Tomcat web.xml,server.xml中详细配置说明文档

    `server.xml`是Tomcat的主要配置文件,它定义了服务器的行为,包括端口设置、连接器配置、数据源、 Realm(安全认证)等。例如,你可以配置监听HTTP请求的Connector: ```xml connectionTimeout="20000" ...

    tomcat jboss数据源配置.rar

    在Tomcat中配置数据源是通过Context元素在server.xml或context.xml文件中完成的。数据源通常是通过JNDI(Java Naming and Directory Interface)服务来查找并使用的,它允许应用服务器管理数据库连接,提供透明的...

    tomcat5.5.X域名转向和连接池配置的server.xml文件

    完成上述配置后,还需要在Web应用程序的`WEB-INF/web.xml`中声明数据源以便于应用使用。 ### 总结 Tomcat 5.5.x的`server.xml`文件是服务器配置的核心,它控制着虚拟主机、连接池等关键功能。理解并正确配置这些...

    Tomcat jndi 配置数据源过程

    在Tomcat的`conf/server.xml`文件中,找到`GlobalNamingResources`元素,然后在其内部添加如下内容,将刚刚在`context.xml`中定义的数据源注册到全局JNDI: ```xml type="javax.sql.DataSource" driverClassName...

    JNDI数据源配置(tomcat)

    在 Tomcat 的 server.xml 文件中,添加一个私有数据源的配置。例如,使用 c3p0 数据源的配置: ```xml scope="Shareable" type="com.mchange.v2.c3p0.ComboPooledDataSource" factory="org.apache.naming....

    tomcat-jdbc数据源所需jar包tomcat-jdbc.jar+tomcat-juli.jar

    配置数据源通常在`context.xml`或`server.xml`文件中完成,包括设置数据库URL、用户名、密码、最大连接数、最小连接数等参数。配置完成后,应用可以通过JNDI查找来获取数据源,然后通过数据源创建和管理数据库连接。...

    jsp-tomcat安装包-8.5.94

    3. 修改`conf/server.xml`配置文件以设置端口、数据源等。 4. 使用bin目录下的启动脚本来启动Tomcat服务器。 5. 浏览器访问`http://localhost:8080`(默认端口)验证Tomcat是否正常运行。 6. 将JSP应用部署到`...

    官方原版apache-tomcat-9.0.34.tar.gz

    8. **JNDI(Java Naming and Directory Interface)**:Tomcat支持JNDI,可以用来查找和绑定资源,如数据源、邮件会话等。这些资源可以在server.xml或context.xml中配置。 9. **集群与负载均衡**:Tomcat支持集群...

    windows安装版-tomcat8.5.57.zip

    9. **JNDI资源**:Tomcat提供了JNDI(Java Naming and Directory Interface)服务,允许在服务器中注册和查找资源,如数据源、邮件会话等。 10. **更新与升级**:当新的Tomcat版本发布时,可以通过下载新的ZIP文件...

    Tomcat连接池配置方法详解 源代码 JSP context.xml

    `context.xml`是Tomcat服务器配置的一部分,用于定义应用级别的资源,如数据源。文件内容如下: ```xml &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;WatchedResource&gt;WEB-INF/web.xml name="myoracle" auth=...

    apache-tomcat-8.5.27.tar.gz

    此外,还支持JNDI(Java Naming and Directory Interface)服务,允许应用程序查找和使用资源,如数据源和邮件会话。 总之,Apache Tomcat 8.5.27是一个强大而灵活的Java Web服务器,适合开发和部署Java应用。对于...

    tomcat8 JNDI数据源加密

    TOMCAT8 JNDI对用户名和密码加密

    apache-tomcat-8.5.92.tar.gz

    3. **context.xml**:配置特定Context的属性,如数据源和Session配置。 4. **tomcat-users.xml**:定义管理员和用户的角色及密码,控制管理界面的访问权限。 对于开发者而言,Tomcat还提供了丰富的管理工具,如`...

    apache-tomcat-8.5.47.tar.gz

    这里可以定义端口号、设置虚拟主机、添加或删除连接器、配置数据源等。 8. **安全性与权限** 在生产环境中,确保正确配置用户访问控制、SSL/TLS加密以及限制不必要的网络访问是非常重要的。这通常涉及到修改`conf/...

Global site tag (gtag.js) - Google Analytics