0

Is there a way to reconfigure the previous instance's IP address to the newly assigned IP address.

After I configured all my instance and I tried to assign the elastic IP. I found that the IP is changed. therefore the website under apache2 /var/www/html was no longer valid / unreachable.

is there any way that I can change old IP to new IP address?

NEW: ec2-13-237-246-127.ap-southeast-2.compute.amazonaws.com

will redirect to

OLD:http://ec2-54-206-98-171.ap-southeast-2.compute.amazonaws.com/

since I changed to associate a new IP into this instance.

Fenici
  • 461
  • 1
  • 5
  • 19
  • you want to associate the old elastic IP with a new instance when new instance up right? – Adiii May 28 '19 at 08:49
  • it's the other way around, new elastic IP to old instance . is there workaround to repoint the WordPress folder into new ip? – Fenici May 28 '19 at 09:00
  • for that, you need to update the IP address in the `siteurl` and `home` values with new domain/ip inside wp-options table. – Adiii May 28 '19 at 09:15

2 Answers2

1

Unfortunately, you can not reuse that public IP address.

A public IP address is assigned to your instance from Amazon's pool of public IPv4 addresses, and is not associated with your AWS account. When a public IP address is disassociated from your instance, it is released back into the public IPv4 address pool, and you cannot reuse it.

If you require a persistent public IP address that can be associated to and from instances as you require, use an Elastic IP address instead

Naveen Kerati
  • 951
  • 3
  • 13
  • 29
0

The old DNS will not be available. These DNS entries are auto generated by AWS. If you notice the format, you would see, ec2-<ip-address>.<region>.compute.amazonaws.com.

If you want a static DNS name, you must created a domain, add an address record pointing to your instance's public IP.

Munavir Chavody
  • 489
  • 4
  • 16
  • i dont wanna change DNS. I think there is config file that changes where the webfile pointing – Fenici May 28 '19 at 08:47
  • So you should have a domain name and point your IP address to that. Now in your configuration file, update the current domain to your domain. When ever the IP changes, you just need to update DNS records not the server configuration. – Munavir Chavody May 28 '19 at 08:50
  • I might have to reinstall the web folder again. – Fenici May 28 '19 at 09:06
  • Are you referring to apache config? I don't think a configuration change requires re-installation. – Munavir Chavody May 28 '19 at 09:36