chkconfig --add mysqldd
chkconfig --list mysqldd
mysqldd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@localhost support-files]# netstat -untlap | grep :3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 38572/mysqld
[root@localhost support-files]# pkill -9 mysqld
[1]+ 已杀死 /usr/local/mysql/bin/mysqld_safe --user=mysql
[root@localhost support-files]# netstat -untlap | grep :3306
service mysqldd status
service mysqldd start
service mysqldd status
service mysqldd stop
service mysqldd start
更改包大小:默认是1M,WiKi导入超过1M的文件会出错。
vi /etc/my.cnf
更改max_allowed_packet = 1M为max_allowed_packet = 32M创建XWiki的数据库:
8.创建xwiki的数据库:
mysql -uroot -p
mysql> create database xwiki
mysql> grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki';
不要使用MyISAM存储引擎,因为MyISAM不支持事务处理,推荐使用InnoDB存储引擎。
vi /etc/my.cnf
[client]
#password = your_password
port = 3306
socket = /tmp/mysqld.sock
default-character-set=utf8
[mysqld]
port = 3306
socket = /tmp/mysqld.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 32M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
default-storage-engine=INNODB
第五步:下载wiki和MySQL连接工具
下载MySQL JDBC Driver Jar放到/data/app_platform/xwiki_tomcat/webapps/xwiki/WEB-INF/lib目录下
wget
mv mysql-connector-java-5.1.34.jar /usr/local/tomcat/webapps/xwiki/WEB-INF/lib/
cd /usr/local/tomcat/webapps/wiki/WEB-INF/lib/
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>jdbc:mysql://localhost/xwiki</property>
<property>xwiki</property>
<property>xwiki</property>
<property>com.mysql.jdbc.Driver</property>
<property>org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property>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>
1.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
2.修改hibernate.cfg.xml
hibernate.cfg.xml中添加
<property>true</property>
<property>UTF-8</property>
3.MySQL的配置文件my.cnf
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_bin
4.管理附件(/var/local/xwiki/)
默认情况下,XWIKI使用数据库存储附件,上传的附件最大为30M左右,同时MySQL的配置文件my.cnf中要设置max_allowed_packet为最大值的3倍左右,因为存储历史版本也会耗费空间
使用文件系统存储可以上传更大的附件,XWIKI使用一个临时目录来存储从数据库中调出的图片或附件。