Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | About

第 39 章 jabber XMPP

目录

39.1. ejabberd - Distributed, fault-tolerant Jabber/XMPP server written in Erlang
39.1.1. ejabberdctl
39.2. tigase
39.3. Openfire
39.4. DJabberd
39.5. freetalk - A console based Jabber client
39.6. library
39.6.1. python-xmpp

jabber homepage XMPP

39.1. ejabberd - Distributed, fault-tolerant Jabber/XMPP server written in Erlang

http://www.ejabberd.im/

  1. install

    				
    $ sudo apt-get install ejabberd
    				
    				
  2. configure.

    				
    $ sudo cp /etc/ejabberd/ejabberd.cfg /etc/ejabberd/ejabberd.cfg.old
    $ sudo ls /etc/ejabberd/
    ejabberd.cfg  ejabberd.cfg.old  ejabberd.pem  inetrc
    				
    $ sudo vim /etc/ejabberd/ejabberd.cfg		
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %% Options which are set by Debconf and managed by ucf
    
    %% Admin user
    {acl, admin, {user, "neo", "netkiller.8800.org"}}.
    
    %% Hostname
    {hosts, ["netkiller.8800.org"]}.
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    		
    				
    				
  3. create a admin

    # ejabberdctl register <username> <server> <password> # ejabberdctl unregister <username> <server>
    				
    $ sudo ejabberdctl register neo netkiller.8800.org your_password		
    				
    				

    admin page: http://localhost:5280/admin/

  4. firewall

    				
    $ sudo ufw allow xmpp-server
    Rule added
    
    $ sudo ufw allow xmpp-client
    Rule added
    				
    				
  5. test

    				
    $ sudo apt-get install sendxmpp
    				
    				

    Create config file ~/.sendxmpprc

    				
    $ vim ~/.sendxmpprc
    
    #account@host:port password
    neo@netkiller.8800.org chen
    
    $ sudo chmod 600 .sendxmpprc	
    				
    				

    send messages

    				
    $ echo -n hi | sendxmpp -r echocmd neo@netkiller.8800.org
    				
    				

39.1.1. ejabberdctl

set-password

			
$ sudo ejabberdctl set-password eva netkiller.8800.org eva