linux-https
(1)建立存放证书的目录
mkdir /etc/httpd/.ssl
cd /etc/httpd/.ssl
(2)建立私钥文件
openrsa genrsa -out server.key 1024
(3)建立网站证书
openssl req -new -x509 -key server.key -out server.crt
(4)利用apache建立虚拟主机进行测试
mkdir /1
touch /1/index.html
echo "this is home page's">/1/index.html
(5)在虚拟主机中加入:
SSLEngine on ------------- (开启SSL)
SSLCertificateFile /etc/http/.ssl/server.crt---(指定证书文件)
SSLCertificatekeyFile /etc/http/.ssl/server.key--(指定私钥文件)