WordPress 数据库同步的必要性,考虑中;

qxu1146350277.my3w.com

qdm761315182_db
数据库用户名:qdm761315182
连接地址:qdm761315182.my3w.com

mysql     指定 ip 的用户才可以连接数据库,连接不了;指定 ip 连接,可以最大程度保证安全,即使你知道了密码也无济于事,除非你有权限用那台主机连接;

原来设置虚拟主机的 ip 并不是真正的连接 ip,
打开PhpMyAdmin,先设置用户可以用任何主机连接,status – processes  – 打开 auto refresh ,操作WordPress ,找出 WordPress 连接 mysql 真正 ip ,再去修改 用户;

共享虚拟主机:作为不用用户登录的网站 和 下载资源链接  数据库比较小的   辅助外链

缺点:

数据库太小 – 远程连接内网数据库,速度还是不够快,影响体验,可以考虑静态化;使用官方的数据库,速度快很多
无LDAP – 无法改变
设置更改麻烦 – 只能 FTP 上传更改

优点

静态网页快
可以获取真实的 IP
本身有流量可以使用

 

本地内网穿透:

缺点:

无法获取真实的 ip  – 设置太复杂了;设置怕搞坏其他东西 ( 产生其他问题 )   https://10001blog.xslinc.com/?p=7037
流量有费用,且受制于 frp 服务器带宽影响;

优点

内置集成 LDAP
数据库太小不受限制
数据库和WordPress同一主机,速度快,且安全
数据库备份和修改方便
其他文件本地更改非常方便

最优的方案还是:数据库和WordPress同一主机 ( 同一内网 ),用 frp 反代连接,缺陷 – 无法获取真实的 ip ,

速度决定体验,所以放在第一位;

两个wordpress如何同步  https://www.php.cn/cms/wordpress/426021.html
多站点测试不行,可能单站点可能可以;
/* Enable multiple domains access. */
$current_sitename= $_SERVER["HTTP_HOST"];

if ($current_sitename == "www.xslrobot.com") 
	{
	define("xslrobot_SITEURL","https://www.xslrobot.com");
	define("xslrobot_HOME", "https://www.xslrobot.com");
	} 
	
elseif ($current_sitename == "as.xslrobot.com") 
	{
	define("xslrobot_SITEURL", "https://as.xslrobot.com");
	define("xslrobot_HOME", "https://as.xslrobot.com");
	}

注意上述代码需要添加在下列代码的前面。
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);

请教MySQL怎样实现双向同步?   https://bbs.csdn.net/topics/70059688

Mapping Multiple Domains into Single Instance of WordPress   单站点测试ok   多站点未成功

 https://myjeeva.com/mapping-multiple-domains-into-single-instance-of-wordpress.html

WordPress教程:实现WordPress绑定多个域名,不同域名访问同一网站

Editing wp-config.php

Go to WordPress installed root directory and look for wp-config.php file
Place below lines after the table_prefix line; order is very important in wp-config.php , more info

/*
* Handle multi domain into single instance of wordpress installation
*/
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
define( 'WP_CONTENT_URL', '/wp-content');

Go to wordpress admin page and take a look at Settings -> General. You will have WordPress Address (URL) and Site Address (URL) will be in disabled state.  It means your wordpress installation dynamic enoungh to accomadate both domain address

 

https://www.jianshu.com/p/137ed4e71f38   阿里这款开源神器,MySQL数据直接实时同步到ES,太香了!

https://dockone.io/article/9119   基于Docker结合Canal实现MySQL实时增量数据传输

https://wordpress.org/plugins/wpsitesynccontent/#description     WPSiteSync for Content