Skip to content

Instantly share code, notes, and snippets.

@hightemp
Created July 17, 2013 08:20
Show Gist options
  • Save hightemp/6018763 to your computer and use it in GitHub Desktop.
Save hightemp/6018763 to your computer and use it in GitHub Desktop.
  1. Setup ejabber ================ ejabberd is a free and open source instant messaging server written in Erlang/OTP.

ejabberd is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication.

ejabberd is designed to be a rock-solid and feature rich XMPP server.

ejabberd is suitable for small deployments, whether they need to be scalable or not, as well as extremely big deployments.

See for more details about ejabber: https://git.process-one.net/ejabberd/mainline/blobs/raw/v2.1.11/doc/guide.html

  1. Download ejabber.

    wget http://www.process-one.net/downloads/ejabberd/2.1.11/ejabberd-2.1.11-linux-x86_64-installer.run.gz

    gzip -d ejabberd-2.1.11-linux-x86_64-installer.run.gz

    or

    gunzip ejabberd-2.1.11-linux-x86_64-installer.run.gz

  2. Install ejabber.

    chmod +x ejabberd-2.1.11-linux-x86_64-installer.run

    ./ejabberd-2.1.11-linux-x86_64-installer.run

    domain - beanstockjabber

  3. Check domain for test and development environment in config/config.yml file

  4. add {registration_timeout, infinity}. to conf/ejabberd.cfg

  5. Start ejabber and check status in bin folder.

    ./ejabberdctl start

    ./ejabberdctl status

  6. Log into admin ejabber http://localhost:5280/admin

    You may log in as [AdminUser]@[domain] followed by the password

Also see http://metajack.im/2010/02/04/screencast-setting-up-ejabberd/

  1. XMPP ======= The Extensible Messaging and Presence Protocol (XMPP) is an open technology for real-time communication, which powers a wide range of applications including instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data. Also see http://xmpp.org/about-xmpp/

  2. Setup orbited ================ Orbited provides a pure JavaScript/HTML socket in the browser. It is a web router and firewall that allows you to integrate web applications with arbitrary back-end systems.

  3. download from http://pypi.python.org/pypi/orbited/0.7.10

  4. Ensure that you have python 2.5 or higher installed in your system. Most linux and OS X systems come with Python pre-installed. You can check by $ python

  5. sudo apt-get install python-setuptools

  6. sudo apt-get install python-twisted

  7. sudo apt-get install python-dev

  8. sudo apt-get install build-essential

  9. sudo python setup.py install

  10. create orbited.cfg in /etc folder

     [global]
     # reactor=select
     # reactor=kqueue
     reactor=epoll
     proxy.enabled=1
     session.ping_interval = 40
     session.ping_timeout = 30
     # once the sockets are open, orbited will drop its privileges to this user.
     user=admin
    
     [listen]
     http://:8000
     # uncomment to enable SSL on port 8043 using given .key and .crt files
     #https://:8043
     #
     #[ssl]
     #key=orbited.key
     #crt=orbited.crt
     #chain=orbited.chain
    
     [static]
    
     [access]
     #localhost:8000 -> irc.freenode.net:6667
     10.0.0.119:8000 -> 10.0.0.119:5222
    

    change name of user to correct name

  11. Orbited will listen to all incoming requests at port 8000 and communicate with port 5222 with XMPP

  12. type orbited in console

  13. you should run your server in browser using your ip and port, instead of localhost:3000

  14. usefull links: http://www.webmasters.am/blog/installing-orbited-without-python-25/javascript/2009/10/ http://www.webmasters.am/blog/setting-up-orbited-server-irc-chat-example/javascript/2009/10/

Gentoo tips: emerge dev-python/twisted easy_install orbited==0.7.10

  1. Setup Xmpp4r gem =================== We should use Rails with the xmpp4r gem which is a wrapper over the standard XML that XMPP/Jabber/Ejabberd uses, thus allowing us to work with Ruby rather than generate XML. Gemfile gem 'xmpp4r' bundle install http://home.gna.org/xmpp4r/ http://www.rubyfleebie.com/im-integration-with-xmpp4r/ http://www.rubyfleebie.com/im-integration-with-xmpp4r-part-2/ http://www.rubyfleebie.com/im-integration-with-xmpp4r-2-mistakes-to-avoid/

  2. Useful materials =================== http://siddharth-ravichandran.com/2011/01/21/multiuser-chat-using-xmpp-and-orbited-using-ruby-on-rails/# http://devblog.famundo.com/articles/2006/10/14/ruby-and-xmpp-jabber-part-2-logging-in-and-sending-simple-messages https://github.com/supersid/FireDemon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment