Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

第 38 章 jabber XMPP

目錄

38.1. ejabberd - Distributed, fault-tolerant Jabber/XMPP server written in Erlang
38.1.1. ejabberdctl
38.2. tigase
38.3. Openfire
38.4. DJabberd
38.5. freetalk - A console based Jabber client
38.6. library
38.6.1. python-xmpp

jabber homepage XMPP

38.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
    				
    				

38.1.1. ejabberdctl

set-password

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