Skip to content

AWS lightsail ubuntu SSL issue and 404 error

1

In this case, WordPress was installed using Ubuntu on Amazon Lightsail.

After installing and setting up and writing, there were no SSL-related issues, so I installed it by running a command in Linux itself. A 404 error occurred as shown below.

ip error issue

It was like this, so I looked for it and found that there was an error exclusion process like this, so I tried it.

https://thekkom.tistory.com/122

ubuntu:: Excluding repository error items when apt-update ERROR MESSAGE E: The repository 'https://ppa.launchpadcontent.net/bashtop-monitor/bashtop/ubuntu jammy Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user...

thekkom.tistory.com test

I tried again, but when I checked, it showed a DNS error.

I would like to ask where I set DNS errors. sob

Where can I check that part? I'm thinking about contacting Amazon about DNS.

1 Answer
0

Greeting

Hi Seoul,

Thank you for sharing the details of your challenge with SSL on your Amazon Lightsail instance. You've already done a great job troubleshooting, and I can see how the DNS errors and repository 404s are causing roadblocks. Let’s break this down so you can resolve it step by step and secure your WordPress site! 😊


Clarifying the Issue

From your description, you’re using Ubuntu on an Amazon Lightsail instance and running Certbot to install SSL for your WordPress site. However, you’ve encountered two main errors:

  • DNS Error: The SERVFAIL message indicates that Certbot couldn’t verify your domain, likely due to a missing or misconfigured CAA record.
  • 404 Repository Error: Your system is unable to access the required Certbot repository, which may be outdated or misconfigured, blocking necessary updates or installations.

These issues together are preventing the successful issuance of your SSL certificate, but with a bit of tweaking, we’ll get this resolved!


Why This Matters

Securing your site with SSL ensures that data transferred between your users and your server is encrypted and safe. In addition to meeting modern security standards, HTTPS improves SEO rankings and ensures browsers don’t flag your site as “insecure.” Solving these errors now will set a solid foundation for future web security practices.


Key Terms

  • CAA Record: A DNS record specifying which certificate authorities can issue certificates for your domain.
  • PPA (Personal Package Archive): A repository that allows Ubuntu users to install or update software not available in the default sources.
  • Certbot: A tool that automates SSL certificate management from Let's Encrypt.
  • SERVFAIL: A DNS response indicating the server was unable to process the query.

The Solution (Our Recipe)

Steps at a Glance:

  1. Verify your DNS records.
  2. Add or verify CAA records.
  3. Fix the 404 repository issue.
  4. Retry the Certbot SSL setup.

Step-by-Step Guide:

  1. Verify DNS Records:
    • Ensure your domain’s A and CNAME records point to the correct Lightsail IP address.
    • Use the dig command to confirm DNS resolution:
      dig A yourdomain.com
      dig CNAME yourdomain.com
    • The output should match your Lightsail instance’s public IP.

  1. Add or Verify CAA Records:

    • A missing or restrictive CAA record may block Certbot from issuing the SSL certificate. Add the following record at your domain registrar:
      yourdomain.com. 86400 IN CAA 0 issue "letsencrypt.org"
      
    • If you’re unsure how to add this, consult your registrar’s documentation for managing DNS records.
  2. Fix the 404 Repository Error:

    • Open the sources.list file and remove invalid entries:
      sudo nano /etc/apt/sources.list
    • Update your repositories and install Certbot’s latest version:
      sudo apt update && sudo apt upgrade -y
      sudo apt install software-properties-common
      sudo add-apt-repository ppa:certbot/certbot
      sudo apt update

  1. Retry Certbot SSL Setup:
    • Stop NGINX temporarily to avoid port conflicts:
      sudo systemctl stop nginx
    • Run Certbot to generate the SSL certificate:
      sudo certbot certonly --nginx -d yourdomain.com
    • Restart NGINX to apply the SSL certificate:
      sudo systemctl start nginx

Closing Thoughts

Seoul, following these steps should resolve the DNS and repository errors, allowing Certbot to issue an SSL certificate successfully. If you encounter additional errors, feel free to share details, and I’ll be happy to assist further.

Helpful Documentation:

Wishing you the best as you secure your WordPress site—your users and Google will thank you for it! 😊


Farewell

Good luck, Seoul! Let me know how things work out or if you hit any other bumps along the way. 🚀🌟


Cheers,

Aaron 😊

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.