debian9.9 apache2.4 站點添加ssl證書配置https

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章