centos 下tomcat使用开源SSL证书启用HTTPS

centos 下tomcat使用开源SSL证书启用HTTPS

项目需求使用HTTPS安全访问方式:

现有环境

centos 7,tomcat

查阅了大量的资料,方案

开源证书Let's Encrypt (linux下申请 ,windows下申请


申请证书,可以看我另一个转载的博客

 证书到手,就是配置了
 tomcat配置pem证书,需要arp支持,所有在centos 7中先安装

 

 //配置gcc依赖
yum install gcc

//安装openssl
wget  https://www.openssl.org/source/openssl-1.1.0f.tar.gz
tar -zxvf openssl-1.1.0f.tar.gz
cd openssl-1.1.0f
./config --prefix=/usr/local/openssl
make && make install
   
   
  
   
   //安装apr
cd
wget http://mirror.bit.edu.cn/apache/apr/apr-1.6.2.tar.gz
tar -zxvf apr-1.6.2.tar.gz
cd apr-1.6.2
./configure --prefix=/usr/local/apr
make && make install

//安装apr-util
cd
wget http://mirror.bit.edu.cn/apache/apr/apr-util-1.6.0.tar.gz
tar -zxvf apr-util-1.6.0.tar.gz
cd apr-util-1.6.0
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

//安装tomcat-native
cd
wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-connectors/native/1.2.12/source/tomcat-native-1.2.12-src.tar.gz
tar -zxvf tomcat-native-1.2.12-src.tar.gz
cd tomcat-native-1.2.12-src/native
./configure --with-apr=/usr/local/apr --with-ssl=/usr/local/openssl
make && make install


//配置环境变量
vi /etc/profile
//在末尾添加
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
source /etc/profile

 就是配置tomcat



 

猜你喜欢

转载自913.iteye.com/blog/2390643