1.在http://www.igniterealtime.org/downloads/index.jsp#openfire下下载openfire
# rpm -ivh openfire-3.5.1-1.i386.rpm
默认安装在 /opt/openfire
# vi /etc/sysconfig/iptables
追加下面2行
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9090 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9091 -j ACCEPT
:wq保存退出后执行
# service iptables restart
可以使用下面的命令启动服务:
# /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;(必须要有“;”,不然会一直->下去)
测试下数据库,