Lightsail Public IP Issue

Hello, I’m new to a lot of Cloud Computing. I booted up a Lightsail instance and wanted to redirect a domain (I own) to it.

Per the docs I have done the following:

  • Created a static IP and attached it to the instance.
  • Created a DNS A record that points the domain to the static IP.
  • I added the nameservers from my Lightsail instance to my Route53 registered domain.

I’m currently unable to access my site via either the static IP or domain name. I verified the Firewall settings allow HTTP / SSH inbound, and I can log in to use the terminal just fine. Is there something I’ve missed here? I’ve gone into the instance and restarted the web server to troubleshoot, but that didn’t have much of an effect.

EDIT: I should note this may be a Wordpress issue. I can SSH to the site but not view it by HTTP. The change seemed to happen when I switched from the standard dynamic IP to a static one. Even if Wordpress settings have been affected by the IP change, shouldn’t I still see something?

EDIT2: It’s fixed. The issue seems specific to Bitnami Wordpress, not AWS. This command ‘fixed’ it.

sudo chown bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-config.php

This post describes it better. I’m not quite sure what this means exactly in terms of Linux but it’s clear I’ll need to do some more research.


Related discussions:

Linux? Try
sudo ufw allow 80,443/tcp

and 22 for ssh

Something like this is a bit hard to answer without the domain name.

If you query it; are you getting the correct IP? Does that same question hold true from multiple locations?

If you’re querying it, and you get the wrong IP, it might just be that the TTL hasn’t expired for the record yet.

Or, it could be that your name server records haven’t expired, or that you didn’t set up the nameserver records properly…

Edit: I can’t read; I didn’t see you mentioned that you can’t access via the IP. Can you SSH to the A record?

Using the terminal I try to SSH to the public IP. I get a permission denied (public key). However, I can SSH into it via Amazon’s console.

Edit: I was able to SSH just fine on my Mac Terminal once I updated permission on the key.

Thanks, but it did not help.

Sounds like a firewall issue. Temporarily set your security group wide open, any protocol, from all ports and from all ip’s. Also verify outbound is wide open (should be by default). If you still have connection issues then its probably iptables blocking you.

dig $recordname +short

Run that from your terminal on your mac; does it give the correct IP?

SSH, TCP and HTTP are all open (on 22, 80, and 443). I can SSH into it just fine. But HTTP is the issue (can’t see the site).

Try and disable iptables (im assuming ubuntu?): https://www.cyberciti.biz/faq/ubuntu-start-stop-iptables-service/

Check the status:sudo ufw status

Stop iptables: sudo ufw disable

;; Query time: 12 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Jan 31 08:37:55 EST 2018

did you replace $recordname with your record? Like if I wanted to find out what “www.website.com” resolves to; I’d do this:

15:48:45 me@local ~ dig www.website.com +short
65.61.198.201

what are you using for your webserver? check the listen value (or equivalent for your server) that it is either listening to 0.0.0.0 or the new ip instead of the old dynamic one

dig www.website.com +short 65.61.198.201

Got it. Yes, it resolves to the correct IP.

same for the vhosts as they may be on a specific ip

Right okay, so it’s not the DNS that is the issue then. What does your virtual host configuration in apache look like?

Also you might want to confirm apache is up and listening inside your host, so something like:

  • nc -vw 5 127.0.0.1 80
  • netstat -plan | grep 80

nc -vw 5 127.0.0.1 80

Connection to 127.0.0.1 80 port [tcp/http] succeeded!

netstat -plan | grep 80

(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:36434 127.0.0.1:80 TIME_WAIT -
tcp6 0 0 :::80 :::* LISTEN -
unix 3 STREAM CONNECTED 14180 -
unix 3 STREAM CONNECTED 14805 - /var/run/dbus/system_bus_socket
unix 3 STREAM CONNECTED 14804 -

It’s a Bitnami package but under the hood I think it’s Apache.

This indicates that there’s nothing wrong from a networking perspective - your client machine is successfully able to open a TCP connection to the webserver. But your webserver may not be responding to the HTTP requests sent over that connection.

Try ‘curl -v http://yoursite’ to see how your webserver is responding to requests. You should see HTTP response headers and some kind of body.

EDIT: rereading, I see that the test above only shows that connections succeed locally on the lightsail instance. However, testing remotely against the 65.61.198.201 address also connects successfuly., So the comment stands.

curl -v http://yoursite

Responds that it is connected to website at the appropriate IP on Port 80. But also with internal server error and 500 status. The actual body:

< HTTP/1.1 500 Internal Server Error
< Date: Wed, 31 Jan 2018 17:04:47 GMT
< Server: Apache
< X-Powered-By: PHP/7.0.27
< X-Frame-Options: SAMEORIGIN
< Vary: Cookie
< Content-Length: 0
< Connection: close
< Content-Type: text/html; charset=UTF-8

I’m beginning to suspect the issue may be more with Wordpress than anything else. I’m not the most technical guy in the world but this shouldn’t be this difficult…right?