1.在http://www.igniterealtime.org/downloads/index.jsp#openfire下下载openfire java
# rpm -ivh openfire-3.9.1-1.i386.rpm mysql
Preparing... ########################################### [100%]
1:openfire ########################################### [100%] linux
默认安装在 /opt/openfire web
注:openfire安装完后到目录文件都在 /opt/openfire 目录下,其中用到的SQL脚本在/opt/openfire/resources/database下面,这里我用的是Oracle数据库,用 https://127.0.0.1:1158/em登陆到控制台新建了表空间和用户,接着用PL/SQL Developer 导入openfire_oracle.sql,完了成了openfire所须要的表建立。 sql
特别注意:这里须要将ojdbc6.jar文件拷贝到/opt/openfire/lib目录下,才能启动服务器,不然链接Oracle数据库会报错。个人环境是jdk1.7,Oracle11g shell
ojdbc6.jar下载地址:http://pan.baidu.com/share/link?shareid=398379&uk=638583574 数据库
可使用下面的命令启动服务:
# /opt/openfire/bin/openfire.sh centos
运行后出现如下错误:/opt/openfire/jre/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 浏览器
The following problem is solved, set the desired library libldb.i686 type command: 服务器
yum install libldb.i686.
从新启动,正常
注意:这里若是你是远程经过SSH操做,可能遇到一个问题,就是当你离开界面后服务就关闭了。若是你看过Linux的入门书可能就会了解其中的关于shell的概念。但是因为不少人像我同样只知其一;不知其二,因此出现这种问题。解决的办法是要将openfire.sh提交到后台去运行,命令以下
#setsid /opt/openfire/bin/openfire.sh &
设置成功!
或者用保存在/etc/init.d/下的openfire脚本启动服务,命令是/etc/init.d/openfire start
设置为开机自启动
# chkconfig openfire on
# chkconfig --list openfire
openfire 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
设置成功!
2.在浏览器下输入:http://localhost:9090对openfire进行设置
(1)语言选择:中文简体
(2)服务期设置:选择域及端口,建议默认
(3)数据库设置:根据须要,这里选“标准数据库”
(4)标准数据库设置:选择MySQL,数据库URL填入你的数据库地址端口和数据库名称(请自行建立)用户名密码填入你的mysql的账号密码,其余根据须要选择填写。继续以后会在你的mysql中建立表并初始化。
(5)特性设置:若是你不打算用LDAP,保留默认
(6)管理员账户设置:填入系统管理员信息
(7)安装完成
3.mySQL设置
一.修改/etc/my.cnf文件
default-character-set=utf8
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set=utf8 增长
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql] 增长
default-character-set=utf8 增长
二.启动Mysql并设置隋系统启动
chkconfig mysqld on
chkconfig --list mysqld(查看系统服务)
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
2-5为on,OK。
/etc/rc.d/init.d/mysqld start
三.设置密码
/usr/bin/mysqladmin -u root password '123456'
四.登录服务器
#mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 7
Server version: 5.0.77 Source distmysql> ribution
mysql>
五.为openfire建立一个数据库
create database openfire;(必需要有“;”,否则会一直->下去)
测试下数据库,