1.为httpd安装ssl模块
[root@localhost ~]# yum install -y mod_ssl
2.搭建CA
[root@localhost ~]# cd /etc/pki/CA/
[root@localhost CA]# (umask 077;openssl genrsa -out private/cakey.pem 2048)
[root@localhost CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem
![](https://img.haomeiwen.com/i4593121/fe82391e1b0f0763.png)
3.搭建vsftp,用于下载证书
[root@localhost CA]# yum -y install vsftpd
[root@localhost CA]# cp cacert.pem /var/ftp/pub/zxzx.crt
[root@localhost CA]# service vsftpd start
[root@localhost CA]# chkconfig vsftpd on
[root@localhost CA]# touch index.txt
[root@localhost CA]# echo 01 > serial
[root@localhost CA]# cd /etc/httpd/
[root@localhost httpd]# mkdir ssl
4.签发证书
[root@localhost httpd]# cd ssl/
[root@localhost ssl]# (umask 077;openssl genrsa -out httpd.key 1024)
[root@localhost ssl]# openssl req -new -key httpd.key -out httpd.csr
![](https://img.haomeiwen.com/i4593121/2a2411d5921e6441.png)
[root@localhost ssl]# openssl ca -in httpd.csr -out httpd.crt -days 365
5.配置SSL
[root@localhost httpd]# cd /etc/httpd/conf.d/
[root@localhost conf.d]# vim ssl.conf
![](https://img.haomeiwen.com/i4593121/cbe7106e4b976abe.png)
![](https://img.haomeiwen.com/i4593121/cb5b22c9caf03a94.png)
6.配置httpd服务
[root@localhost ~]# cd /etc/httpd/conf
[root@localhost conf]# vim httpd.conf
![](https://img.haomeiwen.com/i4593121/d65677b8900ff59b.png)
![](https://img.haomeiwen.com/i4593121/f6ba2c9fc13fc234.png)
![](https://img.haomeiwen.com/i4593121/b6edc5ae459bb2cb.png)
7.启用httpd服务
[root@localhost conf.d]# service httpd restart
![](https://img.haomeiwen.com/i4593121/8b4cf96e422b4f90.png)
8.下载证书
ftp://192.168.50.105/pub/
![](https://img.haomeiwen.com/i4593121/57db89030eaf35a6.png)
9.IE浏览器导入证书
![](https://img.haomeiwen.com/i4593121/8149a224ad41b089.png)
![](https://img.haomeiwen.com/i4593121/748a3630e91df2ac.png)
10.增加本地解析
打开C:\Windows\System32\drivers\etc中hosts文件,添加如下行:
![](https://img.haomeiwen.com/i4593121/b077f582a1fec2e4.png)
11.使用IP访问测试
![](https://img.haomeiwen.com/i4593121/6e2af4ad947aa86c.png)
![](https://img.haomeiwen.com/i4593121/dde7527bd040f407.png)
12.使用域名访问测试
![](https://img.haomeiwen.com/i4593121/aa49872aebffa375.png)
![](https://img.haomeiwen.com/i4593121/e9de7fabf2a5c324.png)
网友评论