標籤:

xwiki系統 知識庫

1、下載tomcat

tar -zxvf apache-tomcat-8.0.14.tar.gz

mv apache-tomcat-8.0.14 tomcat-xwiki-8.0

2、下載xwiki的war包

wget download.forge.ow2.org/

unzip xwiki-enterprise-web-6.3.war

mv xwiki-enterprise-web-6.3 xwiki

3、創建資料庫

create database xwiki

grant all

privileges on xwiki.* to xwiki@127.0.0.1 identified by xwiki;

4、下載mysql驅動

wget

repo1.maven.org/maven2/

mv mysql-connector-java-5.1.34.jar ./tomcat-xwiki-8.0/webapps/xwiki/WEB-INF/lib/

5、修改xwiki配置

cp -p hibernate.cfg.xml

hibernate.cfg.xml-bak

vi hibernate.cfg.xml 刪除所有多餘的配置文件。

[root@fanxh WEB-INF]# cat hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-configuration PUBLIC

"-//Hibernate/Hibernate Configuration DTD//EN"

"hibernate.org/dtd/hiber">

<hibernate-configuration>

<session-factory>

<!-- MySQL configuration.

Uncomment if you want to use MySQL and comment out

other database configurations.

-->

<property

name="connection.url">jdbc:mysql://localhost/xwiki</property>

<property

name="connection.username">xwiki</property>

<property

name="connection.password">xwiki</property>

<property name="connection.driver_class">com.mysql.jdbc.Driver</property>

<property

name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>

<property

name="dbcp.ps.maxActive">20</property>

<mapping resource="xwiki.hbm.xml"/>

<mapping resource="feeds.hbm.xml"/>

<mapping resource="activitystream.hbm.xml"/>

<mapping resource="instance.hbm.xml"/>

</session-factory>

</hibernate-configuration>

a.XWIKI字符集編碼配置 修改 web.xml文件

/data/app_platform/xwiki_tomcat/webapps/xwiki/WEB-INF/xwiki.cfg

#-# The encoding to use when

transformin strings to and from byte arrays. This causes the jvm encoding to be

ignored,

#-# since we want to be independend of the underlying system.

xwiki.encoding=UTF-8

b.修改hibernate.cfg.xml

hibernate.cfg.xml中添加

<property name="connection.useUnicode">true</property>

<property

name="connection.characterEncoding">UTF-8</property>

c.MySQL的配置文件my.cnf

[client]

default-character-set=utf8

[mysqld]

default-character-set=utf8

character-set-server=utf8

collation-server=utf8_bin

d.管理附件(/var/local/xwiki/)

默認情況下,XWIKI使用資料庫存儲附件,上傳的附件最大為30M左右,同時MySQL的配置文件my.cnf中要設置max_allowed_packet為最大值的3倍左右,因為存儲歷史版本也會耗費空間 使用文件系統存儲可以上傳更大的附件,XWIKI使用一個臨時目錄來存儲從資料庫中調出的圖片或附件。

附件的存儲目錄在xwiki.properties中設定,不可以隨意增加或刪除這個目錄下的內容,因為每個附件在資料庫中都有相應的元數據

#-# Note if the system property xwiki.data.dir is set then this property is not

used.

#-# If neither the system property nor this configuration value here are set

then the Servlet containers temporary

#-# directory is used; This is absolutely not recommended since that directory

could be wiped out at any time and you

#-# should specify a value.

environment.permanentDirectory=/var/local/xwiki/

最好在第一次運行XWIKI的時候就設定好附件的存儲方式

在xwik.cfg文件中設置 xwiki.store.attachment.hint=file

xwiki.store.attachment.versioning.hint=file

xwiki.store.attachment.recyclebin.hint=file

用管理員登陸的話,需要修改xwiki.cfg,將xwiki.superadminpassword=system 前面#去掉, 用superadmin/system登陸即可。

e、開啟管理員管理功能

XWiki默認安裝是沒開啟管理員帳號的,要打開管理員帳號,需要到安裝目錄「X:PXWiki EnterprisewebappsxwikiWEB-INFxwiki.cfg「文件中,把「xwiki.superadminpassword=system」用帳號superadmin/system登陸了

f、更改語言配置

XWiki默認是英文的,要更改為中文,需要進入管理頁面 Wiki Administration->Configuration->General->DEFAULT

LANGUAGE,把原有的en改為zh,再保存就自動切換到熟悉的中文界面了。

6、安裝相應版本的ui主題

maven.xwiki.org/release

john88wang.blog.51cto.com

linuxidc.com/Linux/2016

th7.cn/db/mysql/201611/


推薦閱讀:

TAG:知識庫 |