Find file
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (53 sloc) 3.02 KB
The package always makes a backup of the ejabberd database if it's running
when it is upgraded or removed. The backup files are stored in
/var/backups/ejabberd-<timestamp>.* directory.
The package installs ejabberd Erlang headers into /usr/lib/ejabberd/include
directory. To build a module using these headers, as usual include them using
and compile the module using -pa option to add ejabberd path to a search list
erlc -pa /usr/lib/ejabberd/ebin module.erl
Alternatively, include headers as
and add option -I /usr/lib/ejabberd/include to erlc command line.
The ejabberd daemon which is run in init.d script is owned by user ejabberd,
so it cannot bind to privileged ports (below 1024). The error message in
/var/log/ejabberd/ejabberd.log looks similar to the following:
Failed to open socket for {443,
c2s_shaper}]}: eacces
If you want ejabberd to listen for example port 443 you could redirect it to
port 5222 (the default XMPP port) by a firewall rule. For example:
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 5222
The ejabberd daemon uses Erlang database Mnesia. Even if it's configured for
using ODBC it uses Mnesia for some data (privacy lists et.) and runtime tasks
(keeping routing table etc.). Mnesia is a multi-master database, and it tightly
bounds to a hostname where it's working. Therefore, if you change computer
hostname then ejabberd will stop working.
If you don't have a current database backup then run ejabberd (attached to the
terminal, otherwise you'll not be able to backup database and quit) by
/usr/sbin/ejabberd --node ejabberd@oldhostname
and in the Erlang shell prompt call
(ejabberd@oldhostname)1> mnesia:backup("/tmp/ejabberd_at_oldhostname.backup").
(note the trailing fullstop). Then stop ejabberd by typing
(ejabberd@oldhostname)1> q().
Now you have the latest Mnesia database backup.
After that run a new Erlang shell by
erl -pa /usr/lib/ejabberd/ebin
and convert the backup file to a new hostname:
1> mnesia_convert:change_node_name('ejabberd@oldhostname',
2> q().
Then use file /tmp/ejabberd_at_newhostname.backup to restore ejabberd database
as it is described in ejabberdctl manual page.
Torsten Werner <>,
Sergei Golovan <> Fri, 15 Feb 2008 10:23:59 +0300