AWS EC2上的Wordpress-分配弹性IP后损坏 [英] Wordpress on AWS EC2 - broken after assigning elastic IP

查看:232
本文介绍了AWS EC2上的Wordpress-分配弹性IP后损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我安装了Wordpress,并且工作正常.我可以通过从实例获取的公共DNS来访问站点和wp-admin.

So, I got Wordpress installed and working just fine. I can access the site and the wp-admin via the public DNS that I get from the instance.

但是,一旦我创建了一个弹性IP并将其与实例相关联,就无法再访问wp-admin,并且不会加载主页样式表和JavaScript文件.

However, once I create an elastic IP and associate it with the instance, I can no longer access wp-admin and the home page style sheets and JavaScript files are not loaded.

我正在尝试使用来自弹性IP的新公共IP访问站点和wp-admin.如果我尝试从弹性IP或EC2实例中使用公共DNS,也是如此.

I am attempting to access the site and the wp-admin using the new public IP from the elastic IP. Same thing is true if I try to use the public DNS from either the elastic IP or the EC2 instance.

当我查看页面源代码时,我发现未加载内容的原因是因为所有资产(.css,.js等)的URL都指向粗体的公共DNS

When I view the page source I see that the reason things aren't loaded is because the URL for all of the assets (.css, .js. etc,) is pointing to the bold public DNS

当我取消弹性IP的关联时,事情不会再恢复工作了.

When I disassociate the elastic IP things do not go back to working again.

我丢失了一些东西,但不知道是什么.

I'm missing something but don't know what.

任何帮助将不胜感激

推荐答案

您的wordpress管理员已经与您的publicDNS相关联.这是因为,登录wp-admin控制台后,您创建了一个新的admin用户.有关您的publicDNS的信息已保存在mysql数据库中.因此,您将无法从弹性IP访问wp-admin.

Your wordpress admin is already associated with your publicDNS. This is because, when you have logged-in the wp-admin console, you have created a new admin user. This information with respect to your publicDNS was saved in the mysql db. So you won't be able to access wp-admin from the elastic IP.

您可以做什么?

您可以登录到wordpress mysql,并将publicDNS的所有引用更新为Elastic IP.完成后,您将能够从静态IP访问wp-admin.

You can log-in to your wordpress mysql and update all the references of the publicDNS to Elastic IP. Once it is done, you will be able to access the wp-admin from the static IP.

这篇关于AWS EC2上的Wordpress-分配弹性IP后损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