Needs: I have a main site mymultisite.com and sub-site, sub1.mymultisite.com I configured them using sub-domain (not subfolder) Now I need to enable HTTPS for both of them, using LetsEncrypt.
Problems:
I can successfully enable SSL for the main site (mymultisite.com).
But don’t know how to do with the subsite (sub1.mymultisite.com) yet.
What I tried:
Option 1: From Linux (Debian), run:
sudo certbot –-apache
=> It didn’t work as there’s no actual site named sub1.mymultisite.comOption 2: From Linux (Debian), run:
certbot certonly --webroot -w /var/www/mymultisite.com/ -d sub1.mymultisite.com
=> It succeeded in generating the key. But when accessing the subsite from browser, it said:This server could not prove that it is sub1.mymultisite.com; its security certificate is from mymultisite.com. This may be caused by a misconfiguration or an attacker intercepting your connection.
Resolved it by:
/etc/apache2/sites-available/subsite.mymultisite.com.conf
for each subsite.Value of
DocumentRoot
is same as main site’sDocumentRoot
(Eg:/var/www/sub1.mymainsite.com
).a2ensite