i see your problem you need 2 separate certs for
or 1 cert with 2 webroot paths
-
mainserver.mydomain.comwhere web root path for cpanel main host name is usually off/usr/local/apache/htdocsunless you created that as a new site account in whm then it would also be/home/anotherusername/public_html -
mydomain.comwhere web root path for cpanel is/home/username/public_html
so based on webroot manual documentation at https://letsencrypt.readthedocs.org/en/latest/using.html#webroot you would need a command similar to one outlined at https://forums.cpanel.net/threads/how-to-installing-ssl-from-lets-encrypt.513621/ using non-letsencrypt-auto command instead
cd /root/.local/share/letsencrypt/bin/
./letsencrypt --text certonly --renew-by-default --webroot --w /home/username/public_html -d mydomain.com \
-w /usr/local/apache/htdocs -d mainserver.mydomain.com
where mainserver.mydomain.com webroot is either /home/anotherusername/public_html or /usr/local/apache/htdocs