1、配置Tomcat,打开$CATALINA_HOME/conf/server.xml,修改如下

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

修改参数==>

<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->

去掉注释且修改参数==>

<Connector port="" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
maxThreads="" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="d:/dev/tomcat.keystore"
keystorePass="" />
<!--
<Connector port="8009" enableLookups="false" protocol="AJP/1.3" redirectPort="8443" />
-->

修改参数==>

<Connector port="8009" enableLookups="false" protocol="AJP/1.3" redirectPort="443" />

  

二、局部https安全连接配置,打开web项目\WEB-INF\web.xml文件,在该文件</welcome-file-list>后面加上这样一段:

<!-- 局部https安全连接配置 -->
<security-constraint>
<display-name>Auth</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!--
<url-pattern>/index/json/login</url-pattern>
<url-pattern>/admin/json/admin/companyLogin</url-pattern>
<url-pattern>/admin/companyLogin</url-pattern>
<url-pattern>/admin/agentLogin</url-pattern>
-->
<url-pattern>/user/*</url-pattern>
<url-pattern>/main/index</url-pattern>
</web-resource-collection>
<user-data-constraint>
<description>SSL required</description>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

  

上述配置完成后,重启TOMCAT后即可以使用SSL。IE地址栏中可以直接输入地址不必输入“http://” 或者 “https://” ;也可以输入 “http:// ” 会跳转成为 “https://” 来登录

Tomcat配置https、访问http自动跳转至https的更多相关文章

  1. Tomcat配置https及访问http自动跳转至https

    https介绍:   HTTPS(全称:Hypertext Transfer Protocol over Secure Socket Layer),是以安全为目标的HTTP通道,简单讲是HTTP的安全 ...

  2. https----------如何在phpstudy环境下配置apache的https访问以及访问http自动跳转成https

    1.首先在 httpd.conf里面修改几个地方 找到 #LoadModule ssl_module modules/mod_ssl.so 去掉前面的# Include conf/vhosts.con ...

  3. nginx访问http自动跳转到https

    if ($server_port != '443' ) { rewrite ^/(.*)$ https://cms-news.artron.net/$1 permanent; }

  4. nginx证书制作以及配置https并设置访问http自动跳转https(反向代理转发jboss)

    nginx证书制作以及配置https并设置访问http自动跳转https 默认情况下ssl模块并未被安装,如果要使用该模块则需要在编译时指定–with-http_ssl_module参数,安装模块依赖 ...

  5. nginx配置http访问自动跳转到https

    1.按照如下格式修改nginx.conf 配置文件,80端口会自动转给443端口,这样就强制使用SSL证书加密了.访问http的时候会自动跳转到https上面 server { listen ; se ...

  6. (转)Nginx的https配置记录以及http强制跳转到https的方法梳理

    Nginx的https配置记录以及http强制跳转到https的方法梳理 原文:http://www.cnblogs.com/kevingrace/p/6187072.html 一.Nginx安装(略 ...

  7. apache如何设置http自动跳转到https

    如何设置http自动跳转到https?apache环境下,配置好https后,需要设置url重定向规则,使网站页面的http访问都自动转到https访问. 1.先打开url重定向支持1)打开Apach ...

  8. [Chrome] chrome 自动跳转到https

    关键字眼: - static_upgrade_mode: FORCE_HTTPS - You cannot visit www.xxx.dev right now because the websit ...

  9. 今天这篇内容分享Apache由http自动跳转到https的多种方法

    本文主要和大家分享Apache http自动跳转到https的几种方法,非常不错,具有参考借鉴价值,需要的朋友参考下 本文主要和大家分享Apache http自动跳转到https的几种方法,当你的站点 ...

随机推荐

  1. Python + Robotframework + Appium 之APP自动化测试实践(一)

    前面的文章已经介绍了Robotframework+Appium的安装及小试牛刀(For Android) 下面来个简单的实践,话不多说,还以是计算器为例,直接上代码,详情如下: *** Setting ...

  2. A Good Story for Great Friends

    There once was a little girl who had a bad temper. Her mother gave her a bag of nails and told her t ...

  3. EBS-DBA 维护

    --查询表空间使用率: SELECT UPPER(F.TABLESPACE_NAME) "表空间名", D.TOT_GROOTTE_MB "表空间大小(M)", ...

  4. Android Studio生成get,set,tostring,构造方法

    如何在AndroidStudio开发Android应用程序的时候,在对象模型中生成快捷方式生成get,set,tostring,构造方法等: 有两种方式: 第一种方式:Code –> Gener ...

  5. Ubuntu14.04下Pycharm3.4 字体渲染

    在ubuntu下搭建了django的开发环境,搭建过程十分简单,Pycharm的安装更简单,下载tar包解压并执行bin目录下的脚本即可,但是看着那个字体真心不爽.于是开始搜索调教. 1.安装打了渲染 ...

  6. 拒绝“高冷”词汇!初学C#中的委托

    有一天,你写了好多好多带“形参”的构造函数(就是“方法”,同义),而且需要向这些构造函数里传递同样的“实参”,然后你就憨憨地一个一个函数的调用并赋予同样的“实参”,这一天就这么过去了... 又过了几天 ...

  7. 关于gridview改变行内容事件需要点击别的行或控件才能执行

    一般的datagridview控件: this.dgvAssetList.CurrentCell = null;//取消datagridview行的编辑状态 Dev gridcontrol控件  Gr ...

  8. 在QT中用git做版本管理时遇到的一些问题

    1. 安装git sudo apt-get install git 2. 安装gitk sudo apt-get install gitk 要提交代码,点击  工具->git->local ...

  9. MyCat - 背景篇(1)

    此文已由作者张镐薪授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. SQL与NoSQL 目前,对于互联网海量数据的存储以及处理,按使用场景,分为OLTP(联机事务处理,比如即时 ...

  10. disruptor调优方法

    翻译自disruptor在github上的文档,https://github.com/LMAX-Exchange/disruptor/wiki/Getting-Started Basic Tuning ...