How to use Elastic IP after marketplace PrestaShop instalation

Keywords: PrestaShop - AWS - How to - Domain Name (DNS)
Description:
Hi All,

So I’m so noob using AWS and so I decided to install PrestaShop using Bitnami’s AWS Marketplace product. The installation was quite easy and no problems there. After the installation, I was able to access the PrestaShop admin system, using the public DNS name provided in the EC2 instance.

Here is where my trouble begins, the thing is, I have my domain and DNS management in a company other than Amazon, so I thought I need to relate an Elastic IP address to the instance, so I can use that IP in my DNS configuration, well that is actually wrong apparently. Now the DNS name is pointing to the old Public IP and erroring, and when using the actual DNS domain name I can acces to the Elastic IP, but that is showing like a report of Elastic IP instead of the actual PrestaShop site.

Has anyone a clue on what I should be doing to make this work?

Thanks in advance for any help or words of advice.

Regards.

Hi @cbabalud,

You could create a CNAME on your DNS management provider that points to the AWS Elastic IP’s DNS name. In that way when the dynamic IP changes, users will still be redirected to the right instance.

Regards,
Michiel

Hi Micheal,

(note: im using www. followed by an space in order to be able to post this due to a restriction on the number of links per post, "www. " = “www.”
Thanks a lot for your response, sorry if I’m missunderstanding you. I had my DNS configured by default in a very traditional way, there was a CNAME record that linked www. domain.com -> domain.com.

And from there a A record that actually linked domain.com -> IP address.

I have changed that CNAME so now www. domain.com -> Public DNS from EC2 instance.

Now when I try to navigate to www. domain.com it end in a error due to connection lost, it is probably because DNS records needs some time to spread, but… dont I need to have in the end an A record that point to an specific static IP address?

In this solution… wouldnt this afftect to the DNS name the user see in the browser? I’ll update this response in a couple hours when the DNS spreads correctly.

Regards.

Hi,
If you have a static IP you can point your A DNS record to that IP, if not, you can point a CNAME to the genereated name by EC2.

Thanks for your response Rafael, I may have missexplained, when I tried to relate a Elastic IP to my EC2 instance, and set that as my IP in my DNS provider, the issue is if I navigate to the IP (or the complete domain name, if the DNS is configured properly) the browser display a page showing some details of the Elastic IP rather than the actual webpage. Is like that Elastic Ip is not binding to respond http responses and serve the instancce hosted in the webpage.

Hi @cbabalud,

Could you check the following post on the AWS support page?

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-associate-static-public-ip/

Regards,
Michiel

Thanks for your response, as I said, I have already tested to create and relate an Elastic IP to my EC2 instance, the problem is that accesing that IP does not display the webpage, it displays a page with information of the Elastic IP, I’m going to do this again, and see If I can add some pictures to make this more clear, because obviously I’m not explaining myself properly.

Hi @cbabalud,

If you followed these steps the IP should be associated to your instance, and the application should be accessible through that IP. Could you also execute the following command and tell me the output?

curl -LI YOUR_ELASTIC_IP_ADDRESS

Regards,
Michiel

Hi all,

Sorry about the delay, I was trying to replicate the issue before mentioned and I havent been able, so find screenshots of the steps I followed when assigning an ElasticIP to my instance and the result obtained, I know for some reason if I try to navigate directly to the ElasticIP in the browser, it tries to redirect me to the old public ip, I thought it might need some time but still happening after more than 24h.

Step 1 - overview of my instance
Step 2 - Navigation using DNS name
Step 3 - it resolves to the public IP and show my site page
Step 4 - Alocating new ElasitcIP
Step 5 - ElasticIP overview
Step 6 - EC2 associated Elastic IP
Step 7 - Trying to navigate to the IP
Step 8 - for some reason is trying to resolve the previous public Ip address.
Step 9 - Changes in my dns configuration (from my domain provider, no AWS)
Step 10 - Trying to navigate with the domain name

Hopefully that clarifies more what I’m doing and why the results are not as expected.

PS: Sorry after writting and updating everything down… it errors when trying to post with all images here (looks so nice in the right side, but apparently im not trustworthy enough, being a new user and all)
So all pictures ziped and uploaded to mega for you to dl https://mega.nz/file/1A9UjQRQ#IPqzROQV_3-MMuMOVvJD1EZa8ck1nwExqBUfZHhZl5o zip pass is “teMmhxgzUNvhPxNfIkpN”
Regards.

Hi @cbabalud,

In the different screenshots (for example Screenshot 1 and 5) there are different Public DNS addresses showing. Could you check this? When associating the Elastic IP did you select the option “Allow this Elastic IP to be reassociated”?

Regards,
Michiel

Thanks Michiel, I have checked and that was different at that moment in time because the EC2 instance and the Elastic Ip werent associated.

Now both the instance and Elastic IP shows the same public DNS.

Regarding the “Allow this Elastic IP to be reassociated” option I think I didnt tick it (I left that as it was by default and now I can manage to see what configuration it has), if you want me to test with an specific value for that property just let me know and I can create a new Elastic IP with that option set to whatever value we want, although it doesn’t look to be the case that I would need to reassociate that Elastic IP since I only want to have 1 EC2 instance, isn’t it?.

Regards.

Hi @cbabalud,

Could you contact AWS support with this issue? The elastic IP is redirecting to the public IP of the instance, but that does not seem related to the Bitnami configuration of your instance.

Regards,
Michiel

Hi,

Thanks Michiel, I already had post this in the forum, but there they are not as willing to help as you.
https://forums.aws.amazon.com/thread.jspa?threadID=323369

Regards.

Just in case you want to take a look, apparently somehow the EC2 instance is caching the Public IP on launch, the problem of that weird redirection stopped happening after restarting the instance.

Hi @cbabalud,

Great to hear it’s solved now. Thanks for sharing. :smile:

Regards,
Michiel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.