在EC2实例上更改公共DNS(Change public DNS on EC2 Instance)

编程入门 行业动态 更新时间:2024-10-27 07:21:54
在EC2实例上更改公共DNS(Change public DNS on EC2 Instance)

我有一个运行网站的EC2 Ubuntu实例。 我还有一个托管GoDaddy的域名。 我已经设置了一个指向我的实例的弹性IP地址。 我在GoDaddy中设置了我的域以指向弹性IP。 这工作,进入我的域名带我到亚马逊的网站主机。 但在网站加载URL切换后:

www.mydomain.com

到公共DNS:

ec2XX-XXX-XXX-XXX.compute-1.amazonaws.com

我希望域名保留为我的域名,而不是切换到aws public dns。 我联系了GoDaddy的支持,他们告诉我这是在Amazons结束时发生的,所以我必须在aws仪表板的某个地方修复它。 有人可以给我一些步骤来获得这个设置或指出我正确的方向。

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.

最满意答案

问题是Bitnami Magento安装需要更新到新的Web地址。 为此,您可以访问网络服务器,然后:

将应用程序移动到/如果您的应用程序在“/ magento”中运行,则可以从执行以下命令的URL中删除前缀:

$ sudo /opt/bitnami/apps/magento/bnconfig --appurl /

(使用--help检查该选项是否适用于您的应用程序)

现在,您可以在http:// YOUR_DOMAIN而不是http:// YOUR_DOMAIN / magento访问该应用程序。

更新IP或主机名如果计算机IP /域发生更改,某些应用程序需要更新IP /域。 bnconfig工具还有一个选项,可以在引导期间自动更新IP,称为machine_hostname(使用--help检查该选项是否适用于您的应用程序)。 请注意,此工具会将网址更改为http:// NEW_DOMAIN / magento 。

sudo /opt/bitnami/apps/magento/bnconfig --machine_hostname NEW_DOMAIN

如果您已将应用程序移动到根URL,则应同时包含这两个选项。

sudo /opt/bitnami/apps/magento/bnconfig --appurl / --machine_hostname NEW_DOMAIN

如果您已将计算机配置为使用静态域名或IP,则应重命名或删除“/ opt / bitnami / apps / magento / bnconfig”文件。

sudo mv /opt/bitnami/apps/magento/bnconfig /opt/bitnami/apps/magento/bnconfig.disabled

毕竟,只需重新启动apache就可以了。

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.

更多推荐

本文发布于:2023-08-06 09:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1446726.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实例   DNS   Instance   public   Change

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!