Saturday, September 24, 2016

configure Jabber/XMPP server, ejabberd version 16.08-1

*** setup information ***
domain: test.qq
so configure dns server that have it point the domain to correct ip of your server

1- install  ejabberd on ubuntu 16.10 yakkety
$ sudo apt-get install ejabberd

2- configure ejabberd by edit its configuration file /etc/ejabberd/ejabberd.yml  as below (highlight with yellow color is the line that is modified)
loglevel: 4
log_rotate_size: 0
log_rotate_date: ""
log_rate_limit: 100
hosts:
  - "test.qq"
listen:
  -
    port: 5222
    ip: "::"
    module: ejabberd_c2s
    certfile: "/etc/ejabberd/ejabberd.pem"
    starttls: true
    protocol_options:
      - "no_sslv3"
    max_stanza_size: 65536
    shaper: c2s_shaper
    access: c2s
    zlib: true
    resend_on_timeout: if_offline
  -
    port: 5269
    ip: "::"
    module: ejabberd_s2s_in
  -
    port: 5280
    ip: "127.0.0.1"
    module: ejabberd_http
    request_handlers:
      "/websocket": ejabberd_http_ws
    web_admin: true
    http_bind: true
    captcha: true
    tls: true
    certfile: "/etc/ejabberd/ejabberd.pem"
disable_sasl_mechanisms: "digest-md5"
s2s_use_starttls: optional
s2s_certfile: "/etc/ejabberd/ejabberd.pem"
s2s_protocol_options:
  - "no_sslv3"
auth_method: internal
auth_password_format: scram
shaper:
  normal: 1000
  fast: 50000
max_fsm_queue: 1000
acl:
  admin:
     user:
       - "admin@test.qq"
  local:
    user_regexp: ""
  loopback:
    ip:
      - "127.0.0.0/8"
shaper_rules:
  max_user_sessions: 10
  max_user_offline_messages:
    - 5000: admin
    - 100
  c2s_shaper:
    - none: admin
    - normal
  s2s_shaper: fast
access_rules:
  local:
    - allow: local
  c2s:
    - deny: blocked
    - allow
  announce:
    - allow: admin
  configure:
    - allow: admin
  muc_create:
    - allow: local
  pubsub_createnode:
    - allow: local
  register:
    - allow
  trusted_network:
    - allow: loopback
 
language: "en"
modules:
  mod_adhoc: {}
  mod_admin_extra: {}
  mod_announce: # recommends mod_adhoc
    access: announce
  mod_blocking: {} # requires mod_privacy
  mod_caps: {}
  mod_carboncopy: {}
  mod_client_state: {}
  mod_configure: {} # requires mod_adhoc
  mod_disco: {}
  mod_echo: {}
  mod_irc: {}
  mod_http_bind: {}
  mod_last: {}
  mod_muc:
    access:
      - allow
    access_admin:
      - allow: admin
    access_create: muc_create
    access_persistent: muc_create
  mod_muc_admin: {}
  mod_offline:
    access_max_user_messages: max_user_offline_messages
  mod_ping: {}
  mod_privacy: {}
  mod_private: {}
  mod_pubsub:
    access_createnode: pubsub_createnode
    ignore_pep_from_offline: true
    last_item_cache: false
    plugins:
      - "flat"
      - "hometree"
      - "pep" # pep requires mod_caps
  mod_roster: {}
  mod_shared_roster: {}
  mod_stats: {}
  mod_time: {}
  mod_vcard:
    search: false
  mod_version: {}
allow_contrib_modules: true






3- register administrator user to control ejabberd that able to access web interface and manage the server. The administrator user will be created with username:admin@test.qq and password:admin
$ sudo  ejabberdctl register admin test.qq admin

4- we configure  the web gui listening on the localhost ip address so the url to access is https://localhost:5280/admin
and the username/password to access is admin@test.qq/admin

- snapshot of the web interface on tab manage users

- snapshot of user1 and user2 chatting




No comments:

Post a Comment