Hi I followed this guide to generate a certificate for my domain: https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04
I added ServerName my_domain and ServerAlias www.my_domain in /etc/apache2/sites-available/my_domain.conf but the domain is not listed between available sites for https in cerbot.
Any ideas how to fix that? Thank you
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Once you created the Apache virtual host config at the sites-available directory, did you run sudo a2ensite your_domain.conf to enable the config file?
Also after enabling the file, you need to run a config test:
sudo apache2ctl configtest
And if you get Syntax OK, then restart Apache as well:
sudo systemctl restart apache2
Let me know how it goes. Regards, Bobby
Hi Bobby, I tried sudo a2ensite your_domain.confbut after that I get this message when I run sudo apache2ctl configtest:
AH00526: Syntax error on line 2 of /etc/apache2/sites-enabled/my_domain.conf:
ServerAlias only used in <VirtualHost>
Action 'configtest' failed.
I can’t restart apache due to this error.
Thank you
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.