一、下載tomcathtml
tar -zxvf apache-tomcat-8.0.14.tar.gzjava
mv apache-tomcat-8.0.14 tomcat-xwiki-8.0mysql
二、下載xwiki的war包linux
wget http://download.forge.ow2.org/xwiki/xwiki-enterprise-web-8.4.5.warweb
unzip xwiki-enterprise-web-6.3.warsql
mv xwiki-enterprise-web-6.3 xwiki數據庫
三、建立數據庫apache
create database xwikitomcat
grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki';session
四、下載mysql驅動
wget
http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar
mv mysql-connector-java-5.1.34.jar ./tomcat-xwiki-8.0/webapps/xwiki/WEB-INF/lib/
五、修改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"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<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 container's 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:\P\XWiki Enterprise\webapps\xwiki\WEB-INF\xwiki.cfg「文件中,把「xwiki.superadminpassword=system」用賬號superadmin/system登錄了
f、更改語言配置
XWiki默認是英文的,要更改成中文,須要進入管理頁面 Wiki Administration->Configuration->General->DEFAULT LANGUAGE,把原有的en改成zh,再保存就自動切換到熟悉的中文界面了。
六、安裝相應版本的ui主題
http://maven.xwiki.org/releases/org/xwiki/enterprise/xwiki-enterprise-ui-mainwiki-all/
http://john88wang.blog.51cto.com/2165294/1605787
http://www.linuxidc.com/Linux/2016-11/136751.htm
http://www.th7.cn/db/mysql/201611/211325.shtml
海量視頻獲取