nginx+tomcat https实践

 

1. 安装ssl'证书

使用Let's Encrypt 的免费证书:

下载源代码:

git clone https://github.com/letsencrypt/letsencrypt

我时阿里云的机器,下载的有点慢,100k以内,稍等几分钟就好了

 

 

执行安装下载脚本:

cd letsencrypt
./letsencrypt-auto certonly --standalone --email admin@****.com -d test.com -d www.test.com

参数 d 为域名,多个域名直接在后面继续加就行

看到这个界面,直接Agree回车。

 

 3秒钟后完成

 

 

 有三个月的有效期,2017-02-14过期,需要重新执行命令重新生成新的证书

证书存放在/etc/letsencrypt/下

 

 

 

2. 配置nginx:

nginx需要在编译的时候加入  --with-http_ssl_module 支持

   ./configure --prefix=${dir}/nginx --with-http_ssl_module

 

 

站点mall.conf配置:

 配置完后reload nginx即可

 

 3.tomcat server.xml配置有两处需要修改的:

 

 

 修改后重启tomcat

 

posted @ 2016-11-16 21:02  爱咋咋地,可以不  阅读(3429)  评论(0编辑  收藏  举报