Let's Encrypt for both root domain and www.

Hello,

I’ve added a domain to CyberPanel, say example.net, and used the Manage SSL → Issue SSL option to issue a Let’s Encrypt SSL. However I noticed that
the Let’s Encrypt issued SSL certificate will only secure example.net and not www.example.net
Is there anyway we can configure an alias for www so that Let’s Encrypt will also cover www?

Thanks,
George

Hello !

Child domains can help you with this: 3 - Creating and Managing Child Domains - 04 - Websites - CyberPanel Community

Regards

I tried that already but I didn’t manage to get it to work.

1st try:
I entered www.example.net under Domain Name, left Path empty (I want it to be the same as for the root domain example.net), chose my PHP version and clicked the SSL checkbox. I got an error and this is what I saw in my cyberpanel log:

[10-26-46-Sun-Nov-2017] [Errno 13] Permission denied: '/home/example.net/public_html/www.example.net' [Not able create to directories for virtual host [createDirectoryForDomain]]
[10-26-49-Sun-Nov-2017] [Errno 1] Operation not permitted [IO Error with main config file [obtainSSLForADomain]]
[10-26-49-Sun-Nov-2017] [Errno 2] No such file or directory: '/home/www.example.net' [Not able to remove virtual host directory from /home continuing..]

2nd try:
I entered www.example.net under Domain Name again, entered / under Path, chose my PHP version and clicked the SSL checkbox.
Now the error was

Cannot create website. Error message: [Errno 13] Permission denied: u'/home/example.net/public_html//index.html'

and here’s what my cyberpanel log says:

[07-31-43-Tue-Nov-2017] [Errno 17] File exists: '/home/example.net/public_html/' [Not able create to directories for virtual host [createDirectoryForDomain]]
[07-32-06-Tue-Nov-2017] www.example.net SSL OK
[07-32-09-Tue-Nov-2017] [Errno 2] No such file or directory: '/home/www.example.net' [Not able to remove virtual host directory from /home continuing..]

This time the www website can be seen in “List Domains” under the root domain, but a) the PHP version setting is blank (even if I change it, when I refresh it’s blank again), and b) I see nothing changed in my /usr/local/lsws/conf/vhosts configuration except for an new folder with the SSL for www.example.net (/usr/local/lsws/conf/vhosts/SSL-www.example.net/) which was issued by Let’s Encrypt.
Not sure if Child Domains are added under the main domain’s vhost configuration (ie /usr/local/lsws/conf/vhosts/example.net/vhost.conf) or a new vhost configuration file is generated, but in any case, nothing changed here - probably because of the permission errors above.

Thank you in advance,
George

New version will be up soon with perms fix.

Hello Geroge !

Working on Permissions issues and converting to PHP SuExec mode, will let you know as soon as it is ready to test on discord server.

Thank you.