I have a server configured to use Apach 2.4 dynamically configured vhosts. I have SSL configured for some domains but I am asked to use Let's Encrypt free service to provide SSL for all domains.
Certbot was little bit unclear for me as I am not sure if it will work for dynamic vhosts.
My challenge is I have each domain available on a subdomain subXXX.masterdomain.com and a alias yourchoicedomain.com so I need to generate get a certificate form Let's Encrypt that is valid for
- subXXX.masterdomain.com
- www.subXXX.masterdomain.com
- yourchoicedomain.com
- www.yourchoicedomain.com
I don't have a very complicate vhosts config file I achieve domain alias and www server alias using symlinks.
<VirtualHost *:80>
#ServerName masterdomain.me
#ServerAlias *
# get the server name from the Host: header
UseCanonicalName Off
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot "/var/www/vhosts/%0/httpdocs"
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS} off
RewriteRule .* http://www.%{HTTP_HOST}$0 [R=301,L]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS} on
RewriteRule .* https://www.%{HTTP_HOST}$0 [R=301,L]
<Directory "/var/www/vhosts/*/httpdocs">
AllowOverride "All"
Options SymLinksIfOwnerMatch
Require all granted
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Any help getting me started will be great.