分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

Ubuntu配置tomcat 443(https)

发布时间:2023-09-06 02:04责任编辑:傅花花关键词:配置httptomcat
Ubuntu配置tomcat 443(https):

生成.keystore文件:

keytool -genkey -alias tomcat -keyalg RSA

Enter keystore password: ?
Re-enter new password:
What is your first and last name?

What is the name of your organizational unit?

What is the name of your organization?

What is the name of your City or Locality?

What is the name of your State or Province?

What is the two-letter country code for this unit?

Is CN=aa, OU=aa, O=aa, L=aa, ST=aa, C=aa correct?

Enter key password for <tomcat>
(RETURN if same as keystore password): ?
Re-enter new password:

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /root/.keystore -destkeystore /root/.keystore -deststoretype pkcs12".

mv /root/.keystore /var/lib/tomcat7/conf/

vi /var/lib/tomcat7/conf/server.xml

<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="/var/lib/tomcat7/conf/.keystore" keystorePass="xxxxx" />

:wq

service tomcat7 restart

netstat -nplt | grep 8443 ??(此时为8443端口)

apt-get install authbind

vi /etc/default/tomcat7

AUTHBIND=yes ?(默认为#AUTHBIND=no)
:wq

touch /etc/authbind/byport/443

chown tomcat7:tomcat7 /etc/authbind/byport/443

chmod 0755 /etc/authbind/byport/443

vi /var/lib/tomcat7/conf/server.xml

:1,$ s/8443/443/g
:wq

service tomcat7 restart

netstat -nptl | grep 443

Ubuntu配置tomcat 443(https)

原文地址:http://blog.51cto.com/yangzhiming/2145576

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved