使用开源协议软件搭建即时通讯服务器

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

[精华]使用开源协议软件搭建即时通讯服务器作者:liheng发表于:2009-05-0212:18:34【发表评论】【查看原文】【Linux讨论区】【关闭】作者:lihengEmail:liheng_2006athotmail.comJabber是著名的即时通讯服务服务器,它是一个自由开源软件,能让用户自己架即时通讯服务器,可以在Internet上应用,也可以在局域网中应用。XMPP(可扩展消息处理现场协议)是基于可扩展标记语言(XML)的协议,它用于即时消息(IM)以及在线现场探测。它在促进服务器之间的准即时操作。这个协议可能最终允许因特网用户向因特网上的其他任何人发送即时消息,即使其操作系统和浏览器不同。XMPP的技术来自于Jabber,其实它是Jabber的核心协定,所以XMPP有时被误称为Jabber协议。Jabber是一个基于XMPP协议的IM应用,除Jabber之外,XMPP还支持很多应用。关于Jabber的详细内容,大家可以上Jabber的官方网页:查看。Opernfire是一个在开源GPL和商业双许可的即时通讯服务器。Openfire的即时通讯服务采用了广泛采用的开放协议---XMPP。Openfire非常容易安装与管理,同时Openfire也提供了非常高的安全性与性能。Openfire支持WINDOWS、LINUX、MAC平台。目前最新的版本是:Openfire-3.5.2。在本例中我使用的是Linux版本。关于Openfire的详细内容,大家可以上Openfire的官方网页:。Spark是一款开源的、多平台的即时通讯客户端。它提供了嵌入式聊天室、集成电话、高安全性支持。还为用户提供了非常好的体验功能,如在线拼写校验,聊天室标签、交谈记录等。Spark支持Windows、Linux、MAC平台,目前最新的版本是:Spark-2.5.8。关于Spark的详细内容,大家可以上Spark的官方网页:。安装下面我就来向大家介绍一下如何配置Openfire来构建企业内的即时通讯服务器。首先我还是向大家介绍一下我的环境:Openfire服务器OS:RedHatEnterpristLinux5.0Openfire版本:OpenfireMYSQL版本:mysql-5.1.52aSpark版本:Spark-2.5.8Apache版本:http-2.2.6Java版本:jre1.6由于Openfire是使用Java开发的,需要Java环境支持,请确保你的系统中已经安装了JRE。建议使用最新的JRE版本:jre1.6。可以到java的官方站点:上下载。配置JAVA环境[root@test~]#cpjre-6u6-linux-i586.bin/usr/local[root@test~]#cd/usr/local[root@testlocal]#ls–l|grepjre-rwxr--r--1rootroot197507406月2811:14jre-6u6-linux-i586.bin[root@testlocal]#./jre-6u6-linux-i586.bin此时将显示二进制许可协议。通读许可协议。按空格键显示下一页。读完许可协议后,输入yes继续安装。JRE安装在其自身的目录中。在本例中,它将安装在/usr/local/jre1.6.0_6目录中。当安装完成时,您将看到Done(完成)字样。[root@testlocal]#ln–s/usr/local/jre1.6.0_6/plugins/i386/ns7/libjavaplugin_oji.so/usr/lib/firefox-1.0.4/plugins/安装mysql。在本例中我要使用mysql来作为Openfire服务器使用的数据库,但这并不是必须的,因为Openfire本身内置有数据库,你可以选择使用Openfire内置的数据库,也可以使用外置数据数据库。[root@testlocal]#tarxzvf/root/mysql-5.0.51a-linux-i686.tar.gz[root@testlocal]#ln–smysql-5.0.51a-linux-i686mysql[root@testlocal]#cdmysql[root@testmysql]#mv/etc/my.cnf/etc/my.cnf.bak[root@testmysql]#cpsupport-files/my-medium.cnf/etc/my.cnf[root@testmysql]#chown–Rmysql.[root@testmysql]#chgrp–Rmysql.[root@testmysql]#./scripts/mysql_install_db--user=mysql&[root@testmysql]#chown–Rroot.[root@testmysql]#chown–Rmysqldata[root@testmysql]#./bin/mysqld_safe--user=mysql&[root@testmysql]#netstat–tlunp|grep3306[root@testmysql]#cpsupport-files/mysql.server/etc/rc.d/init.d/mysqld[root@testmysql]#chmod755/etc/init.d/mysqld[root@testmysql]#chkconfig—addmysqld[root@testmysql]#chkconfig—level35mysqldon[root@testmysql]#mkdir/usr/local/mysql/lib/mysql[root@testmysql]#mkdir/usr/local/mysql/include/mysql[root@testmysql]#chownroot.mysql/usr/local/mysql/lib/mysql[root@testmysql]#chwonroot.mysql/usr/local/mysql/include/mysql[root@testmysql]#ln–s/usr/local/mysql/lib/*/usr/local/mysql/lib/mysql[root@testmysql]##ln–s/usr/local/mysql/include/*/usr/local/mysql/include/mysql[root@testmysql]#echo“/usr/local/mysql/lib/mysql”/etc/ld.so.conf[root@testmysql]#ldconfig安装apache[root@testmysql]#cd..[root@testlocal]#tarxzvf/root/httpd-2.2.6.tar.gz[root@testmysql]#cdhttpd-2.2.6[root@testhttpd-2.2.6]#./configure–prefix=/usr/local/apache--enable-so--enable-rewrite[root@testhttpd-2.2.6]#make[root@testhttpd-2.2.6]#makeinstall[root@testhttpd-2.2.6]#echo“/usr/local/apache/bin/apachectlstart”/etc/rc.local安装php-5.2.3[root@testhttpd-2.2.6]#cd..[root@testlocal]#tar-zvxf/root/php-5.2.6.tar.gz[root@testlocal]#mkdir-p/usr/local/php[root@testlocal]#cdphp-5.2.6[root@testphp-5.2.6]#./configure—prefix=/usr/local/php—with-apxs2=/usr/local/apache/bin/apxs—with-mysql=/usr/local/mysql—with-mysqli=/usr/local/mysql/bin/mysql_config—with-xml—with-png—with-jpeg—with-zlib—with-freetype—with-gd—enable-track-vars—enable-mbstring=all[root@testphp-5.2.6]#make[root@testphp-5.2.6]#makeinstall[root@testphp-5.2.6]#cpphp.ini-dist/usr/local/php/lib/php.ini注:编辑apache配置文件httpd.conf,以apache支持php[root@testphp-5.2.6]#vi/usr/local/apache/conf/httpd.conf#添加如下二行AddTypeapplication/x-httpd-php.phpAddTypeapplication/x-httpd-php-source.phps#定位至DirectoryIndexindex.html修改为:DirectoryIndexindex.phpindex.html#这里将网站根目录指定到/var/:找到DocumentRoot“/usr/local/apache/htdocs”修改为:DocumentRoot“/var/”找到Directory“/usr/local/apache/htdocs”修改为:Directory“/var/”在mysql中建立数据库openfire[root@testphp-5.2.6]#/usr/local/mysql/bin/mysqlmysqlCREATEDATABASEopenfire;mysqlexit;将Openfire的数据库资料导入mysql[root@testphp-5.2.6]#cat/usr/local/openfire/resource/database/openfire_mysql.sql|/usr/local/mysql/bin/mysqlopenfire出于安全考虑,为mysql用户root设置密码[root@testphp-5.2.6]#/usr/local/mysql/bin/mysqladmin–urootpassword123456[root@testphp-5.2.6]#/usr/local/openfire/bin/openfirestart查看openfire控制台端口9090&9091是否已经打开[root@testphp-5.2.6]#netstat–tlunpliheng回复于:2008-07-0617:54:44打开Firefox浏览器,在地址栏里输入:进入openfireTool页面,开始安装设置openfire,在你开始设置之前,首先选择适合于你的语言,这里我们当然选择“中文(简体)SimlifiedChinese(zh_CN)”。liheng回复于:2008-07-2113:31:05点击“continue”,开始一步设置---服务器设置,这里保持默认即可liheng回复于:2008-07-2113:32:00点击“继续”,开始下一步设置----数据库设置,如果你使用一个外部数据库的话,就选择“标准数据库连接”,若使用openfire自带的数据库的话,就选择“嵌入的数

1 / 17
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功