针对腾讯云。
下载腾讯云免费证书,并且解压到 var/key/
下
将如下代码写入000-default.conf
<VirtualHost 0.0.0.0:443>
DocumentRoot "/var/www/html"
ServerName www.mysite.com
SSLEngine on
SSLCertificateFile /var/key/_.mysite.com.crt
SSLCertificateKeyFile /var/key/_.mysite.com.key
SSLCertificateChainFile /var/key/root_bundle.crt
</VirtualHost>
安装openssl:
$ sudo apt-get install openssl
$ sudo apt-get install libssl-dev
加载ssl模块,然后重启服务器(为了保证权限,最好sudo)
$ sudo a2enmod ssl
$ sudo service apache2 restart
查看是否成功启用https
https:www.mysite.com