背景

接任务部署一个wiki, 要求: java语言开发, 开源, 内网部署; 需要支持: 大文件上传(300m左右), 所见即所得(wycwyg), 导出, LDAP, 评论与权限.

通过一个好用的 wiki compare (https://www.wikimatrix.org/) 网站对比后, 可用的只剩 XWIKI 与 JSPWIKI (https://jspwiki.apache.org/)了, 最终选定 XWIIKI.

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

准备工作

我使用的是java (version 1.8.0_111), tomcat(version 8.5), mysql(version 5.7.25) .

1, 使用 war 包部署, 选定当前的稳定版本下载https://www.xwiki.org/xwiki/bin/view/Download/, 下载 WAR Package for Servlet Container 和 XIP Addon Package for Offline Installs (有网无需下载, 在  Distribution Wizard 的 step 2 可以在线安装).

    

2, 下载 org.xwiki.contrib.ldap_ldap-ui-x.x.x.xar (https://extensions.xwiki.org/xwiki/bin/view/Extension/LDAP/Application/), 对 LDAP 进行可视化配置.

3, 从xwiki的maven私服(https://nexus.xwiki.org/nexus )下载LDAP所需的jar包

<dependency>
  <groupId>org.xwiki.contrib.ldap</groupId>
  <artifactId>ldap-api</artifactId>
  <version>x.x.x</version>
</dependency>
<dependency>
  <groupId>org.xwiki.contrib.ldap</groupId>
  <artifactId>ldap-authenticator</artifactId>
  <version>x.x.x</version>
</dependency>
<dependency>
  <groupId>com.novell.ldap</groupId>
  <artifactId>jldap</artifactId>
  <version>2009-10-07</version>
</dependency>

4, 准备MySQL JDBC Driver Jar,  mysql-connector-java-x.x.x. jar 包

部署

1, 数据库

# 建库
create database xwiki default character set utf8; # 授权
# grant all privileges on xwiki.* to xwiki@'%' identified by 'xwiki';

2, 把下载好的 war 包(war包改名为xwiki.war), 放入 tomcat 容器内, war包解压.

  把 mysql-connector-java-x.x.x. jar, ldap-api-x.x.x.jar, org.xwiki.contrib.ldap_ldap-authenticator-x.x.x.jar, jldap-2009-10-07.jar, 放入 ${tomcat}\webapps\xwiki\WEB-INF\lib\ 下.

  ps: tomcat 启动过程中如果日志出现: because there was insufficient free space ... consider increasing the maximum size of the cache.
  修改 ${tomcat}\conf\context.xml, 添加 <Resources cachingAllowed="true" cacheMaxSize="100000" />;
  如果不起作用, 修改 ${tomcat}\webapps\xwiki\META-INF\context.xml, 添加<Resources cachingAllowed="true" cacheMaxSize="100000" />

3, 修改 XWIKI 的配置, 在 ${tomcat}webapps\xwiki\WEB-INF\ 下

  hibernate.cfg.xml

    更换 database 相关配置, 注释掉 Configuration for the default database . 打开 MySQL configuration , 修改 Mysql 的 connection.url, connection.username, connection.password.

  xwiki.cfg

    启用 superadmin, 打开 # xwiki.superadminpassword=system.

    打开并修改LDAP的设置, xwiki.authentication.authclass=org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl

    设置附件存储方式:

      xwiki.store.attachment.hint=file
      xwiki.store.attachment.versioning.hint=file
      xwiki.store.attachment.recyclebin.hint=file

  xwiki.properties

    设置附件存储目录, 打开 #environment.permanentDirectory=/var/local/xwiki/

4, 把 xwiki-platform-distribution-flavor-xip-x.x.x.xip (可改为zip进行解压, 其实就是一个zip包), 解压放入 xwiki.properties中配置的${environment.permanentDirectory}\extension\repository\下. 重启tomcat.

  ps: tomcat启动后, 会提示从 https://nexus.xwiki.org 获取 findbugs 等jar包失败等报错信息(因为我是无外网安装, 有网情况下不会出现), 无视就好了.

  

5, 浏览器中输入 ip:port , 会进行 xwiki 初始化, 初始化完成后, 进入 Distribution Wizard 的 页面, 在 step2(其余step很简单) 等待加载出离线的flavor, 下边是官方给的Installation Guide(https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/).

Installing without internet connection
XIP package
Since 9.5 a XIP package is provided for the Standard flavor. This is actually a zip file containing the required XWiki extensions for both the main wiki and subwikis, in the same format than the local extensions repository. download it (use the exact same version of the XIP package as the version of XWiki you have)
Unzip it (rename it to .zip if your zip tool does not recognize it) in the folder <permanentdirectory>/extension/repository
(if you get complains about already existing files don't overwrite them)
Restart XWiki if it was running
Resume standard installation, this time it will find the flavor locally

  

        step2 如图所示(我已经安装好了, 图是我在网上找的, 版本请忽略), 安装flavor.

6, 配置LDAP. 官网指示(https://extensions.xwiki.org/xwiki/bin/view/Extension/LDAP/Application/) 不靠谱

  6.1, superadmin登录后, 进入 http://ip:port/bin/admin/XWiki/XWikiPreferences, 依次点击 content -> import->upload 下载好的org.xwiki.contrib.ldap_ldap-ui-x.x.x.xar, 最后点击 右下的 import 按钮

  

  6.2, import 成功后, 可以在 http://ip:port/bin/admin/XWiki/XWikiPreferences 的 Other -> LDAP 中 进行可视化配置, 我在配置了 红框中的属性后, LDAP可以正常使用了.

  

  

``` sh

# 修改tomcat

CATALINA_OPTS="-server -Xms800m -Xmx1600m -Dfile.encoding=utf-8 -Djava.awt.headless=true -XX:+UseParallelGC -XX:MaxGCPauseMillis=100"

```

XWIKI离线WAR包部署(LDAP登录)的更多相关文章

  1. struts2使用Convention Plugin在weblogic上以war包部署时,找不到Action的解决办法

    环境: struts 2.3.16.3 + Convention Plugin 2.3.16.3 实现零配置 现象:以文件夹方式部署在weblogic(10.3.3)上时一切正常,换成war包部署,运 ...

  2. 将war包部署到服务器的详细步骤

    第一步: 先将项目打包成war文件,也就是将在项目上单击鼠标右键,选择Export: 选择WAR file,点击下一步: 会出现如下所示,选择你要保存的位置,点击完成: 在你所选择的地方会有个如下所示 ...

  3. SpringBoot之打成war包部署到Tomcat

    正常情况下SpringBoot项目是以jar包的形式,正常情况下SpringBoot项目是以jar包的形式,并且SpringBoot是内嵌Tomcat服务器,所以每次重新启动都是用的新的Tomcat服 ...

  4. springboot 学习之路 5(打成war包部署tomcat)

    目录:[持续更新.....] spring 部分常用注解 spring boot 学习之路1(简单入门) spring boot 学习之路2(注解介绍) spring boot 学习之路3( 集成my ...

  5. Windows下war包部署到Linux下Tomcat出现的问题

    最近,将Windows下开发的war包部署到Linux下的Tomcat时报了一个错误:tomcat error in opening zip file.按理说,如果正常,当把war包复制到webapp ...

  6. 【项目部署】部署项目以war包部署和解开以目录部署的区别

    我们都知道最简单的部署web项目的方式是打成war包直接仍在tomcat的webapps目录下,我上个项目也确实是这样做的,可是这给我们后期的维护带来了极大的不便,下面就简单研究一下以war包部署和解 ...

  7. 将Web项目War包部署到Tomcat服务器

    1. 配置Java运行环境 1.1 下载并安装JDK 从官网上下载最新的JDK:http://java.sun.com/javase/downloads/index.jsp ,下载后安装,选择想把JD ...

  8. maven intall在target文件夹中自动生成的war包部署服务器时缺斤少两

    1.问题描述,本地改动特别大或者升级系统操作,打war包部署服务器上程序时候,页面或者后台总是报错,原因就是比本地少东西. 2.问题排查解决:maven clean然后maven intall在tar ...

  9. eclipse项目转移至IDEA与IDEA tomcat报错(idea自带tomcat版本太高)与war包部署到win服务器与idea提交git的总结

    eclipse导出项目到idea时,不要导出target: idea打开eclipse项目后,出现junit找不到的问题,原因是jar包缺失,而maven配置的低版本的junit也显示找不到,解决办法 ...

随机推荐

  1. 编译在docker alpine中可用的go程序

    get docker image docker pull golang build docker run -it --rm -v `pwd`:/root/src -w /root/src golang ...

  2. sqlserver查找使用了某个字段的所有存储过程

    当一个系统中使用了很多的表,并且存在大量的存储过程,当数据库中的某个表删除了某个字段,那么相应的存储过程也需要改动,但是我们不知道哪些存储过程使用了该字段,那我们该怎么办?我们可以从之前的文档一个一个 ...

  3. js将一维数组转化为二维数组

    遇到的问题: 后端返回的是一组一维数组,但是需要展示的格式是二维数组,常见的场景举例:后台返回10个长度的数组,需要分成3个一组展示在banner上. 例:[1,2,3,4,5,6,7,8,9,10] ...

  4. 【Python】Elasticsearch和elasticsearch_dsl

    官网:https://elasticsearch-py.readthedocs.io/en/master/api.html 官网:https://github.com/elastic/elastics ...

  5. python2.7 Cheetah You don't have the C version of NameMapper installed

    问题:You don't have the C version of NameMapper installed sudo vi /usr/lib/python2.7/site-packages/Che ...

  6. Zabbix11.3 Zabbix SNMP 常用OID列表

    点击获取CISCO设备OID 系统参数(1.3.6.1.2.1.1) OID 描述 备注 请求方式 .1.3.6.1.2.1.1.1.0 获取系统基本信息 SysDesc GET .1.3.6.1.2 ...

  7. 《2018面向对象程序设计(Java)课程学习进度条》

    周次 (阅读/编写)代码行数 发布博客量/博客评论数量 课堂/课余学习时间(小时) 最满意的编程任务 第一周 50/40 1/0 6/4 九九乘法表 第二周 100/80 1/0 6/8 实验5,6, ...

  8. linux光标操作

    看一个真正的专家操作命令行绝对是一种很好的体验-光标在单词之间来回穿梭,命令行不同的滚动. 在这里强烈建立适应GUI节目的开发者尝试一下在提示符下面工作. 但是事情也不是那么简单,还是需要知道“如何去 ...

  9. take it easy

    昨天魏辉在群里说,觉得自己以前很多事情做的不对,以前是个傻瓜,我说我也是这么觉得的.为什么这么说呢?因为我真的觉得以前的自己就是个SB.人的成长可能就是这样的吧,小时候的一些事情,或者是原生家庭的环境 ...

  10. pyhon的yileld的一点笔记

    yield感觉很神秘,感觉也不好理解,学习pyhon最后终归是要学习这个东西,研究了一段时间,把自己的笔记写下来 说简单点就是遇到yield就停止往下执行代码,也包括不执行yield这条语句,然后返回 ...