Home arrow Guides arrow Build your own instant messenger server with ejabberd
Build your own instant messenger server with ejabberd PDF
Sunday, 29 April 2012
This quick tutorial helps you to configure your own instant messenger server on FreeBSD with ejabberd as server and pidgin as client.

First we will install ejabberd on our server using FreeBSD's Ports:

  cd /usr/ports/net-im/ejabberd
  make install clean


Then we copy default config example from ejabberd to /usr/local/etc/ejabberd.cfg file:

  cp /usr/local/etc/ejabberd.cfg.example /usr/local/etc/ejabberd.cfg

Then we edit /usr/local/etc/ejabberd.cfg file and add the following line (search for acl, admin):

  {acl, admin, {user, "john", "10.0.0.7"}}.

or

  {acl, admin, {user, "john", "chat.mydomain.com"}}.

Then we could disable our jabber server to talk to outside servers by editing /usr/local/etc/ejabberd.cfg and changing s2s_default_policy to deny:

  {s2s_default_policy, deny}

Now is time to register our admin user from command line by running:

  ejabberdctl register john 10.0.0.7 johns_password

or:

    ejabberdctl register john chat.mydomain.com johns_password

Then you can login to admin account using your browser by accessing:

  http://10.0.0.7:5280/admin

Now let's add ejabberd service in /etc/rc.conf:

  ejabberd_enable="YES"

Last step is to start ejabberd service from command line:

  /usr/local/etc/rc.d/ejabberd start

If you tried to stop the service using same script and is not working use your old ps | grep, kill commands.

If you want to add more users just use command line tool ejabberdctl:

  ejabberdctl register jimmy 10.0.0.7 jimmy_password
  ejabberdctl register jimmy chat.mydomain.com jimmy_password

You could either use domain name or IP for host name of the server. For internal ejabberd servers some prefer using IP but you could always map your IP to a domain, even if is not visible on the internet.

Last Updated ( Wednesday, 02 May 2012 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?