码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS 6部署Openfire 扩展平台聊天功能。

时间:2015-11-02 07:01:24      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:

openfire 是个好东西。在团队规模有限的情况下用这个是非常的的。当然也可以用node.js 开发聊天。

linux 下面有几个要注意的地方。

  1.  因为我选择的CentOS 6是64位的了,然而Openfire却是32位的,因此必须要安装32位的C++运行时。如果服务器能够访问外网,那么执行

  2. openfire 是java 开发的所以需要安装java 注意你的版本。

  3. 接下来按照顺序安装

  4. http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/index.html 这个是原版地址

Openfire 版本兼容

# yum install libstdc++.i686

java 安装

安装好的CentOS会自带OpenJdk,用命令 java -version ,会有下面的信息:

java version "1.6.0"
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)

最好还是先卸载掉openjdk,在安装sun公司的jdk.

先查看 rpm -qa | grep java

http://jingyan.baidu.com/article/4853e1e51d0c101909f72607.html 或是看这个。

查看yum库中的Java安装包。

◆输入:yum -y list java* 。

使用yum安装Java环境。

◆输入:yum -y install java-1.7.0-openjdk* ,以yum库中java-1.7.0为例。 

  当结果显示为Complete!即安装完毕。

查看刚安装的Java版本信息。

◆输入:java -version 可查看Java版本;


Openfire 下载安装

  这里看下载 
wget http://download.igniterealtime.org/openfire/openfire-3.6.4-1.i386.rpm

Openfire 程序安装启动

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

上传Openfire的安装程序。推荐使用openfire-3.9.3-1.i386.rpm这个安装包,里面已经自带对应的JRE,无需额外配置。执行:

Preparing… ########################################### [100%]
1:openfire ########################################### [100%]
3.开启服务
service openfire start

Openfire 启动  Openfire in Linux/Unix

If you are running on a Red Hat or Red Hat like system (CentOS, Fedora, etc), we recommend using the RPM as it contains some custom handling of the standard Red Hat like environment.  Assuming that you have used the RPM, you can start and stop Openfire using the /etc/init.d/openfire script.

# /etc/init.d/openfire
Usage /etc/init.d/openfire {start|stop|restart|status|condrestart|reload}
# /etc/init.d/openfire start
Starting openfire:

成功了会显示成这样的。

Starting openfire:

If you are running on a different Linux/Unix varient, and/or you have used the .tar.gz ‘installer‘, you can start and stop Openfire using the bin/openfire script in your Openfire installation:# ./openfire
Usage: ./openfire {start|stop}
# ./openfire start

很多人可能看到这里就认为完了,但是到我这里还没完。请继续看

端口映射外网访问

服务器是远程 有固定ip 而这个openfire 默认安装完了是http://127.0.0.1:9090 可以用curl  检测或是端口检测。这个本机可以外网那个没法打开。

所以需要在外网映射一下就可以了。

apache中设置代理:
NameVirtualHost xxx.xxxx.xxx:80
<VirtualHost *:80 >
ServerAdmin abc@123.com
ServerName openfire.baidu.com
ErrorLog logs/rsa-error.log
CustomLog logs/rsa-access.log common
ProxyPass / http://127.0.0.1:9090/
ProxyPassReverse / http://127.0.0.1:9090/
</VirtualHost>

到此可以用外网域名打开了。

CentOS 6部署Openfire 扩展平台聊天功能。

标签:

原文地址:http://my.oschina.net/Alexmyj/blog/524708

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!