openfire 是个好东西。在团队规模有限的状况下用这个是很是的的。固然也能够用node.js 开发聊天。html
linux 下面有几个要注意的地方。java
由于我选择的CentOS 6是64位的了,然而Openfire倒是32位的,所以必需要安装32位的C++运行时。若是服务器可以访问外网,那么执行
node
openfire 是java 开发的因此须要安装java 注意你的版本。
linux
接下来按照顺序安装
c++
http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/index.html 这个是原版地址
shell
# yum install libstdc++.i686
安装好的CentOS会自带OpenJdk,用命令 java -version ,会有下面的信息:apache
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.curl
先查看 rpm -qa | grep javaui
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版本;
这里看下载 wget http://download.igniterealtime.org/openfire/openfire-3.6.4-1.i386.rpm
# 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
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>
到此能够用外网域名打开了。