CentOS 5.4下基于Jabber/XMPP协议的Openfire服务器配置笔记

平台 GNU/Linux
版本 CentOS 5.4 X86_X64

1、首先安装MySQL数据库,安装mysql的依赖就不说了,你也直接可以用yum安装
wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.56.tar.gz
tar xzvf mysql-5.1.56.tar.gz
cd mysql-5.1.56
./configure –prefix=/usr/local/mysql \
–without-debug \
–enable-thread-safe-client \
–enable-assembler \
–with-mysqld-user=mysql \
–with-unix-socket-path=/usr/local/mysql/sock/mysql.sock \
–with-mysqld-ldflags=-all-static \
–with-client-ldflags=-all-static \
–with-charset=latin1 \
–with-extra-charsets=utf8,gbk \
–with-plugins=innobase \
–with-ssl \
–enable-local-infile \
–with-server-suffix=-community
make && make install

groupadd dba
useradd -g dba mysql
chown-R dba:mysql /usr/local/mysql/.

cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
sed -i ‘s/skip-locking/skip-external-locking/g’ /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db –user=mysql –basedir=/usr/local/mysql
/usr/local/mysql/bin/mysqld_safe &
/usr/local/mysql/bin/mysqladmin -u root password ‘new-password’
echo “/usr/local/mysql/bin/mysqld_safe &”>>/etc/rc.local

2、安装JDK
wget http://download.Oracle.com/otn-pub/java/jdk/6u25-b06/jdk-6u25-linux-x64.bin
chmod +x jdk-6u25-linux-x64.bin
./jdk-6u25-linux-x64.bin
mv jdk1.6.0_25/ /usr/local/jdk

vim /etc/profile ADD
JAVA_HOME=”/usr/local/jdk”
CLASS_PATH=”$JAVA_HOME/lib:$JAVA_HOME/jre/lib”
PATH=”.:$PATH:$JAVA_HOME/bin”
export JAVA_HOME

source /etc/profile

3、安装openfire
如果你觉得RMP更适合你就去这里下载:http://www.igniterealtime.org/downloads/index.jsp
wget http://www.igniterealtime.org/downloads/download-landing.jsp?file=openfire/openfire_3_7_0.tar.gz
tar xzvf openfire_3_7_0.tar.gz -C /usr/local/

4、创建数据库、导入数据
/usr/local/mysql/bin/mysql -u root -p
CREATE DATABASE openfire default character set utf8 default collate utf8_general_ci;
USE openfire;
SOURCE /usr/local/openfire/resources/database/openfire_mysql.sql
退出mysql命令行

5、启动和安装openfire
/usr/local/openfire/bin/openfire start //启动openfire
打开有游览器访问http://ip-or-host:9090/ 自己配进入webui安装了很容易,更多的内容可以查看官方文档

注意:如果你填入的数据库url不是这种格式的时候,可能会出现乱码:jdbc:mysql://ip-or-host:3306/openfire?useUnicode=true&characterEncoding=utf8

相关推荐