XWiki完整使用指南:安装配置、扩展开发与故障排除

2024-06-21 李腾 163 次阅读 0 次点赞
本指南全面介绍XWiki开源Wiki平台的核心功能与实战应用,包含官方资源导航、详细使用教程、常用扩展推荐、相关技术文档和常见问题解决方案。特别针对XWiki部署过程中的启动脚本修改、服务自启动、界面优化、升级故障等实际问题提供可操作的解决方法,同时分享性能调优经验和扩展开发技巧,帮助企业快速构建稳定高效的知识管理系统。

XWiki是一个Java开发的开源Wiki,界面美观,功能强大,支持可视化编辑、上传附件,支持在网页上使用 Velocity、Groovy、Python等语言进行编程,特别适合用作本地知识库或企业内网知识库。这里,我们提供了xwiki的官方网站、使用教程、常用扩展、相关文档和常见问题。

官方网站

官网:https://www.xwiki.org/xwiki/bin/view/Main/WebHome

开源项目:xwiki/xwiki-platform: The XWiki platform

REST API:REST API (XWiki.org)

开发指南:Developer Guide (XWiki.org)

使用教程

使用xwiki创建个人和企业知识库

XWiki默认语言改为中文

xwiki启动和结束脚本修改

使用WinSW创建自启动服务

导航显示文档标题改为文档名称

解决xwiki升级后所有链接显示下划线的问题

解决xwiki升级后点击编辑报错问题

修改XWiki应用名称为中文

XWiki导航和页面选择文档树改为显示页面名称

常用扩展

Statistics Application:http://extensions.xwiki.org/xwiki/bin/view/Extension/Statistics%20Application

Most Viewed Articles:http://snippets.xwiki.org/xwiki/bin/view/Extension/Most%20Viewed%20Articles

Matomo Application:https://extensions.xwiki.org/xwiki/bin/view/Extension/Piwiki%20Integration

相关文档

统计文档:https://forum.xwiki.org/t/statistics-document-page-views-for-a-given-user/520

Matomo使用方法:https://dev.xwiki.org/xwiki/bin/view/Drafts/Matomo%20for%20better%20statistics/

常见问题

1、 停止xwiki服务,一直处于正在停止状态。net stop xwiki报错:服务正在启动或停止中,请稍后片刻后再试一次。

注释掉 start_xwiki.bat 和 stop_xwiki.bat 最后的PAUSE即可。

2、导入XAR文件,报错:handleException /xwiki/bin/import/XWiki/XWikiPreferences org.eclipse.jetty.http.BadMessageException: 400: Unable to parse form content。

编辑文件:xwiki\webapps\xwiki\WEB-INF\jetty-web.xml。将 maxFormContentSize 改为 10000000,将 maxFormKeys 改为 20000

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <!-- In order to avoid getting a "java.lang.IllegalStateException: Form too large" error when editing large page in
       XWiki we need to tell Jetty to allow for large content since by default it only allows for 20K. We do this by
       passing the "org.eclipse.jetty.server.Request.maxFormContentSize" attribute.
       Note 1: Setting this value too high can leave your server vulnerable to denial of service attacks.
       Note 2: We're setting it here instead of in Jetty's XML configuration files so that the XWiki WAR can be used
       in any Jetty config and work out of the box.
  -->
  <Set name="maxFormContentSize">10000000</Set>
  <!-- Increasing the maxFormKeys in order to be able to import correctly a full wiki (more than 1000 pages in 11.10).
  The import should be fixed at a point to allow importing everything without creating a form with a field by page.
  Once done this configuration can be removed. See https://jira.xwiki.org/browse/XWIKI-11597 for a follow up. -->
  <Set name="maxFormKeys">20000</Set>
</Configure>

3、Statistics Application 显示:The statistics module is disabled by default for improved performances.。

编辑文件 xwiki\webapps\xwiki\WEB-INF\xwiki.cfg,将 xwiki.stats.default 设置为 1。

xwiki.stats.default=1

4、 代码组件 Code Snippet 有时会缩小成一点,不能填充一行。

在 ~{~{code language="none"}} 或 ~{~{/code}} 两边有空格,去掉空格即可。

5、XWiki重启电脑后,打开页面报错。

首先,清空文件夹D:\java\xwiki\data\cache,重启xwiki服务,刷新浏览器。

如果xwiki样式不对,是浏览器缓存导致的,清空浏览器缓存即可。

6、2核2G内存云服务器,部署xwiki够用吗?

2核2G的云服务器,xwiki可以正常使用,但是很多页面加载会很慢。建议云服务器至少4G内存,至少给xwiki分配2G内存。

7、Error number 90012 in 5: Exception in plugin [com.xpn.xwiki.plugin.scheduler.SchedulerPlugin]: Error occured while trying to trigger job Test。

计划任务点击Trigger报错。解决方法:先Schedule后再点击Trigger。

本文由人工编写,AI优化,转载请注明原文地址: XWiki使用教程及常见问题

评论 (2)

登录后发表评论
莉莉安2025-11-07 13:35:51
这个教程太及时了!我们团队最近正在考虑搭建内部知识库,XWiki的功能看起来完全符合需求。想问下文档里提到的Velocity脚本编辑,对非技术人员的学习门槛高吗?另外有没有推荐的备份方案?希望后续能补充更多权限管理的实战案例。
张大卫David2025-11-06 21:08:42
这篇教程太及时了!最近公司正好在考虑搭建内部知识库,XWiki的功能看起来完全能满足需求,特别是支持多种脚本语言和可视化编辑。想请教一下,在部署时有没有推荐的内存配置?我们测试环境用默认参数启动后偶尔会响应缓慢。另外文档树显示页面名称的修改方法很实用,之前就被默认标题搞糊涂过。已经收藏了,周末就按教程一步步部署试试!