配好的以及原文在這裏: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