LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3408|回复: 4

Ejabberd配置,搭建内网IM平台

[复制链接]
发表于 2006-11-23 15:53:31 | 显示全部楼层 |阅读模式
服务器端Ejabberd,客户端Psi

先下载安装文件,http://ejabberd.jabber.ru/download,这是下载的页面。

Packages
•        Linux:
o        Installer (Suitable for any x86 distribution, includes all required libraries)
o        ALT Linux
o        CRUX
o        Debian (Sarge backport)
o        Fedora Extras 5
o        Gentoo (Gentoo ejabberd HOWTO)
o        Mandriva
o        NexentaOS
o        PLD Linux
o        Ubuntu
•        *BSD:
o        FreeBSD port
o        Mac OS X Fink package
o        Mac OS X installer (No universal binary yet, includes all required libraries)
•        Windows NT/2000/XP:
o        Installer (Includes all required libraries)
•        Multiplatform:
o        Erlang REPOS is an ISO image with ejabberd and other Erlang-based applications on it. You can create a CDROM or USB Stick that runs out-of-the-box under Linux, Windows and Mac OS X.
以上是支持的类型,我的发行版本是CentOS 4,我选择的是通用的安装包Installer。

Wget http://process-one.net/en/projec ... linux-installer.bin

下载之后chmod +x ejabberd-1.1.2-linux-install.bin

然后./ejabberd-1.1.2-linux-install.bin
之后就照提示做就可以了,一个是默认管理员的用户名和密码,这个设好后要记住,一个是域名,这里我还不知道是否与DNS相关,这里我写入的是我们内网的域名,假设为example.org,真的就不说了。还有一个是安装路径,根据自己需要填写吧。之后有一个协议,真的很长,不断的回车之后,终于看到y/n的选择,y回车,服务器端就差不多了。好像也不用改什么设置,就已经可以使用了,默认的工作端口是TCP5222,如果有防火墙,请打开相应端口,例如iptables –A INPUT –s 内网网段 –p tcp 5222 –j ACCEPT

从官方文档上看,需要以下端口:

Port         Description
5222         SASL and unencrypted c2s connections.
5223         Obsolete SSL c2s connections.
5269         s2s connections.
4369         Only for clustering (see 10).
port range         Only for clustring (see 10). This range is configurable (see 2.4).

参照上面的防火墙一并打开,如果没有配集群,只开放前三个就可以了。

然后就是客户端的选择了,我选用了Psi,其实有许多客户端都可以使用。Psi安装介面到是有简体中文,使用的时候没有,有点遗憾。Psi的主页为http://psi-im.org/home,相关的图片可以去官方上去看。从http://psi-im.org/download下载客户端,这里有支持多版本的客户端,这里选择Windows的客户端,Linxu发行版,Mac的也有相应版本,在同一页上,有语言包,并且有简体中文,不过改成简体中文就要手工完成了,很简单,把那个文件拷到安装目录下就可以了。

之后就是安装客户端,在Windows应该都没什么问题吧?注册用户的时候需要注意,用户名后必需要把配置服务器时的域名加上,如要注册tom的用户,服务器配置时的域名为example.org,注册时应该写成tom@example.org,下面的注册服务器要手工指定一下,指定为你安装服务器端的IP地址,端口就不用改了,注册的时候非常快,之后就可以使用了。加人就像其它IM软件一样简单,也需要对方认证的。并且支持内网传文件,速度非常快。

不过也有一个小问题,就是不知道目录该怎么做,总不能让用户一个一个的去加人吧,如果一个公司有1000人,要加全员工也够累的。看文档应该是支持LDAP的,看来我要去学学LDAP的配置了,先写这么多吧,有兴趣的朋友一起研究吧。

注:服务端很可能需要一个数据库,这是我在配置文件中看到的,因为我已经配置过MySQL,所以无法确认数据库是不是必须的。
发表于 2006-12-7 19:39:15 | 显示全部楼层
Ejabberd目前是可扩展性最好的一种Jabber/XMPP服务器,支持分布多个服务器,并且具有容错处理,单台服务器失效不影响整个cluster运作。
它采用Erlang语言开发,Erlang的主要应用领域高并发(C80K而不是什么C10K问题)、高可靠性(容错和集群,99.9999999可用率之类的),真正的分布式应用(不是搞功能集中于一个系统的集群,或者通过效率低下的webservice在子系统之间协作)等等

