Reputation: 337
I have an EC2 Ubuntu instance running a website. I also have a domain hosted with GoDaddy. I have setup a Elastic IP address which points to my instance. I have setup my domain in GoDaddy to point to the Elastic IP. This works and entering my domain takes me to the site host on amazon. But after the site loads the URL switches from:
www.mydomain.com
to the aws public DNS:
ec2XX-XXX-XXX-XXX.compute-1.amazonaws.com
I want the domain to stay as my domain and not switch to the aws public dns. I contacted GoDaddy support and they told me that this was happening on Amazons end so I must need to fix it somewhere in the aws dashboard. Can someone please give me the steps to get this setup or point me in the right direction.
Upvotes: 1
Views: 1238
Reputation: 337
The issue was that the Bitnami Magento installation needed to be updated to the new web address. To do this you ssh into the webserver and then:
Moving the application to / If your application is running in "/magento" you can remove the prefix from the URL executing the following command:
$ sudo /opt/bitnami/apps/magento/bnconfig --appurl /
(use --help to check if that option is available for your application)
Now you will be able to access to the application at http://YOUR_DOMAIN instead of http://YOUR_DOMAIN/magento.
Updating the IP or hostname Some applications require to update the IP/domain if the machine IP/domain changes. The bnconfig tool also has an option which updates the IP automatically during boot, called machine_hostname (use --help to check if that option is available for your application). Note that this tool changes the URL to http://NEW_DOMAIN/magento.
sudo /opt/bitnami/apps/magento/bnconfig --machine_hostname NEW_DOMAIN
If you already moved your application to the root URL you should include both options at the same time.
sudo /opt/bitnami/apps/magento/bnconfig --appurl / --machine_hostname NEW_DOMAIN
If you have configured your machine to use an static domain name or IP, you should rename or remove the "/opt/bitnami/apps/magento/bnconfig" file.
sudo mv /opt/bitnami/apps/magento/bnconfig /opt/bitnami/apps/magento/bnconfig.disabled
After all that, just reboot apache and your should be good to go.
Upvotes: 1