Tomcat修改端口、添加域名访问
<h1>一、修改改端口</h1><h2>1、修改默认访问端口8080,改为80</h2>
<p><span style="font-size: 16px"># vim /usr/local/tomcat/conf/server.xml (路径是自己的安装目录)</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><Connector port="<span style="color: rgba(255, 0, 0, 1)"><strong>8080</strong></span>" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
修改端口
<Connector port="<span style="color: rgba(255, 0, 0, 1)"><strong>80</strong></span>" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
这样的话,在输入127.0.0.1之后就可以省略:80端口 </span></pre>
</div>
<h2>2、多端口访问</h2>
<p><span style="font-size: 16px">当一个项目需要使用多个端口号去访问的时候,只需要在<code>Service</code></span></p>
<p><img src="https://img2022.cnblogs.com/blog/1319564/202210/1319564-20221018160802908-2054696717.png"><br><span style="font-size: 16px">标签下进行这样简单的配置一下就好:</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><Connector port=<span style="color: rgba(128, 0, 0, 1)">"</span><strong><span style="color: rgba(255, 0, 0, 1)">8080</span></strong><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">HTTP/1.1</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
connectionTimeout</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">20000</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
redirectPort</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<Connector port=<span style="color: rgba(128, 0, 0, 1)">"</span><strong><span style="color: rgba(255, 0, 0, 1)">808080</span></strong><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">HTTP/1.1</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
connectionTimeout</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">20000</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
redirectPort</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> /></span></pre>
</div>
<p><span style="font-size: 16px">这样就保证了当Tomcat运行起来的时候,同时监听多个端口,通过8080和808080端口来访问项目。</span></p>
<h1>二、修改域名访问</h1>
<h2>1、修改域名(单域名)</h2>
<p><span style="font-size: 16px"># vim /usr/local/tomcat/conf/server.xml (路径是自己的安装目录)</span></p>
<p><span style="font-size: 16px">添加HOST</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><Host name="<span style="color: rgba(255, 0, 0, 1)"><strong>localhost</strong></span>"appBase="webapps"
unpackWARs="true" autoDeploy="true"><br><br> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host></span></pre>
</div>
<p><span style="font-size: 16px">改为:</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><Host name="<strong><span style="color: rgba(255, 0, 0, 1)">www.myweb.com</span></strong>"appBase="webapps"
unpackWARs="true" autoDeploy="true"></span><br><span style="font-size: 14px">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host></span></pre>
</div>
<h2>2、多域名访问(端口相同)</h2>
<p><span style="font-size: 16px">配置项目的多域名的访问,最简单的方式就是在<code>Host</code></span><br><span style="font-size: 16px">标签下配置<code>Alias</code></span><br><span style="font-size: 16px">标签:</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><Host name=<span style="color: rgba(128, 0, 0, 1)">"</span><strong><span style="color: rgba(255, 0, 0, 1)">www.myweb.com</span></strong><span style="color: rgba(128, 0, 0, 1)">"</span>appBase=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">webapps</span><span style="color: rgba(128, 0, 0, 1)">"</span> unpackWARs=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span> autoDeploy=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
<Alias><strong><span style="color: rgba(255, 0, 0, 1)">www.wtf1.com</span></strong></Alias>
<Alias><strong><span style="color: rgba(255, 0, 0, 1)">www.wtf2.com</span></strong></Alias>
<Context docBase=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">/project</span><span style="color: rgba(128, 0, 0, 1)">"</span> path=<span style="color: rgba(128, 0, 0, 1)">""</span>/>
</Host></span></pre>
</div>
<p><span style="font-size: 16px">可以通过www.myweb.com、www.wtf1.com、www.wtf2.com这些域名来访问项目。</span></p>
<h2>3、不同域名访问不同的内容(端口相同)</h2>
<p><span style="font-size: 16px">如果是将Host的内容复制一份,只修改name属性也可以达到同样的效果。</span></p>
<p><span style="font-size: 16px"><img src="https://img2022.cnblogs.com/blog/1319564/202210/1319564-20221018171102767-790874522.png"></span></p>
<p><span style="font-size: 16px">在里面添加多个<code><Host></Host></code>标签,如下</span></p>
<div id="cnblogs_post_body" class="blogpost-body">
<div id="article_content" class="article_content clearfix csdn-tracking-statistics">
<div id="content_views" class="htmledit_views">
<div>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><Host name=<strong><span style="color: rgba(255, 0, 0, 1)">"www.wtf1.com</span><span style="color: rgba(128, 0, 0, 1)">"</span></strong>appBase=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">webapps</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
unpackWARs</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span> autoDeploy=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
<Context path=<strong>"/"</strong> docBase=<strong>"<span style="color: rgba(255, 0, 0, 1)">app1</span>"</strong> debug="0" reloadable="true" />
<!--<span style="color: rgba(0, 0, 0, 1)"> SingleSignOn valve, share authentication between web applications
Documentation at: </span>/docs/config/valve.html -->
<!--
<Valve className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.authenticator.SingleSignOn</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
-->
<!--<span style="color: rgba(0, 0, 0, 1)"> Access log processes all example.
Documentation at: </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">valve.html
Note: The pattern used is equivalent to using pattern</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">common</span><span style="color: rgba(128, 0, 0, 1)">"</span> -->
<Valve className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.valves.AccessLogValve</span><span style="color: rgba(128, 0, 0, 1)">"</span> directory=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">logs</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
prefix</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">localhost_access_log</span><span style="color: rgba(128, 0, 0, 1)">"</span> suffix=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">.txt</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
pattern</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">%h %l %u %t &quot;%r&quot; %s %b</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</Host><br></span></pre>
<pre><span style="font-size: 14px"><Host name=<span style="color: rgba(156, 62, 193, 1)"><strong>"<span style="color: rgba(255, 0, 0, 1)">www.wtf2.com</span>"</strong></span>appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path=<span style="color: rgba(156, 62, 193, 1)"><strong>"/"</strong></span> docBase=<strong>"<span style="color: rgba(255, 0, 0, 1)">app2</span>"</strong> debug="0" reloadable="true" />
<!-- 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
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host></span></pre>
</div>
<p><span><span style="color: rgba(255, 0, 0, 1); font-size: 18px"><strong>注意:</strong></span><span style="font-size: 16px">2个不同域名访问相同端口的内容不同,但是如果还会使用ip访问的话,还需要在加上一个Host,</span></span></p>
<p><span style="font-size: 16px">如:使用ip访问的话去访问app1;ip访问其host name就是localhost</span></p>
<h1>三、配置 conf/server.xml 文件注意事项</h1>
<p><span style="font-size: 16px">增加 Context 节点,并指定 docBase 为非 webapps 的子目录(建议)</span><br><span style="font-size: 16px">1.新建 ${CATALINA_HOME}/myapps/app1 目录;</span><br><span style="font-size: 16px">2.修改 conf/server.xml 文件,配置 Context 节点,指定 docBase=“${CATALINA_HOME}/myapps/app1”;这里的 ${CATALINA_HOME} 为 tomcat 安装路径,使用时需替换为绝对路径;</span><br><span style="font-size: 16px">3.将 app1.war 放到 ${CATALINA_HOME}/myapps/app1/ 目录下;</span><br><span style="font-size: 16px">4.通过命令 jar xvf App1.war 解压 war 包到当前目录;</span><br><span style="font-size: 16px">5.启动 tomcat;</span><br><span style="font-size: 16px">6.后续 war 包有更新时,重复步骤3、4,不需要再执行第5步,tomcat 会自动重新部署。</span><br><span style="color: rgba(255, 0, 0, 1); font-size: 16px"><strong>注意:docBase 需要设置为绝对路径</strong></span></p>
<p><span style="font-size: 16px">配置示例:</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px">conf/server.xml 文件中的 Host 节点:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"><br> <Context path=<strong>"<span style="color: rgba(255, 0, 0, 1)">/</span>"</strong> docBase=<strong>"<span style="color: rgba(255, 0, 0, 1)">/user/local/tomcat/myapps/app1</span>"</strong> debug="0" reloadable="true"></Context>
</Host></span></pre>
</div>
<p><span style="font-size: 16px">参数:</span></p>
<div class="cnblogs_code">
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">appBase:表示这个目录下面的子目录将自动被部署为应用;</span></span></p>
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">name:为访问项目的默认域名;</span></span></p>
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">unpackWARs:如果为true,则tomcat会自动将WAR文件解压,否则不解压,直接从WAR文件中运行应用程序;</span></span></p>
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">autoDeploy: 显式设置autoDeploy为False。避免了在server.xml中增加Context配置时两次部署相同的Web应用程序;</span></span></p>
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">deployOnStartup:如果此项设为true,表示Tomcat服务器启动时会自动发布appBase目录下所有的Web应用.如果Web应用 中的server.xml没有相应的</span><Context><span style="color: rgba(0, 0, 0, 1)">元素,将采用Tomcat默认的Context </span></span></p>
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">reloadable:如果为true,则tomcat会自动检测应用程序的</span>/WEB-INF/lib 和/WEB-INF/<span style="color: rgba(0, 0, 0, 1)">classes目录的变化,自动装载新的应用程序,我们可以在不重起tomcat的情况下改变应用程序; </span></span></p>
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">docBase:绝对路径;</span></span></p>
<p><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">path: 路径名默认是</span><span style="color: rgba(128, 0, 0, 1)">""</span></span><span style="color: rgba(0, 0, 0, 1)"><span style="font-size: 14px">;</span></span></p>
<p><span style="color: rgba(0, 0, 0, 1)"><span style="font-size: 14px">crosscontext:则可以实现在同一个tomcat下的多个web应用之间实现ServletContext对象访问。该属性主要用于跨应用访问数据,该特性只适用于多个应用程序部署在同一个tomcat下的情形; </span></span></p>
<p><span style="color: rgba(0, 0, 0, 1)"><span style="font-size: 14px">Context:即 Web 应用程序,一个 Context 对应一个 Web 应用程序。</span></span></p>
</div>
<p><strong style="font-size: 18px"><span style="color: rgba(255, 0, 0, 1)">注意:</span></strong></p>
<p><span style="font-size: 16px">conf/server.xml 的 Host 节点的 appBase 指定的目录表示,</span></p>
<p><span style="font-size: 16px">这个目录下面的子目录将自动被部署为应用。</span><br><span style="font-size: 16px">这个目录下面的.war文件将被自动解压缩并部署为应用</span><br><span style="font-size: 16px">而 docBase 只是指向某个应用的目录,可以和 appBase 没有任何关系。特别注意,<span style="color: rgba(255, 0, 0, 1)">如果 docBase 指向的是 webapps 下面的目录,会导致应用被加载两次</span>,引起一系列问题。</span></p>
<h1>四、多Web项目不同域名、端口访问</h1>
</div>
<div>
<p>如果没有搭建dns服务的情况下,在windows下打开hosts(C:/WINDOWS/system32/drivers/etc/hosts),末尾加上192.168.10.10(CentOS7的ip) www.wtf1.com ,保存,</p>
<p>搭建一个虚拟的DNS,实现本地指定域名解析<br>如果之前搭建了DNS服务,windos下的网络适配器DNS改为CentOS的ip即可</p>
<p>centos中vi /etc/hosts</p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><span style="color: rgba(0, 0, 0, 1)">#</span><span style="color: rgba(128, 0, 128, 1)">127.0</span>.<span style="color: rgba(128, 0, 128, 1)">0.1</span><span style="color: rgba(0, 0, 0, 1)"> localhost localhost.localdomain localhost4 localhost4.localdomain4
#::</span><span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)"> localhost localhost.localdomain localhost6 localhost6.localdomain6
</span><strong><span style="color: rgba(255, 0, 0, 1)">192.168.10.10 www.wtf1.com</span></strong><br><strong><span style="color: rgba(255, 0, 0, 1)">192.168.10.10 www.wtf2.com</span></strong></span></pre>
</div>
<p>Windows中,打开hosts(C:/WINDOWS/system32/drivers/etc/hosts)</p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px"><span style="color: rgba(128, 0, 128, 1)">127.0</span>.<span style="color: rgba(128, 0, 128, 1)">0.1</span><span style="color: rgba(0, 0, 0, 1)"> activate.navicat.com
</span><span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">10.10</span><span style="color: rgba(0, 0, 0, 1)"> www.wtf1.com
</span><span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">10.10</span> www.wtf2.com</span></pre>
</div>
<p>需要修改conf下的server.xml</p>
<p><img src="https://img2022.cnblogs.com/blog/1319564/202210/1319564-20221018231936263-1020886349.png"></p>
<p> <img src="https://img2022.cnblogs.com/blog/1319564/202210/1319564-20221018232023916-817967620.png"></p>
<p> server.xml文件:</p>
<div class="cnblogs_code">
<pre><?xml version=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">1.0</span><span style="color: rgba(128, 0, 0, 1)">"</span> encoding=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">UTF-8</span><span style="color: rgba(128, 0, 0, 1)">"</span>?>
<!--<span style="color: rgba(0, 0, 0, 1)">
Licensed to the Apache Software Foundation (ASF) under one or </span><span style="color: rgba(0, 0, 255, 1)">more</span><span style="color: rgba(0, 0, 0, 1)">
contributor license agreements.See the NOTICE </span><span style="color: rgba(0, 0, 255, 1)">file</span><span style="color: rgba(0, 0, 0, 1)"> distributed with
this work </span><span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> additional information regarding copyright ownership.
The ASF licenses this </span><span style="color: rgba(0, 0, 255, 1)">file</span> to You under the Apache License, Version <span style="color: rgba(128, 0, 128, 1)">2.0</span><span style="color: rgba(0, 0, 0, 1)">
(the </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">License</span><span style="color: rgba(128, 0, 0, 1)">"</span>); you may not use this <span style="color: rgba(0, 0, 255, 1)">file</span> except <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> compliance with
the License.You may obtain a copy of the License at
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">www.apache.org/licenses/LICENSE-2.0</span>
<span style="color: rgba(0, 0, 0, 1)">
Unless required by applicable law or agreed to </span><span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> writing, software
distributed under the License is distributed on an </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">AS IS</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License </span><span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> the specific language governing permissions and
limitations under the License.
</span>-->
<!-- Note:A <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Server</span><span style="color: rgba(128, 0, 0, 1)">"</span> is not itself a <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Container</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">, so you may not
define subcomponents such as </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Valves</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> at this level.
Documentation at </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">server.html
</span>-->
<Server port=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8005</span><span style="color: rgba(128, 0, 0, 1)">"</span> shutdown=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">SHUTDOWN</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
<Listener className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.startup.VersionLoggerListener</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<!-- Security listener. Documentation at /docs/config/<span style="color: rgba(0, 0, 0, 1)">listeners.html
</span><Listener className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.security.SecurityListener</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
-->
<!-- APR library loader. Documentation at /docs/apr.html -->
<Listener className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.core.AprLifecycleListener</span><span style="color: rgba(128, 0, 0, 1)">"</span> SSLEngine=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">on</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.core.JreMemoryLeakPreventionListener</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<Listener className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.mbeans.GlobalResourcesLifecycleListener</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<Listener className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.core.ThreadLocalLeakPreventionListener</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<!--<span style="color: rgba(0, 0, 0, 1)"> Global JNDI resources
Documentation at </span>/docs/jndi-resources-<span style="color: rgba(0, 0, 0, 1)">howto.html
</span>-->
<GlobalNamingResources>
<!--<span style="color: rgba(0, 0, 0, 1)"> Editable user database that can also be used by
UserDatabaseRealm to authenticate users
</span>-->
<Resource name=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">UserDatabase</span><span style="color: rgba(128, 0, 0, 1)">"</span> auth=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Container</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
type</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.UserDatabase</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
description</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">User database that can be updated and saved</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
factory</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.users.MemoryUserDatabaseFactory</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
pathname</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/tomcat-users.xml</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</GlobalNamingResources>
<!-- A <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Service</span><span style="color: rgba(128, 0, 0, 1)">"</span> is a collection of one or <span style="color: rgba(0, 0, 255, 1)">more</span> <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Connectors</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> that share
a single </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Container</span><span style="color: rgba(128, 0, 0, 1)">"</span> Note:A <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Service</span><span style="color: rgba(128, 0, 0, 1)">"</span> is not itself a <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Container</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">,
so you may not define subcomponents such as </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Valves</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> at this level.
Documentation at </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">service.html
</span>-->
<span style="color: rgba(0, 0, 255, 1)"><Service name="Catalina1"></span>
<!--The connectors can use a shared executor, you can define one or <span style="color: rgba(0, 0, 255, 1)">more</span> named thread pools-->
<!--
<Executor name=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">tomcatThreadPool</span><span style="color: rgba(128, 0, 0, 1)">"</span> namePrefix=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">catalina-exec-</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
maxThreads</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">150</span><span style="color: rgba(128, 0, 0, 1)">"</span> minSpareThreads=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">4</span><span style="color: rgba(128, 0, 0, 1)">"</span>/>
-->
<!-- A <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Connector</span><span style="color: rgba(128, 0, 0, 1)">"</span> represents an endpoint by <span style="color: rgba(0, 0, 255, 1)">which</span><span style="color: rgba(0, 0, 0, 1)"> requests are received
and responses are returned. Documentation at :
Java HTTP Connector: </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">http.html
Java AJPConnector: </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">ajp.html
APR (HTTP</span>/AJP) Connector: /docs/<span style="color: rgba(0, 0, 0, 1)">apr.html
Define a non</span>-SSL/TLS HTTP/<span style="color: rgba(128, 0, 128, 1)">1.1</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8080</span>
-->
<Connector port=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8080</span><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">HTTP/1.1</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
connectionTimeout</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">20000</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
redirectPort</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<!-- A <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Connector</span><span style="color: rgba(128, 0, 0, 1)">"</span> using the shared thread pool-->
<!--
<span style="color: rgba(0, 0, 255, 1)"> <Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" /></span>
-->
<!-- Define an SSL/TLS HTTP/<span style="color: rgba(128, 0, 128, 1)">1.1</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8443</span><span style="color: rgba(0, 0, 0, 1)">
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR</span>/<span style="color: rgba(0, 0, 0, 1)">native
library and the useOpenSSL attribute of the AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
</span>-->
<!--
<Connector port=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.coyote.http11.Http11NioProtocol</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
maxThreads</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">150</span><span style="color: rgba(128, 0, 0, 1)">"</span> SSLEnabled=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
<SSLHostConfig>
<Certificate certificateKeystoreFile=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa.jks</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
type</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">RSA</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</SSLHostConfig>
</Connector>
-->
<!-- Define an SSL/TLS HTTP/<span style="color: rgba(128, 0, 128, 1)">1.1</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8443</span> with HTTP/<span style="color: rgba(128, 0, 128, 1)">2</span><span style="color: rgba(0, 0, 0, 1)">
This connector uses the APR</span>/native implementation <span style="color: rgba(0, 0, 255, 1)">which</span><span style="color: rgba(0, 0, 0, 1)"> always uses
OpenSSL </span><span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
</span>-->
<!--
<Connector port=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.coyote.http11.Http11AprProtocol</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
maxThreads</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">150</span><span style="color: rgba(128, 0, 0, 1)">"</span> SSLEnabled=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span> >
<UpgradeProtocol className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.coyote.http2.Http2Protocol</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<SSLHostConfig>
<Certificate certificateKeyFile=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa-key.pem</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
certificateFile</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa-cert.pem</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
certificateChainFile</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa-chain.pem</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
type</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">RSA</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</SSLHostConfig>
</Connector>
-->
<!-- Define an AJP <span style="color: rgba(128, 0, 128, 1)">1.3</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8009</span> -->
<!--
<Connector protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">AJP/1.3</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
address</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">::1</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
port</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8009</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
redirectPort</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
-->
<!--<span style="color: rgba(0, 0, 0, 1)"> An Engine represents the entry point (within Catalina) that processes
every request.The Engine implementation </span><span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at </span>/docs/config/engine.html -->
<!-- You should set jvmRoute to support load-<span style="color: rgba(0, 0, 0, 1)">balancing via AJP ie :
</span><Engine name=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Catalina</span><span style="color: rgba(128, 0, 0, 1)">"</span> defaultHost=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">localhost</span><span style="color: rgba(128, 0, 0, 1)">"</span> jvmRoute=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">jvm1</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
-->
<span style="color: rgba(0, 0, 255, 1)"> <Engine name="Catalina1" defaultHost="www.wtf1.com"></span>
<!--<span style="color: rgba(0, 0, 0, 1)">For clustering, please take a look at documentation at:
</span>/docs/cluster-<span style="color: rgba(0, 0, 0, 1)">howto.html(simple how to)
</span>/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.ha.tcp.SimpleTcpCluster</span><span style="color: rgba(128, 0, 0, 1)">"</span>/>
-->
<!--<span style="color: rgba(0, 0, 0, 1)"> Use the LockOutRealm to prevent attempts to guess user passwords
via a brute</span>-force attack -->
<Realm className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.realm.LockOutRealm</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
<!-- This Realm uses the UserDatabase configured <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the global JNDI
resources under the key </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">UserDatabase</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">.Any edits
that are performed against this UserDatabase are immediately
available </span><span style="color: rgba(0, 0, 255, 1)">for</span> use by the Realm.-->
<Realm className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.realm.UserDatabaseRealm</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
resourceName</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">UserDatabase</span><span style="color: rgba(128, 0, 0, 1)">"</span>/>
</Realm>
<span style="color: rgba(0, 0, 255, 1)"> <Host name="www.wtf1.com"appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/" docBase="/usr/local/tomcat/myapps/recruit" debug="0" reloadable="true" /></span>
<!--<span style="color: rgba(0, 0, 0, 1)"> SingleSignOn valve, share authentication between web applications
Documentation at: </span>/docs/config/valve.html -->
<!--
<Valve className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.authenticator.SingleSignOn</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
-->
<!--<span style="color: rgba(0, 0, 0, 1)"> Access log processes all example.
Documentation at: </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">valve.html
Note: The pattern used is equivalent to using pattern</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">common</span><span style="color: rgba(128, 0, 0, 1)">"</span> -->
<Valve className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.valves.AccessLogValve</span><span style="color: rgba(128, 0, 0, 1)">"</span> directory=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">logs</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
prefix</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">localhost_access_log</span><span style="color: rgba(128, 0, 0, 1)">"</span> suffix=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">.txt</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
pattern</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">%h %l %u %t &quot;%r&quot; %s %b</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</Host>
</Engine>
</Service>
<span style="color: rgba(0, 0, 255, 1)"> <Service name="Catalina2">
</span>
<!--The connectors can use a shared executor, you can define one or <span style="color: rgba(0, 0, 255, 1)">more</span> named thread pools-->
<!--
<Executor name=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">tomcatThreadPool</span><span style="color: rgba(128, 0, 0, 1)">"</span> namePrefix=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">catalina-exec-</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
maxThreads</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">150</span><span style="color: rgba(128, 0, 0, 1)">"</span> minSpareThreads=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">4</span><span style="color: rgba(128, 0, 0, 1)">"</span>/>
-->
<!-- A <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Connector</span><span style="color: rgba(128, 0, 0, 1)">"</span> represents an endpoint by <span style="color: rgba(0, 0, 255, 1)">which</span><span style="color: rgba(0, 0, 0, 1)"> requests are received
and responses are returned. Documentation at :
Java HTTP Connector: </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">http.html
Java AJPConnector: </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">ajp.html
APR (HTTP</span>/AJP) Connector: /docs/<span style="color: rgba(0, 0, 0, 1)">apr.html
Define a non</span>-SSL/TLS HTTP/<span style="color: rgba(128, 0, 128, 1)">1.1</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8080</span>
-->
<span style="color: rgba(0, 0, 255, 1)"> <Connector port="8090" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" /></span>
<!-- A <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Connector</span><span style="color: rgba(128, 0, 0, 1)">"</span> using the shared thread pool-->
<!--
<Connector executor=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">tomcatThreadPool</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
port</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8080</span><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">HTTP/1.1</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
connectionTimeout</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">20000</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
redirectPort</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
-->
<!-- Define an SSL/TLS HTTP/<span style="color: rgba(128, 0, 128, 1)">1.1</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8443</span><span style="color: rgba(0, 0, 0, 1)">
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR</span>/<span style="color: rgba(0, 0, 0, 1)">native
library and the useOpenSSL attribute of the AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
</span>-->
<!--
<Connector port=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.coyote.http11.Http11NioProtocol</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
maxThreads</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">150</span><span style="color: rgba(128, 0, 0, 1)">"</span> SSLEnabled=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
<SSLHostConfig>
<Certificate certificateKeystoreFile=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa.jks</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
type</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">RSA</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</SSLHostConfig>
</Connector>
-->
<!-- Define an SSL/TLS HTTP/<span style="color: rgba(128, 0, 128, 1)">1.1</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8443</span> with HTTP/<span style="color: rgba(128, 0, 128, 1)">2</span><span style="color: rgba(0, 0, 0, 1)">
This connector uses the APR</span>/native implementation <span style="color: rgba(0, 0, 255, 1)">which</span><span style="color: rgba(0, 0, 0, 1)"> always uses
OpenSSL </span><span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
</span>-->
<!--
<Connector port=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.coyote.http11.Http11AprProtocol</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
maxThreads</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">150</span><span style="color: rgba(128, 0, 0, 1)">"</span> SSLEnabled=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">true</span><span style="color: rgba(128, 0, 0, 1)">"</span> >
<UpgradeProtocol className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.coyote.http2.Http2Protocol</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
<SSLHostConfig>
<Certificate certificateKeyFile=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa-key.pem</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
certificateFile</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa-cert.pem</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
certificateChainFile</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">conf/localhost-rsa-chain.pem</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
type</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">RSA</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</SSLHostConfig>
</Connector>
-->
<!-- Define an AJP <span style="color: rgba(128, 0, 128, 1)">1.3</span> Connector on port <span style="color: rgba(128, 0, 128, 1)">8009</span> -->
<!--
<Connector protocol=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">AJP/1.3</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
address</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">::1</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
port</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8009</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
redirectPort</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">8443</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
-->
<!--<span style="color: rgba(0, 0, 0, 1)"> An Engine represents the entry point (within Catalina) that processes
every request.The Engine implementation </span><span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at </span>/docs/config/engine.html -->
<!-- You should set jvmRoute to support load-<span style="color: rgba(0, 0, 0, 1)">balancing via AJP ie :
</span><Engine name=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">Catalina</span><span style="color: rgba(128, 0, 0, 1)">"</span> defaultHost=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">localhost</span><span style="color: rgba(128, 0, 0, 1)">"</span> jvmRoute=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">jvm1</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
-->
<span style="color: rgba(0, 0, 255, 1)"> <Engine name="Catalina2" defaultHost="www.wtf2.com"></span>
<!--<span style="color: rgba(0, 0, 0, 1)">For clustering, please take a look at documentation at:
</span>/docs/cluster-<span style="color: rgba(0, 0, 0, 1)">howto.html(simple how to)
</span>/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.ha.tcp.SimpleTcpCluster</span><span style="color: rgba(128, 0, 0, 1)">"</span>/>
-->
<!--<span style="color: rgba(0, 0, 0, 1)"> Use the LockOutRealm to prevent attempts to guess user passwords
via a brute</span>-force attack -->
<Realm className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.realm.LockOutRealm</span><span style="color: rgba(128, 0, 0, 1)">"</span>>
<!-- This Realm uses the UserDatabase configured <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the global JNDI
resources under the key </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">UserDatabase</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">.Any edits
that are performed against this UserDatabase are immediately
available </span><span style="color: rgba(0, 0, 255, 1)">for</span> use by the Realm.-->
<Realm className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.realm.UserDatabaseRealm</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
resourceName</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">UserDatabase</span><span style="color: rgba(128, 0, 0, 1)">"</span>/>
</Realm>
<span style="color: rgba(0, 0, 255, 1)"> <Host name="www.wtf2.com"appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/" docBase="/usr/local/tomcat/myapps/ssms" debug="0" reloadable="true" />
</span>
<!--<span style="color: rgba(0, 0, 0, 1)"> SingleSignOn valve, share authentication between web applications
Documentation at: </span>/docs/config/valve.html -->
<!--
<Valve className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.authenticator.SingleSignOn</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
-->
<!--<span style="color: rgba(0, 0, 0, 1)"> Access log processes all example.
Documentation at: </span>/docs/config/<span style="color: rgba(0, 0, 0, 1)">valve.html
Note: The pattern used is equivalent to using pattern</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">common</span><span style="color: rgba(128, 0, 0, 1)">"</span> -->
<Valve className=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">org.apache.catalina.valves.AccessLogValve</span><span style="color: rgba(128, 0, 0, 1)">"</span> directory=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">logs</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
prefix</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">localhost_access_log</span><span style="color: rgba(128, 0, 0, 1)">"</span> suffix=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">.txt</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
pattern</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">%h %l %u %t &quot;%r&quot; %s %b</span><span style="color: rgba(128, 0, 0, 1)">"</span> />
</Host>
</Engine>
</Service>
</Server></pre>
</div>
<p> </p>
<p> </p>
<p> </p>
</div>
<div> </div>
<div>
<p> </p>
<br><br></div>
</div>
</div>
</div>
<p> </p>
<p> </p>
<div id="blog_post_info_block"> </div><br><br>
来源:https://www.cnblogs.com/elfin/p/16800012.html
頁:
[1]