我最近也在学习这个,因为找不到相关的资料,还是不知道怎么设置。相对来说Wildfire就简单多了,可以共享群组,设置完了所有人就能看到。
Ejabberd内置数据库Mnesia,也可以使用其他数据库。我曾经尝试过Postgresql但是没有成功。希望有经验的朋友指点一下。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-8 13:19:34 | 显示全部楼层
有时间了解一下Wildfire。
回复 支持 反对

使用道具 举报

发表于 2006-12-10 18:31:28 | 显示全部楼层
看看你要的是不是这个:
http://ejabberd.jabber.ru/shared-roster-all
All Users in a Shared Roster Group
Submitted by badlop on Tue, 2005-10-11 16:53.

The ability to add all registered users to everyone's roster is one of the most requested features for ejabberd. Especially small enterprises are itching to see everybody in everyone's roster. This feature is available since ejabberd 1.0.0.
Wishes for this Feature

The feature to see all users in everybody's roster has been discussed on:

    * Ejabberd in a local network
    * Automatic Roster
    * "See all online"
    * How shared roster?
    * Wildcards in shared roster

Previous Solutions

Some partial and experimental solutions have been contributed since a while:

    * Pushroster patch for ejabberd_ctl
    * ACLpopulateSR patch for mod_shared_roster

New Solution

As of version 1.0.0, ejabberd allows the administrator to add all users on a virtual host to a shared roster group. When he creates a shared roster group on a virtual host, and specifies the members, he can put @all@, and ejabberd will add all users on the current virtual host.

This feature requires internal authentication. If you use external authentication, LDAP... then adding @all@ to a shared roster group will do nothing.
Example 1: everybody can see everybody else

   1. Login on the web interface and go to 'Virtual Hosts' -> 'server' -> 'Shared Roster'
   2. Create a new Shared Roster, with identifier 'everybody'. Click on 'Add new'.
   3. Fill the formulary with this:
          * Name: EveryBody
          * Description: This group contains everybody
          * Members: @all@
          * Displayed Groups: everybody
   4. Click on Submit.
   5. When any user logins, he will have a new group in his roster, called EveryBody, and containing all the other users registered on the server.

Example 2: some people (boy and boby) have everybody else on their roster
Important: note that boy and boby will not see presence from the other people. They will be on the roster, but always offline.

   1. Login on the web interface and go to 'Virtual Hosts' -> 'server' -> 'Shared Roster'
   2. Create a new Shared Roster, with identifier 'everybody'. Click on 'Add new'.
   3. Fill the formulary with this:
          * Name: Everybody
          * Description: This group contains everybody
          * Members: @all@
          * Displayed Groups:
   4. Click on Submit.
   5. Create a new Shared Roster, with identifier 'badboys'. Click on 'Add new'.
   6. Fill the formulary with this:
          * Name: Badboys
          * Description: Those ppl can see everybody else
          * Members: boy@server boby@server
          * Displayed Groups: everybody
   7. Click on Submit.
   8. When boy or boby login, he will have as contacts everybody else registered on the server, but they will not have him on their rosters.

Example 3: everybody has 'weatherman' and 'governor' on their roster
Important: note that people will see weatherman and governor offline, even if they are logged.

   1. Login on the web interface and go to 'Virtual Hosts' -> 'server' -> 'Shared Roster'
   2. Create a new Shared Roster, with identifier 'publicppl'. Click on 'Add new'.
   3. Fill the formulary with this:
          * Name: Public_people
          * Description: This group contains public people
          * Members: weatherman@server governor@server
          * Displayed Groups:
   4. Click on Submit.
   5. Create a new Shared Roster, with identifier 'spectators'. Click on 'Add new'.
   6. Fill the formulary with this:
          * Name: Spectators
          * Description: The spectators can see public people
          * Members: @all@
          * Displayed Groups: publicppl
   7. Click on Submit.
   8. When any user logins, he will have the public person on his roster.

More About Shared Roster Groups

    * Release notes - ejabberd 0.9 (2005-04-18)
    * mod_shared_roster in the guide
    * Shared Roster Groups Screenshots

Related Links

    * Problem with shared roster and presence
回复 支持 反对

使用道具 举报

发表于 2006-12-10 20:27:08 | 显示全部楼层
今天又看了N遍ejabberd的配置文档,还是没办法使用PostgresQL。
同一个PostgresQL服务器,Wildfire很容易就搞掂了。
真是郁闷……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表