AWS Cloned EC2 Instance Rerouting to Original Instance

0

I have an EC2 instance running OpenEMR Cloud Express 5.0.1 attached to an Elastic IP address and with a domain name associated with it. I recently cloned the instance using Action -> Create Image, then launched an instance using that image. When I copy the IP address of the cloned instance and paste it into the address bar, it redirects me to the domain name of the original instance and any changes made affect only the original instance. When I ssh into the cloned instance all new data added through the web app is not there.

I was wondering what was causing the redirect and how to fix it? I need the clone instance to be completely separate and working from the original instance so that I can run some tests on it and practice an update.

Thank you for your help.

acs5071

Posted 2019-09-25T19:44:34.963

Reputation: 1

Answers

1

Just a guess, but i suspect what's happening is related to DNS.

1) You type in the new IP, 
2) The new instance loads up and redirects you by name (either http->https or some other redirection reason)
3) Your browser resolves the name to the old IP
4) You're now looking at the old instance in your browser.
5) Failbeans :-(```

If that's the case, easiest fix is to add a hosts entry locally for that name to be the new IP, then you can either keep that for a short time, or if it's a longer time, change the name of the site and make a new DNS entry for it.

If you load the IP with curl and get a 301 or 302 that'll probably be the cause.

curl -I 123.123.123.123

Sirex

Posted 2019-09-25T19:44:34.963

Reputation: 10 321

I believe oint 2 is suggesting that something configured inside the instance is aware of that old hostname, which is likely to be spot-on. In that light, characterizing this as "related to DNS" is likely not all that accurate, even though it could potentially be hacked into submission with a DNS change. The question probably boils down to "how do you tell OpenEMR Cloud Express 5.0.1 what its Internet-facing hostname is?" – Michael - sqlbot – 2019-09-26T01:13:07.977

might be i'm misunderstanding, but it seems to be another way of writing what i wrote. Either the old instance is using its own name and getting back the wrong ip, or the client is directed to use the name and getting back the wrong ip ? Either way, the fix is very similar. All guesswork though as there's not enough information to say either way. – Sirex – 2019-09-26T01:29:30.123

Agreed -- my intention was to suggest that your point 2 needed additional emphasis since the instance itself is almost certainly doing the redirecting to the external hostname of the image's former identity. My interpretation is that DNS is probably correct, but you could be right. +1 – Michael - sqlbot – 2019-09-26T01:49:38.153

0

The issue was an ssl redirect. All I needed to do to get to the web app of the clone instance was put https:// in front of the IP address.

acs5071

Posted 2019-09-25T19:44:34.963

Reputation: 1