Skip to content

Lightsail Wordpress Setup Error "unable to connect"

2

My Wordpress website has been working for years. I received a notice from AWS that they have an issue with existing LetsEncrypt certs and gave instructions on how to create new certs. I also noticed at that time that my website comes up as a blank page. No error just a blank page. The browser says the cert is fine (good until November). My or may not be related to the LetsEncrypt cert. When I run through the Wordpress Setup (restart) per the AWS instructions, I get an error on the last step "Create Certificate". The error says it is "unable to connect or stay connected to your instance". I can connect to the instance through Lightsail's console and through putty on my home machine. I can see the Apache process is running. Possibly unrelated, my name servers have changed since I last checked several months ago. I didn't change them. I assume it's all transparent but my Route 53 "registered domains" page does show that same Name Servers as Lightsail. However, my Route 53 "ns" record shows the old ones (different from what Lightsail shows). Ideas?

The letsencrypt log shows this error from yesterday: letsencrypt.log error

BTW, the firewall rules were correct and the Route 53 "ns" record now matches the Lightsail name servers.

  • Had this same issue a few months back. The DNS mismatch was the culprit for me.

    What worked was waiting for full DNS propagation (took about 24 hours for me) and making sure the A record was pointing to the right IP. Also double check that port 80 and 443 are open in the Lightsail firewall settings.

    The blank page thing is separate - probably PHP memory limit or a plugin conflict. Try renaming the plugins folder via SSH and see if the site comes back.

    Hope this helps.

3 Answers
1

The 'unable to connect' error during certificate creation typically indicates that the Let's Encrypt validation process cannot reach your instance on the required ports. Here are the key areas to investigate:

Firewall Configuration: Verify that your instance firewall allows inbound traffic on ports 80 (HTTP) and 443 (HTTPS). The certificate validation process requires these ports to be open. You can check and modify firewall rules in the Lightsail console under your instance's networking settings.

DNS Records: The mismatch you're seeing between your Route 53 NS records and what Lightsail shows is likely significant. For the certificate setup to work, your DNS records must be correctly configured and pointing to your Lightsail instance. The validation process queries your domain's DNS to verify ownership. You should update your Route 53 hosted zone's NS records to match what Lightsail displays, and ensure your A record points to your instance's current IP address. Keep in mind that DNS changes can take time to propagate - sometimes up to 48 hours.

Blank Page Issue: While you're troubleshooting the certificate, the blank page problem suggests a separate WordPress or web server issue. Since Apache is running but serving blank pages, this could indicate a PHP error, database connection problem, or corrupted WordPress files. You might want to check your Apache error logs and WordPress debug logs through SSH to identify the root cause.

Next Steps: First, resolve the DNS discrepancy by ensuring all records are consistent and current. Then verify your firewall rules allow the necessary traffic. After making these changes, wait for DNS propagation to complete before attempting the certificate setup again. If issues persist, you can download error logs from the setup process for more detailed troubleshooting information.
Sources
Lightsail Setup failed - Amazon Lightsail

answered a month ago

EXPERT

reviewed a month ago

AWS
EXPERT

revised a month ago

1

Thanks for the ideas. At this point, I'm pretty sure I was hacked and someone has been using my server for their own purposes for the last couple weeks. My website gets minimal traffic so I don't check it daily. All the Wordpress files/folder in /var/www/html were renamed to make them inaccessible and there was a new index.php file filled with goto statements. I've shut it down. I'm in the process of creating a new Lightsail Wordpress instance and will carefully pull files (e.g. gallery images) from the bad to the new instance. I don't trust being able to clean up the bad machine with confidence that I'd get all the malicious changes. Thanks again.

answered a month ago

0

Please try these steps:

  1. Reboot the instance from the Lightsail console, then check the site immediately afterward.
  2. If the site loads after the reboot but goes blank again later, that suggests the instance is running out of memory, and the fix is a larger plan (guide below).
  3. If the website still comes back blank, it may have to do with the WordPress configuration.

Upsize guide: https://docs.aws.amazon.com/lightsail/latest/userguide/how-to-create-larger-instance-from-snapshot-using-console.html

AWS
MODERATOR

answered a month 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.