0

I'm facing an issue with my ec2 instance. Until now, I had an ec2 instance working with an IP like this: ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com.

Now I configured an elastic IP to make that instead of use the default domain uses one of my own.

Something goes wrong because now a receive a 403 if I make a request pointing to my new domain.

I'm check that I'm still able to connect to my Ubuntu server 20.04 LTS through SSH. Only have to change the host name to my new domain.(I'm using PuTTy)

Searching on internet if found that the problem can be that my machine still have the old domain in some config files. I don't have experience with Ubuntu servers. I try to find the http.conf file or the apache2 directory in etc., but no one is present..... I don't know what to do next.

I have to change some configuration file? In that case, which one?

I leave you some images from my machine:

  • Root enter image description here
  • etc folder enter image description here

For further information, the security group of my ec2 instance have these rules:

enter image description here

Any help will be appreciated. Thanks

-EDIT I'm trying to access the server, making a request, with Postman like this.enter image description here

And that is the error: enter image description here

For more information. I implemented my ec2 using this video:ec2 video And I changed the domain with that video:link ec2 with namecheap domain

Bocho
  • 75
  • 8
  • Does it work from a different machine? With that you can easily figure out if it's a configuration problem on your machine. Was the domain configuration done on Route53 or with a third-party provider? Try to run a dig or nslookup on your domain name to see if it resolves to your elastic IP. – chamal Nov 18 '22 at 13:35
  • You said "with an IP like this: ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com". This is a hostname, not an ip address. If you used the hostname with elastic ip, try using the ip address associated with ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com instead. – Cole Tierney Nov 18 '22 at 13:57
  • Please update your question with more details. How are you trying to access the server? What is the error? – Nuno Oliveira Nov 18 '22 at 13:58
  • @chamal I only have one machine. I suppose that because I only change the domain, I didn't change anything on the machine. Yes, the configuration was done on Route 53. – Bocho Nov 18 '22 at 18:35
  • @ColeTierney before I config the elastic IP, I did the requests like this: http://ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com/Api/registro/login. Now I want to make the same but changing ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com for bochogame.com, like this : http://bochogame.com/Api/registro/login – Bocho Nov 18 '22 at 18:46
  • @NunoOliveira I added more details, I hope it helps! Thanks – Bocho Nov 18 '22 at 18:50
  • Great to hear that you found a solution! Feel free to add your own Answer instead of putting the answer in your Question. – John Rotenstein Nov 18 '22 at 20:50

2 Answers2

2

I'm afraid it is a propagation issue, that takes more time than the 48 hours, because now it starts to works without changing absolutely nothing. Sorry

Bocho
  • 75
  • 8
  • For this kind of issue, try to dig like this `dig bochogame.com @8.8.8.8` and you will receive the answer from one of the biggest DNS servers. – Nuno Oliveira Nov 21 '22 at 08:55
0

It appears that your requirement is to point bochogame.com to an Elastic IP address.

You can do this by using a DNS Service, such as Amazon Route 53. You would create a A-Record record that points that domain name to the IP address.

If you are unfamiliar with these concepts, I recommend watching some YouTube videos such as DNS with AWS Route 53 - YouTube.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Hi! @John! I'm uses Route 53 to point to my domain. The thing is that doesn't work. I put the name servers in my domain host (namecheap), but something goes wrong because if a make a request with putty, it can't resolve the DNS… I will take a look to your video, but seems the same I did. Thank you all. – Bocho Nov 19 '22 at 12:09