当前演示服务器为windows,安装时与linux并无区别
腾讯云官方文档:https://cloud.tencent.com/document/product/400/4143
登录腾讯云后台,点击总览 解压下载的压缩包 文件目录 Tomcat目录 密钥库密码文件和密钥库文件
配置文件参数 说明
clientAuth 如果设为true,表示Tomcat要求所有的SSL客户出示安全证书,对SSL客户进行身份验证keystoreFile 指定keystore文件的存放位置,可以指定绝对路径,也可以指定相对于 (Tomcat安装目录)环境变量的相对路径。如果此项没有设定,默认情况下,Tomcat将从当前操作系统用户的用户目录下读取名为 “.keystore”的文件。keystorePass 密钥库密码,指定keystore的密码。(如果申请证书时有填写私钥密码,密钥库密码即私钥密码,否则填写密钥库密码文件中的密码)sslProtocol 指定套接字(Socket)使用的加密/解密协议,默认值为TLS到conf目录下的web.xml。在</welcome-file-list>后面,</web-app>前面,加上中间的部分,为了让非ssl的connector跳转到ssl的connector去
<welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- SSL证书配置,步骤2 http自动跳转https的安全配置 让非ssl的connector跳转到ssl的connector去 --> <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> </web-app>我这里将默认端口改为了2000
<!-- 将8080端口需改为2000--> <!-- 配置SSl证书,步骤3 将8443修改为443,服务器端需要放开443--> <Connector port="2000" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />这里最好也改一下
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />启动tomcat,在浏览器中访问域名地址
如有错误,请指出,谢谢。