SSL issues with conf file

I’ve used Certbot to install and SSL on my domain for a vps i have but i want to apply the SSL to another conf file within apache, what’s the best way to do this? Just copy the certificate path section into the conf file?

The conf file is for a sub folder on the same domain.

Thanks

Yes, basically just set the paths for SSLCertificateFile and SSLCertificateKeyFile in Apache to /etc/letsencrypt/live/example.domain.com/fullchain.pem and /etc/letsencrypt/live/example.domain.com/privkey.pem

Obviously replace example.domain.com with the domain that you got working with certbot. Your Apache config will then look like:

SSLCertificateFile /etc/letsencrypt/live/example.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.domain.com/privkey.pem

I use it like this and works fine. In older versions of Apache you needed to use SSLCertificateChainFile as well, since the SSLCertificateFile couldn’t include the chain. But this now works in Apache, so only two lines are needed instead of three with the SSLCertificateChainFile.

2 Likes