服务器之家:专注于服务器技术及软件下载分享
分类导航

云服务器|WEB服务器|FTP服务器|邮件服务器|虚拟主机|服务器安全|DNS服务器|服务器知识|Nginx|IIS|Tomcat|

服务器之家 - 服务器技术 - Tomcat - Tomcat 多个应用配置方法

Tomcat 多个应用配置方法

2021-08-05 17:48Tomcat教程网 Tomcat

Tomcat 多个应用配置方法,需要的朋友可以参考下。

复制代码 代码如下:


<?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" />
</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 server="mws" address="127.0.0.1" port="80" maxHttpHeaderSize="8192" maxThreads="1024"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
compression="on" compressableMimeType="text/html,text/xml,text/plain" bufferSize="10240" 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" />
-->

<!-- 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="news.sososteel.com" appBase=""
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/export/wwwroot/news.sososteel.com" debug="0">
</Context>
</Host>
<Host name="market.sososteel.com" appBase=""
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/export/wwwroot/market.sososteel.com" debug="0">
</Context>
</Host>
<Host name="baike.sososteel.com" appBase=""
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/export/wwwroot/baike.sososteel.com" debug="0">
</Context>
</Host>
<Host name="www.sososteel.com" appBase=""
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/export/wwwroot/www.sososteel.com" debug="0">
</Context>
</Host>
<Host name="user.service.sososteel.com" appBase=""
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/export/wwwroot/user.service.sososteel.com" debug="0">
</Context>
</Host>
<Host name="www.steelphone.com" appBase=""
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/export/wwwroot/www.steelphone.com" debug="0">
</Context>
</Host>

</Engine>
</Service>
</Server>

延伸 · 阅读

精彩推荐
  • Tomcat如何查看tomcat的控制台输出的方法

    如何查看tomcat的控制台输出的方法

    这篇文章主要介绍了如何查看tomcat的控制台输出的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧...

    CaiCaiNeo11932021-08-29
  • TomcatTomcat整体结构简单介绍

    Tomcat整体结构简单介绍

    这篇文章主要介绍了Tomcat整体结构简单介绍,Tomcat的本质是一个Servlet容器。一个Servlet能做的事情是:处理请求资源,并为客户端填充response对象,需要的朋友...

    叫我田露也行12302021-09-07
  • TomcatEclipse创建tomcat实现过程原理详解

    Eclipse创建tomcat实现过程原理详解

    这篇文章主要介绍了Eclipse创建tomcat实现过程原理详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以...

    海绵般汲取11642021-09-16
  • Tomcat解决Tomcat的maxPostSize属性的配置需要注意的问题

    解决Tomcat的maxPostSize属性的配置需要注意的问题

    这篇文章主要介绍了解决Tomcat的maxPostSize属性的配置需要注意的问题,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋...

    life is wonderful12012021-09-13
  • TomcatTomcat服务器的安全设置

    Tomcat服务器的安全设置

    tomcat是一个开源Web服务器,基于Tomcat的Web运行效率高,可以在一般的硬件平台上流畅运行,因此,颇受Web站长的青睐。不过,在默认配置下其存在一定的安...

    IT专家网9002021-08-03
  • TomcatTomcat CentOS安装实现过程图解

    Tomcat CentOS安装实现过程图解

    这篇文章主要介绍了Tomcat CentOS安装实现过程图解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考...

    agrin5842021-09-15
  • Tomcat一次tomcat源码启动控制台中文乱码的调试过程记录

    一次tomcat源码启动控制台中文乱码的调试过程记录

    平时在使用tomcat做一些服务的时候经常遇到各种乱码问题,下面这篇文章主要给大家介绍了一次tomcat源码启动控制台中文乱码的调试过程,需要的朋友可以...

    zhoutaoping199211852021-09-24
  • TomcatTomcat安装配置方法图文教程

    Tomcat安装配置方法图文教程

    这篇文章主要为大家详细介绍了Tomcat安装配置方法图文教程,java环境变量如何配置,Eclipse安装配置方法图文教程 ,为大家分享了三个教程,感兴趣的小伙...

    Tomcat教程网13292021-08-11