Using Certbot, I installed a letsencrypt SSL Certificate for my domain which points a Hostinger Apache Server running Ubuntu 20.04. I am having trouble installing a certificate for my subdomain. I created an A record (Name: www) that points to my server's ip address. This was after deleting the CNAME record (Name :www Target: mydomain.com). I have looked at the related posts and tried "certbot certonly --standalone --expand -d mydomain.com -d www.mydomain.com). I used my domain name in place of "mydomain.com". This did not work. Any help would be appreciated.
First of all, thanks for looking into this issue. As far as being accessible, I'm assuming that you mean that the site appears when I type the domain name or the subdomain name in the address bar: in my case, the site appears for both cases.
As far as port 80 is concerned, after running netstat,I cannot see where port 80 is being used, if it's actually being used. However, the "certbot certonly --standalone ..." command does report "Could not bind TCP port 80 because it is already in use by another process on this system". I'm not sure how to stop port 80 and if stopping port 80 will allow "certbot certonly -- standalone ..." to install the certificate.
netstat -atunpl | grep 80
to find the process. But if you know what webserver you are using, I'd really recommend to use the certbot plugin like i described, then, your website can stay online during the renewal process. – Anuril Jan 11 '23 at 14:33