Problems with manual installation and WWW version of my domain

Due to the nature of my configuration, I’m forced to manually load the certificates.

This is what my configuration looks like:

<virtualhost *:443>
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/" 
CustomLog "/var/sentora/logs/domains/myusername/" combined
CustomLog "/var/sentora/logs/domains/myusername/" common
<Directory "/var/sentora/hostdata/myusername/public_html/mydomain_com">
  Options +FollowSymLinks -Indexes
  AllowOverride All
  Require all granted
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/
SSLCertificateKeyFile /etc/letsencrypt/live/
SSLCertificateChainFile /etc/letsencrypt/live/


<virtualhost *:80>
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] 

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.

I’m sorry, but my crystal ball is damaged as of late…

Could you provide us with some more details? How did you obtain the certificate? (Commands entered?) Errors?

What is the exact problem?

Did you supply the letsencrypt command with -d -d or just one -d, only for

Just the -d

I suppose that was the problem here?

Probably… Look at the certificate with openssl x509 -noout -text -in /etc/letsencrypt/live/ and look at the “DNS:” entries after X509v3 Subject Alternative Name:: it probably only contains, but you would like to have the www-version as well. You should have added that one too with a second -d. You can have many, many domains in that list :stuck_out_tongue:

So now what? Do I just request a new certificate with the proper command or is there a “proper” way to do it?

Yep, you’ll need to specify all the subdomains, even the obvious ones as “www” (others CAs do it automatically, LE doesn’t). Request a new certificate with :

-d -d

It will generate one certificate valid for both sites.

Okay, thanks both of you for helping me out, it works fine now.

@Osiris, sorry about your crystal ball. Here’s a picture of cats.