How do I add www I am using vestaCP


#1

I got the certificate setup after a lot of trial and error by using this guild https://docs.google.com/document/d/1y5tTtImTGk_zqYe3lelGtMl8_gSCQcNgCCdbYTQAb7E/edit?pref=2&pli=1

But the guild didn’t tell me that I needed to add www. example.com.

In vestaCP the www is set as an Aliases.

My site works with https: //mydomain.com but not https: //www.mydomain.com
It will still work with http: //mydomain.com

Can someone help me as to how to add the www. mydomain.com


#2

The letsencrypt client accepts multiple -d arguments, if you wish to pass additional domains. To use the sample from your guide with two domains:

./letsencrypt-auto certonly -a webroot --renew-by-default --webroot-path /home/admin/web/<domain>/public_html -d example.com -d www.example.com

#3

When i did that I got this error

“An unexpected error occurred:
TypeError: coercing to Unicode: need string or buffer, NoneType found
Please see the logfiles in /var/log/letsencrypt for more details.”


#4

Can you provide us with the exact command you used, and the associated part of the log file please.


#5

I ran into some other issues with my server and had to back up my sites and reinstall the OS.
After I got everything back up and running I reinstalled letsencrypt and tried my first domain and it said “Too many certificates already issued for:mydomain” so i guess I’ll have to wait until I can try again. I think I read somewhere that it’s 7 days?

Anyway I tried the command that pfg posted on my second domain and it worked fine. So on that domain ssl is working for the domain and the www part.

Thanks for th ehelp guys I’ll just have to wait now.
Is there a way that I can check to see how long I have to wait?

Thanks again


#6

You could search for your domain at https://crt.sh/? - it will tell you when certs were issued for your domain, so may give you a fair indication.


#7

Try simplest shell script: https://github.com/Neilpang/le

le  issue    /home/admin/web/<domain>/public_html   aaa.com     www.aaa.com

#8

I’ve written a tool to bridge the gap between the ACME client and VestaCP’s API. It will, given a Vesta site (or multiple sites), request and install a certificate that contains SANs for all of the Vesta aliases listed on the site(s).

You can find it at https://github.com/interbrite/letsencrypt-vesta.