我的网站是腾讯云服务器的,根据官网的SSL证书安装配置指示:https://cloud.tencent.com/document/product/400/4143
下载腾讯颁发的SSL证书:有3个文件,分别是:
1_root_bundle.crt,2_www.域名.com.crt,3_www.域名.com.key
1、添加监听端口
编辑Apache端口配置(/etc/apache2/ports.conf),加入443端口(SSL缺省使用):
Listen 80
Listen 443
B、设置site-enabled
上文安装完后,会在/etc/apache2/sites-available/目录下生成一个缺省的default-ssl文件。缺省的网页目录仍然是/var/www/。我们可以创建一个链接到site-enabled目录。
ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/001-ssl
C、修改配置文件
HTTPS监听端口缺省443:
把端口改为443,在<Virtualhost>下加入SSL认证配置,其它的根据需要自己定制 与普通配置无异:
vim /etc/apache2/sites-enabled/000-default.conf,修改以下内容
DocumentRoot "/var/www/html"ServerName www.域名.comSSLEngine onSSLCertificateFile /home/axxxx/2_www.域名.com.crtSSLCertificateKeyFile /home/axxxx/3_www.域名.com.keySSLCertificateChainFile /home/axxxx/1_root_bundle.crt
2、重启APACHE
# /etc/init.d/apache2 restart
如有问题,请咨询我的qq:1290851757,备注:csdn博客问问题的