不同系统下 MoinMoin 创建的数据文件不一致

我的电脑上装有 Windows XP 和 centos 双系统:在Windows XP可以用 Office 软件等;在 centos 下可以学习 linux 的使用操作等。我装两个系统时,特意划分出一个分区,将两者公用的数据放在这个文件。于是,我就把 MoinMoin 的数据存到这个盘中,以便于切换不同系统时,都可以看到最新的 wiki 数据。结果,出现了在 centos 下添加新的 wiki 页面后,回到 xp 系统下,就不能启动 wiki 的问题。经过层层排查,确定是 centos 系统新建的页面不能在 xp 系统下的 wiki 解析引起的问题。

1 解决思路 

幸好在 linux 系统下编辑文件前,我备份了 mywiki 目录下的 data 和 underlay 文件夹。将使用的数据路径替换成之前备份的文件夹,就可以正常访问 wiki 目录。所以,以后的操作都是针对比较这两种文件夹的区别来进行的。

2 文件夹权限? 

2.1 访问 localhost 提示 403 错误 
You don't have permission to access / on this server.

首先,我以为这个问题是因为 apache 没有权限访问 wwwroot 的文件夹权限。甚至有查到过设置文件夹权限的资料:

For example you can use the command setenforce 0 to turn off SELinux and check to see if the problem goes away. If so, ls -alZ can be used to view SELinux permission and chcon to fix them. 

DO NOT set files or directories to mode 777, even "just to test", even if "it's just a test server". The purpose of a test server is to get things right in a safe environment, not to get away with doing it wrong. All it will tell you is if the problem is with files that actually exist. 

但这个问题不是文件夹权限引起的,而是:在设定的 / 目录下找不到默认显示的主页文件,需要添加 index.html,index.htm,index.php 之类的默认文件即可。

2.2 windows 下文件夹属性的“安全”权限不一致?

联想起,在 centos 下如果启动不了 wiki 服务器,需要关闭 SELinux。那这个问题是不是由于文件夹的权限所引起的。马上查看备份文件夹和当前wiki使用的数据文件夹。果然发现:当前使用的文件夹没有 Administrators、SYSTEM、Authenticated Users、Users 的用户权限配置。依次配置好后,还是不能启动 wiki 服务器。


3 修改了 .pyc 文件? 

那么,不是文件夹的权限问题。所以,想对比这备份文件夹和当前使用文件夹有什么样的区别呢?

首先,我在网上搜索了文件夹对比工具 Beyond Compare,找不到合适的比较信息。

转而使用 Git,将原始文件夹添加,commit 后,将当前使用文件夹覆盖上,找出两者的差异。
#	modified:   cache/__session__/5d913dd3964b9c91a9271b952de09de6cc7f31f2
#	modified:   cache/wikiconfig/drafts/1382603189.06.56339
#	modified:   cache/wikiconfig/surgeprotect/surge-log
#	modified:   edit-log
#	modified:   event-log
#	modified:   pages/(e4bc9ae5a3b0e4bc9ae5bdb1)/cache/text_html
#	modified:   pages/(e59bbee5838fe5a484e79086e7ae97e6b395)/cache/text_html
#	modified:   pages/(e5b9bfe5b79ee58f8ce8afade59bbde99985e6bc94e8aeb2e4bfb1e4b990e983a8)/cache/text_html
#	modified:   pages/(e6a2a6e696ade4bba3e7a081)/cache/text_html
#	modified:   pages/(e788b7e788b7)/cache/text_html
#	modified:   pages/(e7ac9b)/cache/text_html
#	modified:   pages/(e8818ce4b89ae8a784e58892)/cache/text_html
#	modified:   pages/RecentChanges/cache/text_html
#	modified:   pages/clouda/cache/text_html
#	modified:   pages/photoshop/cache/text_html
#	modified:   pages/yangjie/cache/text_html
#	modified:   plugin/__init__.pyc
#	modified:   plugin/action/__init__.pyc
#	modified:   plugin/converter/__init__.pyc
#	modified:   plugin/events/__init__.pyc
#	modified:   plugin/macro/__init__.pyc
#	modified:   plugin/parser/__init__.pyc
#	modified:   plugin/theme/__init__.pyc
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	cache/__session__/3b449c77a2d03d29a268c0e15bb6955cf57aa587
#	cache/__session__/61850b56121680dd4f263e4eb86c3eaa914bbd6e
#	cache/__session__/b8a0eef36f730a83390fde222ad8f0ed5f552459
#	pages/(e6a2a6e696ade4bba3e7a081)/edit-lock
#	pages/centos/

难道是 plugin 中的那些 pyc 文件被修改的缘故吗?马上替换成 backup 中的文件,结果还是启动不起来。

最后,直接一个文件夹一个文件夹的添加,终于发现是 pages 文件夹的问题了。同时,发现在 pages 文件夹中新增加的页面 “centos”是打不开的。

4 问题可能的解决办法 

1. 一种可行的办法是:组建一个服务器,将 wiki 
部署到服务器中,这样数据都是在一个位置,或许就可以解决这个问题。

2. 了解 MoinMoin wiki 的实现原理,研究为什么两个不同系统下,为什么创建的页面不一致?
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值