配好的以及原文在这里:http://www.yunwei123.tech/2019/10/13/hello-world/
好像找到的大多数是centos上面的配置方式…而debain上面的apache配置大概有挺大的不同,所以写一个记录一下
首先,ssl的站点配置文件在
/etc/apache2/sites-available/default-ssl.conf
里面
下载好ssl证书文件后,修改上面文件的
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile /etc/ssl/certs/2750681_www.yunwei123.tech.pem
SSLCertificateKeyFile /etc/ssl/private/2750681_www.yunwei123.tech.key
(加粗的这两行)后面文件替换成你的ssl证书;
保存,运行
a2enmod
命令,启动ssl模块;再运行
a2ensite
命令,启动default-ssl站点
然后运行
systemctl reload apache2
systemctl restart apache2
完成x