用户不充电车不动 發表於 2022-10-18 17:54:00

Tomcat修改端口、添加域名访问

<h1>一、修改改端口</h1>
<h2>1、修改默认访问端口8080,改为80</h2>
<p><span style="font-size: 16px"># vim /usr/local/tomcat/conf/server.xml&nbsp; &nbsp;(路径是自己的安装目录)</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px">&lt;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"/&gt;



修改端口

&lt;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"/&gt;

这样的话,在输入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">&lt;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> /&gt;

&lt;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> /&gt;</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&nbsp;&nbsp;(路径是自己的安装目录)</span></p>
<p><span style="font-size: 16px">添加HOST</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px">&lt;Host name="<span style="color: rgba(255, 0, 0, 1)"><strong>localhost</strong></span>"appBase="webapps"
            unpackWARs="true" autoDeploy="true"&gt;<br><br>       &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" /&gt;

      &lt;/Host&gt;</span></pre>
</div>
<p><span style="font-size: 16px">改为:</span></p>
<div class="cnblogs_code">
<pre><span style="font-size: 14px">&lt;Host name="<strong><span style="color: rgba(255, 0, 0, 1)">www.myweb.com</span></strong>"appBase="webapps"
            unpackWARs="true" autoDeploy="true"&gt;</span><br><span style="font-size: 14px">
      &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" /&gt;

      &lt;/Host&gt;</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">&lt;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>&gt;
&lt;Alias&gt;<strong><span style="color: rgba(255, 0, 0, 1)">www.wtf1.com</span></strong>&lt;/Alias&gt;
   &lt;Alias&gt;<strong><span style="color: rgba(255, 0, 0, 1)">www.wtf2.com</span></strong>&lt;/Alias&gt;
&lt;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>/&gt;
&lt;/Host&gt;</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>&lt;Host&gt;&lt;/Host&gt;</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">&lt;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>&gt;
      &lt;Context path=<strong>"/"</strong> docBase=<strong>"<span style="color: rgba(255, 0, 0, 1)">app1</span>"</strong> debug="0" reloadable="true" /&gt;&nbsp;


      &lt;!--<span style="color: rgba(0, 0, 0, 1)"> SingleSignOn valve, share authentication between web applications
             Documentation at: </span>/docs/config/valve.html --&gt;
      &lt;!--
      &lt;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> /&gt;
      --&gt;

      &lt;!--<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> --&gt;
      &lt;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 &amp;quot;%r&amp;quot; %s %b</span><span style="color: rgba(128, 0, 0, 1)">"</span> /&gt;

      &lt;/Host&gt;<br></span></pre>
<pre><span style="font-size: 14px">&lt;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"&gt;
      &lt;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" /&gt;&nbsp;


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

      &lt;!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" --&gt;
      &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" /&gt;

      &lt;/Host&gt;</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 节点:

&lt;Host name="localhost" appBase="webapps"
      unpackWARs="true" autoDeploy="true"&gt;<br>   &lt;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"&gt;&lt;/Context&gt;

&lt;/Host&gt;</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>&lt;Context&gt;<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>&nbsp;<img src="https://img2022.cnblogs.com/blog/1319564/202210/1319564-20221018232023916-817967620.png"></p>
<p>&nbsp;server.xml文件:</p>
<div class="cnblogs_code">
<pre>&lt;?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>?&gt;
&lt;!--<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>--&gt;
&lt;!-- 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>--&gt;
&lt;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>&gt;
&lt;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> /&gt;
&lt;!-- Security listener. Documentation at /docs/config/<span style="color: rgba(0, 0, 0, 1)">listeners.html
</span>&lt;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> /&gt;
--&gt;
&lt;!-- APR library loader. Documentation at /docs/apr.html --&gt;
&lt;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> /&gt;
&lt;!-- Prevent memory leaks due to use of particular java/javax APIs--&gt;
&lt;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> /&gt;
&lt;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> /&gt;
&lt;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> /&gt;

&lt;!--<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>--&gt;
&lt;GlobalNamingResources&gt;
    &lt;!--<span style="color: rgba(0, 0, 0, 1)"> Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    </span>--&gt;
    &lt;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> /&gt;
&lt;/GlobalNamingResources&gt;

&lt;!-- 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>--&gt;
<span style="color: rgba(0, 0, 255, 1)">&lt;Service name="Catalina1"&gt;</span>

    &lt;!--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--&gt;
    &lt;!--
    &lt;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>/&gt;
    --&gt;


    &lt;!-- 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>
    --&gt;
    &lt;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> /&gt;
    &lt;!-- 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--&gt;
    &lt;!--
<span style="color: rgba(0, 0, 255, 1)">    &lt;Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" /&gt;</span>
    --&gt;
    &lt;!-- 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>--&gt;
    &lt;!--
    &lt;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>&gt;
      &lt;SSLHostConfig&gt;
            &lt;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> /&gt;
      &lt;/SSLHostConfig&gt;
    &lt;/Connector&gt;
    --&gt;
    &lt;!-- 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>--&gt;
    &lt;!--
    &lt;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> &gt;
      &lt;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> /&gt;
      &lt;SSLHostConfig&gt;
            &lt;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> /&gt;
      &lt;/SSLHostConfig&gt;
    &lt;/Connector&gt;
    --&gt;

    &lt;!-- 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> --&gt;
    &lt;!--
    &lt;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> /&gt;
    --&gt;

    &lt;!--<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 --&gt;

    &lt;!-- You should set jvmRoute to support load-<span style="color: rgba(0, 0, 0, 1)">balancing via AJP ie :
    </span>&lt;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>&gt;
    --&gt;
