[英]How can I run a WordPress website with the same MySQL database into two different servers?
I'm running a website on WordPress wherein daily 10K visitors coming. 我正在WordPress上运行一个网站,每天有1万名访问者到来。 Now I would like to change the existing Theme and Server (Ubuntu 16.04 & LEMP).
现在,我想更改现有的主题和服务器(Ubuntu 16.04和LEMP)。 I have two points that make me confuse because I don't want to disturb visitors.
我有两点让我感到困惑,因为我不想打扰游客。
Can I make a live website on two servers with different IP at the same time? 我可以同时在两个具有不同IP的服务器上建立一个实时网站吗? For ex., newly designed website access by IP ( https://198.XXX.XXX.XXX ) AND Old website can keep running on an existing server IP & Domain Name.
例如,通过IP( https://198.XXX.XXX.XXX )和旧网站进行的新设计网站访问可以在现有服务器IP和域名上继续运行。
If any new article comes up or updated on existing website [old] then will it automatically apply (add) on new server website? 如果在现有网站[旧]上出现或更新了任何新文章,它将自动应用(添加)在新服务器网站上吗?
In short, how can I run WordPress based two websites with the same MySQL database into two different servers? 简而言之,如何将具有相同MySQL数据库的基于WordPress的两个网站运行到两个不同的服务器中?
If that is possible, please guide me how. 如果可以的话,请指导我。
Open wp-config.php in your WordPress installation. 在WordPress安装中打开wp-config.php。 find this
define('DB_HOST', 'localhost');
找到这个
define('DB_HOST', 'localhost');
line and replace with define('DB_HOST', 'https://198.XXX.XXX.XXX');
行并用
define('DB_HOST', 'https://198.XXX.XXX.XXX');
替换define('DB_HOST', 'https://198.XXX.XXX.XXX');
using your old database server's IP you will be now able to access your old server's database. 使用旧数据库服务器的IP,您现在可以访问旧服务器的数据库。
You also need to update site_url to access media files. 您还需要更新site_url以访问媒体文件。 or you can use FeedWordpress plugin.
或者您可以使用FeedWordpress插件。
Two WordPress sites sharing the same content 共享相同内容的两个WordPress网站
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.