Set up Ubuntu Apache2 SSL using .pem and .key from Cloudflare

▼魔方 西西 提交于 2020-12-15 04:57:05

问题


I am using Cloudflare to set up a secure connection on Ubuntu 20 using Apache2. I used their Origin Server wizard to generate the following files:

example.com.pem (Origin Certificate)

example.com.key file (Private key)

I gave them the extensions suggested by Cloudflare.

I ran this:

 sudo a2enmod ssl
 sudo systemctl restart apache2

This is my setup:

<VirtualHost *:443>
    ....
    SSLEngine on
    SSLCertificateFile /path/example.com.pem
    SSLCertificateKeyFile /path/example.com.key

The non-secure site works fine (I haven't pointed it to the secure yet), but I still get error 525 (SSL handshake failed) when I try to access the secure site. (I got a website down error before running the sudo a2enmod ssl command)

I tried to see if it was set up ok:

apachectl configtest

It just says "Syntax OK"

(Edit: I removed the wrong stuff I tried - which I now know is wrong - to simplify the question.)

来源:https://stackoverflow.com/questions/64863624/set-up-ubuntu-apache2-ssl-using-pem-and-key-from-cloudflare

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!