centos安装openfire

1.在http://www.igniterealtime.org/downloads/index.jsp#openfire下下载openfire

# rpm -ivh openfire-3.9.1-1.i386.rpm

Preparing...                ########################################### [100%]
   1:openfire               ########################################### [100%]

默认安装在 /opt/openfire

注:openfire安装完后到目录文件都在 /opt/openfire 目录下,其中用到的SQL脚本在/opt/openfire/resources/database下面,这里我用的是Oracle数据库,用https://127.0.0.1:1158/em登录到控制台新建了表空间和用户,接着用PL/SQL Developer  导入openfire_oracle.sql,完了成了openfire所需要的表创建。

特别注意:这里需要将ojdbc6.jar文件拷贝到/opt/openfire/lib目录下,才能启动服务器,否则连接Oracle数据库会报错。我的环境是jdk1.7,Oracle11g

ojdbc6.jar下载地址:http://pan.baidu.com/share/link?shareid=398379&uk=638583574


# 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

运行后出现以下错误:/opt/openfire/jre/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

解决方案:http://www.webhostingskills.com/articles/solving_the_problem_installing_openfire_on_centos_64_bit
There is a slight problem with installing Openfire on the latest CentOS 6 64-bit. The server is placed perfectly, runs. Check the status of the server after installation: /etc/init.d/openfire status and see openfire is not running.
Go to the folder with log: /opt/openfire/logs/nohup.out and watch the result of start-up and no error java in the folder /opt/openfire/jre/bin. The file is there, but the problem is that required for Openfire version of the library for 32-bit.

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;(必须要有“;”,不然会一直->下去)

测试下数据库,

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值