Linux+Tomcat+XWiki+MySQL安装配置,版本比较旧,仅供参考。
jdk1.5
安装jdk1.5,略
XWiki 使用默认的Jetty+hsqldb解压xwiki-1.1-milestone-1.tar.gz到/usr/wiki/xwiki/
mkdir /usr/wiki
mkdir /usr/wiki/xwiki
cd /usr/wiki/xwiki/
下载或复制xwiki-1.1-milestone-1.tar.gz到/usr/wiki/xwiki/
tar -zxf xwiki-1.1-milestone-1.tar.gz
ln -s ./xwiki-1.1-milestone-1 default
测试:
default /start_xwiki.sh
:8080/xwiki/bin/view/Main/WebHome
可以看到XWiki首页了。
修改配置文件 xwiki.cfg
cd default/webapps/xwiki/WEB-INF/
vi xwiki.cfg
修改
xwiki.encoding=UTF-8
vi web.xml
修改
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
在xwiki.cfg增加
xwiki.upload.tempdir=/tmp
Tomcat 安装略假设Tomcat目录在/usr/tomcat/default,修改/usr/tomcat/default/conf/server.xml:
在上添加:
<Context docBase="/usr/wiki/xwiki/default/webapps/xwiki" path="/xwiki" reloadable="true"/>
MySQL 安装
groupadd mysql
useradd -g mysql mysql
tar -zxf mysql-VERSION.tar.gz
cd mysql-VERSION
./configure --with-charset=utf8 --prefix=/usr/local/mysql
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
bin/mysqld_safe user=mysql &
改密码,yourpassword为你的新密码
mysqladmin -u root password yourpassword
设为服务:cp support-files/mysql.server /etc/init.d/mysql.server chkconfig --add mysql.server 这样就可以通过 service mysql.server start 启动数据库 service mysql.server stop 关闭数据库
更改包大小:默认是1M,WiKi导入超过1M的文件会出错。
vi /etc/my.cnf
更改max_allowed_packet = 1M为max_allowed_packet = 32M
创建XWiki的数据库:
mysql -u root -p
create database xwiki;
grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki';
添加 hibernate.cfg.mysql.xml
cp hibernate.cfg.xml hibernate.cfg.mysql.xml
vi hibernate.cfg.mysql.xml
MySQL相关的内容为:
<!-- Default MySQL configuration
Comment it to use for HSQLDB or Oracle -->
<property name="connection.url">jdbc:mysql://localhost/xwiki?useServerPrepStmts=false</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.MySQLDialect</property>
<property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
<property>2</property>
<property>2</property>
cd default/webapps/xwiki/WEB-INF/
vi xwiki.cfg
修改
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.hsql.xml
为
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.mysql.xml
XWiki 的详细介绍:请点这里
XWiki 的下载地址:请点这里