EJABBERD INSTALL AND CONFIGURE

Hello,

Today I am going to Install Ejabberd. Before I am going to Teach you about Ejabberd, I want to tell you about what is Ejabberd and what is use of ejabberd. So Lets start.

Ejabberd is Open-Source XMPP server. Ejabberd provide the chat service between users and groups. Ejabberd is product of cisco. I am going to use this product to implement chat functionality in our Web site.  How we use this product ? Just  follow these points

Install Ejabberd

sudo apt-get install ejabberd

After this you need some requirements to start ejabberd

  1. GNU Make.
  2.   GCC (sudo apt-get install build-essential).
  3.  Libexpat 1.95 or higher (sudo apt-get install libexpat-dev).
  4.  Libyaml 0.1.4 or higher (sudo apt-get install libyaml-dev).
  5.  Erlang/OTP 17.1 or higher .
  6.  OpenSSL 1.0.0 or higher, for STARTTLS, SASL and SSL encryption (sudo apt-get install openssl).
  7.  Zlib 1.2.3 or higher, for Stream Compression support (XEP-0138). Optional.
  8. PAM library. Optional. For Pluggable Authentication Modules (PAM).
  9. GNU Iconv 1.8 or higher, for the IRC Transport (mod_irc). Optional. Not
    needed on systems with GNU Libc.
  10. ImageMagick’s Convert program. Optional. For CAPTCHA challenges.

Now open your ejabberd.cfg configuration file to do some configuration .

/etc/ejabberd/ejabberd.cfg

now Add admin in configure file, Replace these lines with this

{acl, admin, {user, “”, “localhost”}}.

to

{acl, admin, {user, “some username”, “localhost”}}.

Add host name in config file

{hosts, [“localhost”]}.

to (If needed)

{hosts, [“localhost”,”abc.net”]}.

Now last thing you need to do

add “mod_http_bind

in config file under module section

“mod_http_bind” is used for enable bosh. bosh part of xmpp server in jebberd which allows to user to communicate each others through text messages.

{mod_adhoc,    []},
  {mod_announce, [{access, announce}]}, % requires mod_adhoc
  {mod_caps,     []},
  {mod_configure,[]}, % requires mod_adhoc
  {mod_admin_extra, []},
  {mod_disco,    []},
  %%{mod_echo,   [{host, “echo.localhost”}]},
  {mod_irc,      []},

to

{mod_adhoc,    []},
  {mod_announce, [{access, announce}]}, % requires mod_adhoc
  {mod_caps,     []},
  {mod_configure,[]}, % requires mod_adhoc
  {mod_admin_extra, []},
  {mod_disco,    []},
  %%{mod_echo,   [{host, “echo.localhost”}]},
  {mod_irc,      []},

 {mod_http_bind,      []}

In last, you need to start your ejabberd server with this command

sudo ejabberd start

After this open your browser and type this address in address bar

http://localhost:5280/admin

After this you found popup, popup ask for username and password form you for  login so just put your username and password to login in ejabberd.

How to register Admin in ejabberd for Login ?

Run you ejabberd and open another terminal window, type this command in terminal to register your  Username for admin

sudo ejabberdctl register username hostname password

Must use username same as you used in config file of ejabberd (like:- i use “admin”)

Now you able to login as admin in ejabberd.

How to add user in ejabberd ?

open your ejabberd config file and find this line.

%% All users are allowed to use MUC service:
{access, muc, [{deny, all}]}.

to

%% All users are allowed to use MUC service:
{access, muc, [{allow, all}]}.

Now go in admin panal and click on virtualhost tab virtualhost tab you found user tab click on user tab and add new user in ejabberd.

Finally your all user added in ejabberd and now you can able develop user app for Chat using ejabberd (XMPP Server)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s