<span style="color: rgba(0, 0, 255, 1)">    &lt;Engine name="Catalina1" defaultHost="www.wtf1.com"&gt;</span>

      &lt;!--<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) --&gt;
      &lt;!--
      &lt;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>/&gt;
      --&gt;

      &lt;!--<span style="color: rgba(0, 0, 0, 1)"> Use the LockOutRealm to prevent attempts to guess user passwords
         via a brute</span>-force attack --&gt;
      &lt;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>&gt;
      &lt;!-- 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.--&gt;
      &lt;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>/&gt;
      &lt;/Realm&gt;

<span style="color: rgba(0, 0, 255, 1)">      &lt;Host name="www.wtf1.com"appBase="webapps"
            unpackWARs="true" autoDeploy="true"&gt;
      &lt;Context path="/" docBase="/usr/local/tomcat/myapps/recruit" debug="0" reloadable="true" /&gt;</span>

      &lt;!--<span style="color: rgba(0, 0, 0, 1)"> SingleSignOn valve, share authentication between web applications
             Documentation at: </span>/docs/config/valve.html --&gt;
      &lt;!--
      &lt;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> /&gt;
      --&gt;

      &lt;!--<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> --&gt;
      &lt;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 &amp;quot;%r&amp;quot; %s %b</span><span style="color: rgba(128, 0, 0, 1)">"</span> /&gt;

      &lt;/Host&gt;
    &lt;/Engine&gt;
&lt;/Service&gt;

<span style="color: rgba(0, 0, 255, 1)"> &lt;Service name="Catalina2"&gt;
</span>
    &lt;!--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--&gt;
    &lt;!--
    &lt;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>/&gt;
    --&gt;


    &lt;!-- 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>
    --&gt;
<span style="color: rgba(0, 0, 255, 1)">    &lt;Connector port="8090" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" /&gt;</span>
    &lt;!-- 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--&gt;
    &lt;!--
    &lt;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> /&gt;
    --&gt;
    &lt;!-- 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>--&gt;
    &lt;!--
    &lt;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>&gt;
      &lt;SSLHostConfig&gt;
            &lt;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> /&gt;
      &lt;/SSLHostConfig&gt;
    &lt;/Connector&gt;
    --&gt;
    &lt;!-- 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>--&gt;
    &lt;!--
    &lt;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> &gt;
      &lt;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> /&gt;
      &lt;SSLHostConfig&gt;
            &lt;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> /&gt;
      &lt;/SSLHostConfig&gt;
    &lt;/Connector&gt;
    --&gt;

    &lt;!-- 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> --&gt;
    &lt;!--
    &lt;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> /&gt;
    --&gt;

    &lt;!--<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 --&gt;

    &lt;!-- You should set jvmRoute to support load-<span style="color: rgba(0, 0, 0, 1)">balancing via AJP ie :
    </span>&lt;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>&gt;
    --&gt;
<span style="color: rgba(0, 0, 255, 1)">    &lt;Engine name="Catalina2" defaultHost="www.wtf2.com"&gt;</span>

      &lt;!--<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) --&gt;
      &lt;!--
      &lt;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>/&gt;
      --&gt;

      &lt;!--<span style="color: rgba(0, 0, 0, 1)"> Use the LockOutRealm to prevent attempts to guess user passwords
         via a brute</span>-force attack --&gt;
      &lt;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>&gt;
      &lt;!-- 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.--&gt;
      &lt;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>/&gt;
      &lt;/Realm&gt;

<span style="color: rgba(0, 0, 255, 1)">      &lt;Host name="www.wtf2.com"appBase="webapps"
            unpackWARs="true" autoDeploy="true"&gt;
      &lt;Context path="/" docBase="/usr/local/tomcat/myapps/ssms" debug="0" reloadable="true" /&gt;
</span>
      &lt;!--<span style="color: rgba(0, 0, 0, 1)"> SingleSignOn valve, share authentication between web applications
             Documentation at: </span>/docs/config/valve.html --&gt;
      &lt;!--
      &lt;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> /&gt;
      --&gt;

      &lt;!--<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> --&gt;
      &lt;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 &amp;quot;%r&amp;quot; %s %b</span><span style="color: rgba(128, 0, 0, 1)">"</span> /&gt;

      &lt;/Host&gt;
    &lt;/Engine&gt;
&lt;/Service&gt;
&lt;/Server&gt;</pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div>&nbsp;</div>
<div>
<p>&nbsp;</p>
<br><br></div>




</div>




</div>




</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="blog_post_info_block">&nbsp;</div><br><br>
来源:https://www.cnblogs.com/elfin/p/16800012.html
頁: [1]
查看完整版本: Tomcat修改端口、添加域名访问