Install SSL Using Certbot with Apache on Ubuntu

I am new to Linode, just learned how to install the test WordPress site (example.com), and it is now running well with HTTP.

  • create linode;
  • create domain
  • change DNS in the domain (as this point, all running smoothly)

When trying to install SSL following the step here (https://www.linode.com/docs/guides/enabling-https-using-certbot-with-apache-on-ubuntu), it keeps showing me errors after many times.

Then I switched to the following codes:

certbot --apache --redirect -d example.com -d www.example.com -m admin@example.com --agree-tos

Still same erros:

"We were unable to find a vhost with a servername or address of example.com, which virtual host would you like to choose?

I believe when I install WordPress, I selected Ubuntu 22.04. Can anyone please help where possible the troubles? In case you need my site to test the errors (guojijieri.com).

Or can you please list the commands I should use to install the free SSL with auto-renewals, thank you so much!

4 Replies

I used this same guide:

https://www.linode.com/docs/guides/enabling-https-using-certbot-with-apache-on-ubuntu

and had no problems. Did you install snapd like it says.

You need to put your WP configuration in a VirtualHost.

See:

https://httpd.apache.org/docs/2.4/vhosts/examples.html

—sw

PS. You don’t need snapd

Related question based on link above:

I have 10 sites on my Linode and I have a separate vhost for for each in /etc/apache2/sites-available:

site1.com.conf
site2.com.conf
.
.

Could I have put them all in ONE "vhosts" file like in the link above? What would that file be named if so?

Could I have put them all in ONE "vhosts" file like in the link above?

Yes.

What would that file be named if so?

Whatever you like… The configuration file name has no relationship to the configuration information the file contains.

Also, since LetsEncrypt certs are issued for a domain and not just a site, you need to make sure that you get a wildcard cert that applies to all your subdomains…i.e. for *.site.com…not just site.com. The process for this may be slightly different.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct