zoukankan      html  css  js  c++  java
  • tomcat配置https协议

    一.配置https协议

    1.创建证书

    使用JDK自带工具keytool

    在cmd命令行中输入以下命令,keytool -genkeypair -alias "tomcat" -keyalg "RSA" -keystore "d:\apache-tomcat-8.0.15.keystore"(为存储路径,要与本地tomcat路径一致)

    设置密码并输入相应信息

     2.配置HTTPS协议

    在D:\apache-tomcat-8.0.15\conf路径下,找到server.xml文件

    找到对应代码去掉注释,添加刚获得的证书路径及密码(https端口为8443)

    keystoreFile="D:\apache-tomcat-8.0.15.keystore"  
    keystorePass="123456"

    3.启动Tomcat服务,在浏览器中输入https://localhost:8443(或管理地址https://localhost:8443/manager/html)

    二.tomcat日志级别

    SEVERE(highest) Captures exception and Error捕获异常和错误

    WARNING Warning messages警告消息

    INFO Informational message, related to the server activity与服务器活动相关的信息性消息

    CONFIG Configuration message配置信息

    FINE Detailed activity of the server transaction (similar to debug)服务器事务的详细活动(类似于调试)

    FINER More detailed logs than FINE更详细的日志

    FINEST(least) Entire flow of events (similar to trace)整个事件流(类似于跟踪)

    三.配置用户

    role(角色/权限)和user(用户)即可。一个user节点表示单个用户,属性usernamepassword分别表示登录的用户名和密码,属性roles表示该用户所具备的权限

    在conf文件夹下的tomcat-users.xml中配置用户

     

    admin-gui — 可访问 "host管理" 页面,但"APP管理" 和 "服务器状态" 页面无查看权限
    manager-gui — 无 "host管理" 页面访问权限,有"APP管理" 和 "服务器状态" 页面查看权限
    manager-status — 只有"服务器状态" 页面查看权限
    manager-script — 有脚本方式管理接口访问权限和"服务器状态" 页面查看权限
    manager-jmx — JMX 代理接口访问权限和"服务器状态" 页面查看权限
    admin-script — 只有host-manager脚本方式管理接口访问权限

  • 相关阅读:
    无法重用Linq2Entity Query
    The Joel Test
    MSBuilder directly instead of default VSComplie with keyborad shotcut 原创
    客户端缓存(Client Cache)
    关于代码重构和UT的一些想法,求砖头
    ExtJS2.0实用简明教程 应用ExtJS
    Perl information,doc,module document and FAQ.
    使用 ConTest 进行多线程单元测试 为什么并行测试很困难以及如何使用 ConTest 辅助测试
    史上最简单的Hibernate入门简介
    汽车常识全面介绍 传动系统
  • 原文地址:https://www.cnblogs.com/tinkerbell/p/11718853.html
Copyright © 2011-2022 走看看