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>

(0)

相关推荐

  • 浅析JDK和Tomcat的安装与配置方法

    一,JDK环境变量;下载地址:HTTP://pan.baidu.com/s/1bpG3KYz 1,新建变量名:JAVA_HOME,变量值:C:\ Program Files \ Java \ jdk1.8.0_31 2,新建变量名:CLASSPATH,变量值:;%JAVA_HOME%\ lib中 3,打开PATH,添加变量值:%JAVA_HOME%\ bin中;%JAVA_HOME%\ JRE \仓 备注: 1,%JAVA_HOME%就是引用前面指定的JAVA_HOME,AVA_HOME就是jd

  • 关于JDK+Tomcat+eclipse+MyEclipse的配置方法,看这篇够了

    Eclipse 最新版本 Eclipse Neon,这个首次鼓励用户使用 Eclipse Installer 来做安装,这是一种由Eclipse Oomph提供的新技术,它通过提供一个很小的安装器来使得各种工具可以按需下载和安装. Eclipse 是基于 Java 的可扩展开发平台,所以安装 Eclipse 前你需要确保你的电脑已安装 JDK.接下来给大家介绍JDK Tomcat eclipse MyEclipse配置方法. 1.jdk的配置 我用的是jdk1.6版本,与jdk1.5方法相同.执

  • tomcat以及tomcat环境变量安装配置方法教程

    我们下载安装了tomcat,那么tomcat环境变量配置怎么配置?下面小编就和大家分享下tomcat环境变量的配置. tomcat安装版本 1.JDK:版本为jdk-7-windows-i586.exe    下载地址http://www.oracle.com/technetwork/java/javase/downloads/index.html 2.tomcat:版本为apache-tomcat-7.0.33-windows-x86.zip    下载地址http://tomcat.apac

  • tomcat虚拟路径的配置方法汇总

    一般我们都是直接引用webapps下面的web项目,如果我们要部署一个在其它地方的WEB项目,这就要在TOMCAT中设置虚拟路径了,Tomcat的加载web顺序是先加载 $Tomcat_home$\conf\Catalina\localhost下面的xml文件(文件中配置了web项目所在路径),然后再加载webapps下的web项目. 假如我们要部署d:\project\下面的XXX项目(XXX为项目名). 这时我们有两种方法: 方法一: 在$Tomcat_home$\conf\Catalina

  • 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 copyrigh

  • tomcat设置gzip压缩的原理及配置方法

    原理简介 HTTP 压缩可以大大提高浏览网站的速度,它的原理是,在客户端请求服务器对应资源后,从服务器端将资源文件压缩,再输出到客户端,由客户端的浏览器负责解压缩并浏览.相对于普通的浏览过程HTML ,CSS,Javascript , Text ,它可以节省40%左右的流量.更为重要的是,它可以对动态生成的,包括CGI.PHP , JSP , ASP , Servlet,SHTML等输出的网页也能进行压缩,压缩效率也很高. 配置方法 Tomcat5.0以后的版本是支持对输出内容进行压缩的,使用的

  • Tomcat安装配置方法图文教程

    用来进行web开发的工具有很多,Tomcat是其中一个开源的且免费的java Web服务器,是Apache软件基金会的项目.电脑上安装配置Tomcat的方法和java有些相同,不过首先需要配置好java的环境才行,点击此文查看:java环境变量如何配置. 接下来安装配置Tomcat: 1.下载Tomcat文件,文件是一个exe的安装文件,下载后直接安装即可. 下载地址在百度输入Tomcat进入官网即可找到下载文件.安装文件没有什么技巧,一直点击下一步即可. 2.同样安装时注意安装目录,因为一会要

  • Tomcat数据源配置方法_JBuilder中

    其实tomcat中配置数据源有好几中方式,很灵活,所以也容易相互整窜,个人认为比较简单的方法就是在tomcat下的conf文件夹下的server.xml增加 复制代码 代码如下: <Context path="/test" docBase="test" debug= "99" reloadable="true" crossContext="true" verbosity="DEBUG&quo

  • tomcat+nginx域名配置方法

    大多数时候我们一台服务器会放置多个tomcat,这时如何通过域名的方式(不加端口号)访问tomcat下的某个项目,通常情况下是修改tomcat端口为80,但对多tomcat有很多呕病,比如你要解决80端口被占用的情况,本文就不细说了. 下面说说如何通过nginx代理的方式进行域名访问 找到nginx/conf/nginx.conf,做如下关键配置: upstream xx{ #配置upstream节点,这里节点名为"xx" server 116.255.111.111:8080; }

  • 基于tomcat映射路径配置方法分享

    tomcat请求头配置 在使用postman测试的时候(携带参数)我们经常会发现浏览器一个错误:request header is too large,意思是请求头字段太长了.在这里需要配置下tomcat请求头长度. tomcat-service.xml <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443&q

随机推荐