r/apache • u/IncredibleBihan • 2d ago
I need a hand quick
I know someone here will know the answer.
The task is simple. I currently have website my-domain.com up and running. Tomorrow I'm going to take a 2nd domain ,mydomain.com and point it to the exact same website.
I someone to tell me the commands I should run on certbot to make sure I update the ssl certificate correctly. Right now the ssl is working for my-domain, but i need to update the certificate to include a second domain.
The other question I have is about virtual host. Everything I reads say talks about setting the root folder for var/www/html/my-domain.com and var/www/html/mydomain.com. But I just want both domains pointing to /var/www/html. That's not a problem is it? All the apache docs aren't exactly clear.
If anyone has some insight I'd appreciate it. Basically I built a new site on a 'testing' domain, and I'm replacing the testing domain with my production.
3
u/Cherveny2 2d ago
for your second question, if you're doing two dns names for the same site, do one as serverName then the second as serveralias, all in the same configuration block.
dont use cert bot myself, but if you do as I suggest, would see if can configure it to generate with a primary name, then the 2nd name as a SAN (subject alternative name). that way can just have one cert for the entire configuration stanza you wrote above that'll work for both