近期搞定了HTTPS配置,特此记录。

1、把下载的文件拷贝到cert文件夹,然后放在tomcat根目录下(与conf同一级目录)。
2、配置conf下的server.xml,修改下面3个节点,如下:

<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
<Connector port="443" protocol="HTTP/1.1"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
keystoreFile="cert/your-name.pfx"
keystoreType="PKCS12"
keystorePass="you-password"
clientAuth="false" sslProtocol="TLS" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />

3、配置conf下的web.xml,让http自动跳转https。在</web-app>前加入下面配置即可。

<login-config>
<!-- Authorization setting for SSL -->
<auth-method>CLIENT-CERT</auth-method>
<realm-name>Client Cert Users-only Area</realm-name>
</login-config> <security-constraint>
<!-- Authorization setting for SSL -->
<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>

4、在服务器上重启tomcat的,访问你的网站。

Centos下配置tomcat7的https证书的更多相关文章

  1. centos下配置Apache的https强制跳转

    vim /etc/httpd/conf/httpd.conf 新增如下三行 RewriteEngine on RewriteCond  %{HTTPS} !=on RewriteRule  ^(.*) ...

  2. Centos下配置php环境

    Centos下配置php环境   目录[-] 环境: GD2 2 安装PHP 5.2.14(FastCGI模式) 1)编译安装PHP 5.2.14所需的支持库: 2)编译安装MySQL 5.5.3-m ...

  3. centos下配置gitosis服务器遇到的困难

    这篇博客主要讲的是在centos下配置gitosis遇到的问题. 背景:centos7.2 64 :gitosis2.0 1.困难1 1)产生的问题及原因.gitosis没有安装成功,没有出现fini ...

  4. CentOS下配置防火墙 配置nat转发服务

    CentOS下配置iptables防火墙 linux NAT(iptables)配置 CentOS下配置iptables 1,vim /etc/sysconfig/network   这里可以更改主机 ...

  5. CentOS下配置jdk

    CentOS下配置jdk 1.在jdk官网上下载最新版本的jdk 2.将jdk放到相应的位置,使用如下命令来解压. .0_181 /opt/data/ tar -zxf jdk-8u181-linux ...

  6. CentOS下配置iptables防火墙 linux NAT(iptables)配置

    CentOS下配置防火墙 配置nat转发服务CentOS下配置iptables防火墙 linux NAT(iptables)配置 CentOS下配置iptables 1,vim /etc/syscon ...

  7. CentOS下配置LVM和RAID

    1.CentOS配置LVM http://www.cnblogs.com/mchina/p/linux-centos-logical-volume-manager-lvm.html http://ww ...

  8. linux系统下使用nginx反向代理asp.net core,并配置免费的https证书

    反向代理是为动态 Web 应用提供服务的常见设置. 反向代理终止 HTTP 请求,并将其转发到 ASP.NET Core 应用. 1.在asp.net core项目中的Startup的Configur ...

  9. CentOS下配置多个Tomcat同时运行 本篇文章来源于 Linux公社网站(www.linuxidc.com)

    原文地址:http://blog.csdn.net/tjcyjd/article/details/46553361 版权声明:本文为博主原创文章,未经博主允许不得转载. 同一服务器部署多个tomcat ...

随机推荐

  1. The model backing has changed

    其他信息: The model backing the 'WebTopFormContext' context has changed since the database was created. ...

  2. Template7插入动态模板

    要完成的效果如下图 其中下面添加出来的订单号和订单总价可以看作是接口请求的数据 实现步骤: 1 下载template7:https://github.com/nolimits4web/template ...

  3. JS数组filter()、map()、some()、every()、forEach()、lastIndexOf()、indexOf()实例

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat=&qu ...

  4. Windows 10 快捷键汇总表格

    Windows 10 快捷键汇总表格 Windows 10 快捷键汇总 Win键 + Tab 激活任务视图 Win键 + A 激活操作中心 Win键 + C 通过语音激活Cortana Win键 + ...

  5. 基于nginx搭建简易的基于wcf集群的复杂均衡

    很多情况下基于wcf的复杂均衡都首选zookeeper,这样可以拥有更好的控制粒度,但zk对C# 不大友好,实现起来相对来说比较麻烦,实际情况下,如果 你的负载机制粒度很粗糙的话,优先使用nginx就 ...

  6. python第四课——线程、进程、协程

    面试or笔试题:简述线程.进程.协程之间的关系? 内容概要 1.进程与线程优.缺点的比较 2.适用情况 3.线程 线程的创建 setDaemon join event RLock 队列 4.进程 创建 ...

  7. C++函数重载和函数模板(04)

    函数重载 函数重载可以使一个函数名具有多种功能,即具有“多种形态”,这种特性称为多态性. C++的多态性又被直观地称为“一个名字,多个函数”.源代码只指明函数调用,而不说明具体调用哪个函数.编译器的这 ...

  8. Linux系列教程(七)——Linux帮助和用户管理命令

    上篇博客我们介绍了Linux文件搜索命令,其中find是用的最多的也是功能最强大的文件或目录搜索命令,和另一个搜索命令locate的区别是,find命令是全盘搜索,刚创建的文件也能搜索的到,而loca ...

  9. 关于CSS3 object-position/object-fit属性的使用

    object-position/object-fit属性一般用在替换元素上. 什么叫替换元素? 不是所有元素都叫"替换元素".在CSS中,"替换元素"指的是: ...

  10. 如何获取系统Home(Launcher)应用判断用户是否处于home界面

    要把我们的应用程序作为home(launcher应用),只需要在AndroidManifest.xml中添加: <category android:name="android.inte ...