婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > tomcat同時使用http和https訪問的配置方法

tomcat同時使用http和https訪問的配置方法

熱門標(biāo)簽:電銷機器人怎么接線路 撫順地圖標(biāo)注 新余高德地圖標(biāo)注怎么修改 電銷機器人價值 高德地圖標(biāo)注好做嗎 如何分析地圖標(biāo)注 達亞電銷機器人官網(wǎng) 外呼系統(tǒng)坐席費計入會計哪個科目 大連400電話如何申請

針對一個tomcat中有的項目需要使用ssl加密有些可以直接訪問的情況,可通過修改tomcat/conf下的server.xml來實現(xiàn)。具體配置可參考下面這段代碼,注意<Service name=”Catalina1″>這個標(biāo)簽中的配置。

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
      type="org.apache.catalina.UserDatabase"
      description="User database that can be updated and saved"
      factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
      pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
 
  <Service name="Catalina">
    <!-- 此處使用了ssl配置,需用https才可訪問 -->
    <Connector port="8284" protocol="HTTP/1.1"
      connectionTimeout="20000"
      redirectPort="8443" URIEncoding="UTF-8"
      clientAuth="false" sslProtocol="TLS"
      SSLEnabled="true" scheme="https" secure="true"
      keystoreFile="conf/tomcat.jks" keystorePass="pico2012server"
      truststoreFile="conf/tomcat.jks" truststorePass="pico2012server"
      />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
 
    <Engine name="Catalina" defaultHost="localhost">
 
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
          resourceName="UserDatabase"/>
      </Realm>
 
      <Host name="localhost" appBase="webapps"
        unpackWARs="true" autoDeploy="true">
        <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>
    </Engine>
  </Service>
 
  <!-- 加入一個新的網(wǎng)站服務(wù)配置,每個service都可以單獨配置工程加載目錄、端口等 -->
  <Service name="Catalina1">
    <!-- 此處表示加載的工程仍使用原始的http方式訪問 -->
    <Connector port="8484" protocol="HTTP/1.1"
      connectionTimeout="20000"
      redirectPort="8443" URIEncoding="UTF-8"
      />
    <Connector port="18009" protocol="AJP/1.3" redirectPort="18443" />
 
    <Engine name="Catalina1" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
          resourceName="UserDatabase"/>
      </Realm>
      <!-- 該service加載的工程放置目錄,與webapps同目錄的webapps1 -->
      <Host name="localhost" appBase="webapps1"
        unpackWARs="true" autoDeploy="true">
 
        <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" />
        <!-- 此處要顯示的指定加載webapps1下的GS-Web工程 -->
        <Context path="" docBase="GS-Web" debug="0" reloadable="true"/>
      </Host>
    </Engine>
  </Service>
</Server>

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

標(biāo)簽:新鄉(xiāng) 楊凌 湖南 衡水 南通 遼源 黃石 海東

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《tomcat同時使用http和https訪問的配置方法》,本文關(guān)鍵詞  tomcat,同時,使用,http,和,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《tomcat同時使用http和https訪問的配置方法》相關(guān)的同類信息!
  • 本頁收集關(guān)于tomcat同時使用http和https訪問的配置方法的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 商南县| 乌兰县| 玉龙| 沽源县| 花莲县| 方城县| 宜川县| 彝良县| 白水县| 高碑店市| 兴安盟| 巴彦淖尔市| 克山县| 嘉义县| 久治县| 天峨县| 莒南县| 云林县| 松阳县| 怀柔区| 林甸县| 富锦市| 南郑县| 彰化县| 泾源县| 滦平县| 读书| 南京市| 晴隆县| 丹凤县| 平遥县| 兴义市| 门头沟区| 巴中市| 泸州市| 古蔺县| 霍邱县| 辽宁省| 临武县| 龙岩市| 海丰县|