linux tomcat配置443域名,Ubuntu配置tomcat 443(https)

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

(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

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

将password改为密文:

到下面网址进行加密,将输出的密文密码写到server.xml文件里

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值