linux 安裝xwiki


 tomcat運行需要內存,請確保內存足夠,否則可能會導致xwiki訪問過慢甚至出錯

 

1.安裝 java

 https://www.cnblogs.com/gudanaimei/p/12525325.html

2.安裝tomcat

https://www.cnblogs.com/gudanaimei/p/12525588.html

tomcat若已啟動,請務必關閉tomcat(后面要修改tomcat的配置文件,可能會導致tomcat無法正常啟停)

3.安裝mysql並授權

https://www.cnblogs.com/gudanaimei/p/12206596.html

登錄mysql后

創建xwiki庫
create database xwiki character set utf8 collate utf8_general_ci;

創建xwiki用戶並授權
create user 'xwiki'@'%' identified with mysql_native_password by 'xwiki123';

grant all privileges on xwiki.* to 'xwiki';

4.安裝xiwiki

1)下載xwiki包

http://download.forge.ow2.org/xwiki/

 

2)解壓xwiki包到tomcat安裝目錄的webapps下(tomcat安裝目錄為/app/tomcat-8.5.53)

mkdir /app/tomcat-8.5.53/webapps/xwiki
unzip xwiki-9.11.5.war -d /app/tomcat-8.5.53/webapps/xwiki

 

3)mysql-connector-java-5.1.47.jar

下載鏈接

https://downloads.mysql.com/archives/c-j/

解壓下載的包
unzip mysql-connector-java-5.1.47.zip

拷貝.jar
cp mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar /app/tomcat-8.5.53/webapps/xwiki/WEB-INF/lib

 

4)修改xwiki配置

vi /app/tomcat-8.5.53/webapps/xwiki/WEB-INF/hibernate.cfg.xml

注釋默認的hsql段

<!-- Configuration for the default database.
Comment out this section and uncomment other sections below if you want to use another database.
Note that the database tables will be created automatically if they don't already exist.

If you want the main wiki database to be different than "xwiki" (or the default schema for schema based engines)
you will also have to set the property xwiki.db in xwiki.cfg file

<property name="connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>

<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>

<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>

-->

 

 打開mysql段

<!-- MySQL configuration.
Uncomment if you want to use MySQL and comment out other database configurations.
Notes:
- if you want the main wiki database to be different than "xwiki"
you will also have to set the property xwiki.db in xwiki.cfg file
-->

<property name="connection.url">jdbc:mysql://mysqlIP:port/xwiki?useSSL=false</property>
<property name="connection.username">xwiki(連接mysql的用戶)</property>
<property name="connection.password">xwiki123(連接mysql用戶的密碼)</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>

新增下面三行:
<property name="connection.charSet">UTF-8</property>
<property name="connection.characterEncoding">UTF-8</property>
<property name="connection.useUnicode">true</property>
<property name="dbcp.poolPreparedStatements">true</property>
<property name="dbcp.maxOpenPreparedStatements">20</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>

 

5.配置xwiki離線flavor頁面

下載
https://nexus.xwiki.org/nexus/content/repositories/releases/org/xwiki/platform/xwiki-platform-distribution-flavor-xip/

重命名
mv  xwiki-platform-distribution-flavor-xip-9.11.5.xip  ./xwiki-platform-distribution-flavor-xip-9.11.5.zip

vi /app/tomcat-8.5.53/webapps/xwiki/WEB-INF/xwiki.properties

打開注釋,根據要求修改路徑(flavor頁面路徑)
environment.permanentDirectory=/var/local/xwiki/

創建flavor路徑
mkdir /var/local/xwiki/extension/repository -p

解壓
unzip xwiki-platform-distribution-flavor-xip-9.11.5.zip -d /var/local/xwiki/extension/repository

 

6.修改tomcat配置文件

vi /app/tomcat-8.5.53/conf/server.xml

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"

加入以下內容:
URIEncoding="UTF-8"
compression="on"
compressionMinSize="2048"
compressableMimeType="text/html,text/xml,text/css,text/javascript,application/x-javascript"/>

 

7.啟動tomcat訪問xwiki

啟動tomcat
/app/tomcat-8.5.53/bin/start.sh

瀏覽器訪問xwiki(啟動之后需要等一會才能正常訪問)
在瀏覽器中輸入 IP:8080/xwiki出現xwiki初始化界面

 

8.xwiki初始化過程

 

 

 

填寫帶有Required的字段即可

 

 

 

如果沒有下載離線flavor,該步會很慢(預計一個小時),選中flavor,點擊Install this flavor

 

 

點擊Continue

 
 
等待安裝flavor

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM