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

云服务器|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学习javaweb如何配置Tomcat的热启动

    学习javaweb如何配置Tomcat的热启动

    学习javaweb的时候每次更改项目都需要重新部署项目,如此一来比较麻烦,使用tomcat的热启动就可以解决这个问题...

    whsnow12072021-08-04
  • Tomcattomcat 6.0.20在一个机器上安装多个服务的方法

    tomcat 6.0.20在一个机器上安装多个服务的方法

    本文主要为大家介绍tomcat 6.0.20在一个机器上安装多个服务的方法,当前前提是你已经可以同时运行他们了,他们的端口不能相同,这里只是解释如何把它们...

    Tomcat教程网10052021-08-03
  • Tomcat如何将Tomcat设置为自动启动的服务最快捷方法

    如何将Tomcat设置为自动启动的服务最快捷方法

    这篇文章主要介绍了如何将Tomcat设置为自动启动的服务最快捷方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧...

    锋齐叶落5352021-09-03
  • TomcatTomcat目录结构详解

    Tomcat目录结构详解

    Tomcat 服务器是一个免费的开放源代码的 Web 应用服务器,学习tomcat目录结构十分有必要,今天小编给大家带来了详细教程,感兴趣的朋友一起看看吧...

    ThinkWon6712021-09-09
  • Tomcat如何查看tomcat的控制台输出的方法

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

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

    CaiCaiNeo11972021-08-29
  • Tomcat浅谈Tomcat多层容器的设计

    浅谈Tomcat多层容器的设计

    Tomcat的容器用来装载Servlet。那Tomcat的Servlet容器是如何设计的呢,本文就详细的来介绍一下,具有一定的参考价值,感兴趣的可以了解一下...

    JavaEdge.9612021-09-26
  • TomcatTomcat服务器搭建教程

    Tomcat服务器搭建教程

    这篇文章主要为大家详细介绍了Tomcat服务器搭建教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...

    Watom_66310452021-08-20
  • TomcatTomcat正常访问localhost报404问题解决

    Tomcat正常访问localhost报404问题解决

    这篇文章主要介绍了Tomcat正常访问localhost报404问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友...

    小明Style5592021-09-23