Due to the nature of my configuration, I’m forced to manually load the certificates.
This is what my configuration looks like:
<virtualhost *:443>
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAdmin webmaster@mydomain.com
DocumentRoot "/var/sentora/hostdata/myusername/public_html/mydomain_com"
php_admin_value open_basedir "/var/sentora/hostdata/myusername/public_html/mydomain_com:/var/sentora/temp/"
php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
ErrorLog "/var/sentora/logs/domains/myusername/mydomain.com-error.log"
CustomLog "/var/sentora/logs/domains/myusername/mydomain.com-access.log" combined
CustomLog "/var/sentora/logs/domains/myusername/mydomain.com-bandwidth.log" common
<Directory "/var/sentora/hostdata/myusername/public_html/mydomain_com">
Options +FollowSymLinks -Indexes
AllowOverride All
Require all granted
</Directory>
AddType application/x-httpd-php .php3 .php
DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
# Custom Global Settings (if any exist)
# Custom VH settings (if any exist)
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/mydomain.com/chain.pem
</virtualhost>
<virtualhost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAdmin webmaster@mydomain.com
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</virtualhost>
How do I get my certificate to work with WWW as well as the non-www version? The alternative question would be - what command should I have executed to obtain my certificate in a way that would cover this?
I apologize for the stupid question but I’m a bit new to SSL certificates.