zoukankan      html  css  js  c++  java
  • 域名直接访问项目|Tomcat http 自动跳转Https

    1.域名直接访问项目

     案例:tomcat下域名直接访问项目,或者说,修改tomcat默认欢迎页

     (1).修改server.xml

             添加: <Context path="" docBase="C:TOOLapache-tomcat-8.0.51webappshome" debug="0"/>  目标地址指到:你的项目根路径下C:TOOLapache-tomcat-8.0.51webappshome

     <Host name="localhost"  appBase="webapps"
                unpackWARs="true" autoDeploy="true">
    
        <Context path="" docBase="C:TOOLapache-tomcat-8.0.51webappshome" debug="0"/> 
           
          </Host>

    (2).修改web.xml

    你的初始页面是什么,就改成什么,我的还是index.html,所以保持不变,你的要是login.html,添加一行

    <welcome-file>login.html</welcome-file>
    <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    重启,就OK

    2.http 自动跳转https

    主要修改两方面:

    (1).修改server.xml

     所有跳转,全部转成443

    (2).修改web.xml

    <security-constraint>  
     		<web-resource-collection >  
    			<web-resource-name >SSL</web-resource-name>  
    			<url-pattern>/*</url-pattern>  
    		</web-resource-collection>  
    		<user-data-constraint>  
    			<transport-guarantee>CONFIDENTIAL</transport-guarantee>  
    		</user-data-constraint>  
    </security-constraint> 
    

    重启就OK了  

    -----------------------------------------------------分割线-------------------------------------------------------------

     点击链接:先领劵,在支付,点我哦

  • 相关阅读:
    做汉堡
    第三次作业:五章感想与问题
    第二次作业:结对练习
    自己要的东西
    存在不知道是什么问题的程序
    第一个Sprint冲刺第二天
    第一个Sprint冲刺第一天
    第三个Sprint完结工作 用场景来规划测试工作.
    beta 阶段的 postmortem 报告
    重新评估团队贡献分
  • 原文地址:https://www.cnblogs.com/wookong/p/13053722.html
Copyright © 2011-2022 走看看