02 mediawiki

来自DeerGrove Wiki
跳转至: 导航搜索

Mediawiki 概述

  • MediaWiki是全球最著名的wiki知识库引擎,运行于PHP+MySQL环境.
    • MediaWiki从2002年2月25日被作为维基百科全书的系统软件,并有大量其他应用实例.
    • 目前MediaWiki的开发得到维基媒体基金会的支持.
    • MediaWiki是建立wiki网站的首选后台程序,目前国内的天下维客等站点都采用这套系统.
    • MediaWiki一直持续更新.其原作者为德国的Magnus Manske.

选择Mediawiki来搭建wiki知识库的理由?

  1. 经受过重量级应用的考验,功能丰富而且易于安装
  2. 全世界最大的wiki项目维基百科是使用mediawiki的成功范例,数据量、访问量都超级庞大
  3. mediawiki的功能非常丰富,支持多语言版本,充分满足知识站点的需要
  4. 运行环境要求很低,架设过程简洁,即使新手也可以迅速建立自己的站点
  5. mediawiki是目前应用最广的wiki程序,数以万计的网站在使用它,很容易找到范例站点
  6. 持续开发,程序特性功能不断完善,保证未来的支持
  7. mediawiki是受到维基媒体基金会支持的开源项目,在功能、性能、安全方面将不断优化

Mediawiki的缺点

  1. 后台管理功能不是很完善,仅通过简单的特殊页面完成这些功能.
  2. 一般环境下,mediawiki的运行速度相对其他wiki程序要差很多.
  3. mediawiki的目标是为维基媒体项目服务,很多华丽的性能特征要在高端设备环境(多服务器,多数据库,反向缓冲squid服务器阵列,大量额外的PHP缓冲引擎)中才能体现.
  4. 在界面方面关注不够,导致外观美化的修改繁琐,甚至需要一定的技术背景

Mediawiki系统特色

  1. wiki的重要特征
  2. 记录所有的改动版本,能方便的查阅历史更新记录,这使得开放性编辑成为可能
  3. 自动产生链接,编辑文本中中括号中的内容(如“x条目”)将自动产生链接
  4. 允许使用模板,方便对相同内容的重复使用、更新
  5. 支持分类,并根据分类在不同的文章之间自动产生关联
  6. 允许每个用户自行选择系统外观
  7. 中文支持较好

Mediawiki

Deergrovemin的MediaWiki安装积累

  • 插件安装需要通过extensions上传,及localsettings.php修改
 require_once "$IP/extensions/CategoryTree/CategoryTree.php";
 require_once "$IP/extensions/Cite/Cite.php";
 wfLoadExtension( 'WikiEditor' );
 $wgUseAjax = true;
  • smtp配置需要修改localsetting.php,同时,又遇到了pfsockopen() 函数问题;
 Deermin Wiki不能发送确认邮件,请检查您的邮箱地址是否包含无效字符。邮件发送器的返回信息:
 Failed to connect to ssl://smtp.qq.com:465 
 [SMTP: Failed to connect socket: pfsockopen() has been disabled for security reasons (code: -1, response: )]
  • localsettings.php按照官网建议,增加如下代码:
 $wgSMTP = array(
 'host'     => "mail.example.com", // could also be an IP address. Where the SMTP server is located
 'IDHost'   => "example.com",      // Generally this will be the domain name of your website (aka mywiki.org)
 'port'     => 25,                 // Port to use when connecting to the SMTP server
 'auth'     => true,               // Should we use SMTP authentication (true or false)
 'username' => "my_user_name",     // Username to use for SMTP authentication (if being used)
 'password' => "my_password"       // Password to use for SMTP authentication (if being used)
 );
  • 关于smtp的ssl认证可以采用如下方法实现:
 ssl://smtp.example.com
  • MediaWiki的域名修改同样也是依托于LocalSettings.php,修改如下两行代码:
 $wgScriptPath = "";
 $wgServer = "http://exmple.xxx";

Mediawiki对比Dokuwiki使用感受

  • 对比dokuwiki,不够轻便,功能多,运行速度较慢,后台设置较为繁琐
  • 页面过于生硬,不如dokuwiki柔和
  • 曾经出现过user.php运行异常,页面错误

目前为止安装剩余问题点

2018/5/4

  1. 文件上传MIME拦截
  2. 分类根目录未理解
  3. MobileFrontend插件使用异常

2018/5/3

  1. 邮件发送配置问题
  2. extensions安装问题
  3. skin设置问题
  4. sidebar设置问题

2018/5/8

  1. MobileFrontend 移动前端问题解决
  • 匹配系统1.3.0版本的extensions上传
  • 代码增加如下:
 /*-----2018/5/8 Aker---Mediawiki MobileFrontend-----*/
 wfLoadExtension( 'MobileFrontend' );
 $wgMFNearby = true;
 /*require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";*/
 $wgMFAutodetectMobileView = true;
 // Choose one of those:
 $wgMFDefaultSkinClass = 'SkinVector'; // use Vector skin
 $wgShowExceptionDetails = true;
  • 实现功能:移动设备端自动识别并显示移动前端skin。
  1. 邮件配置采用ssl的QQ邮箱,成功
 'host'     => "ssl://smtp.qq.com"

2018/5/25

  1. ICP备案号脚注增加,需要修改相应皮肤的php文件,以Vector皮肤为例:
    1. 编辑 /skins/Vector/VectorTemplate.php
    2. 找到 <?php $footericons = $this->getFooterIcons( 'icononly' )这行,
    3. 在它之前插入下面一行:
    4. 然后Ctrl+F5强制刷新网页就能看到效果