管理这种情况的方法数量没有限制。
我写了一个脚本
mount --bind
将所有wordpress核心文件链接到服务器上的单个位置,该位置以只读方式装载,即使文件可以通过一个文件夹进行编辑。
我绑定的两个目录是wp admin和wp includes(不是wp内容)以及wp settings。php和wp config以外的任何其他文件。php
使用此设置,只需执行以下操作即可轻松升级:
cd /wordpress-master
wget http://www.wordpress.org/wordpress-latest.zip
unzip wordpress-latest.zip
cd wordpress
mv wp-admin ../
mv wp-includes ../
mv *.php ../
完成了。
升级50多个站点大约需要15秒。更不用说,所有wordpress核心文件都是安全的,任何人都无法侵入FTP或其他奇怪的东西。
因此,对于主题兼容性问题,可以在您的设置中这样做:(以下是我的设置)
/vhosts/master/4.5.2/ has wordpress v4.5.2
/vhosts/master/4.5.8/ has wordpress v4.5.8
/vhosts/master/4.6.2/ has wordpress v4.6.2
更新脚本中可能包含以下内容:(在psuedo代码中)
read a file containing the version mounted to each wordpress site,
foreach site {
unmount the current site\'s bound files
mount the current site\'s upgrade version
execute \'wget (sitename/index.php)\' and save to a file
if the file contains the </html> tag near the end
then it the site upgrade completed,
leave the new binding and
update the file with the new version
if it doesnt, then the upgrade failed
unmount the site from the newest version,
remount it back to the version in the file
}