Follow these steps to enable mod_archive:

  1. Install the MySQL ODBC driver,

    apt-get install libmyodbc

  2. Create an ODBC configuration for ejabberd at /etc/odbc.ini,

[ODBC Data Sources]
odbcname     = MyODBC 3.51 Driver DSN

Driver       = /usr/lib/odbc/
Description  = MyODBC 3.51 Driver DSN
SERVER       = localhost
PORT         =
USER         = ejabberd
Password     = ejabberd
Database     = ejabberd
OPTION       = 3
SOCKET       =
  1. Download mod_archive from Subversion.
svn co
cd ejabberd-modules/mod_archive/trunk
  1. You may then have to edit Emakefile before compiling. This is because by default it will point to the include files from ejabberd trunk, which will probably be for a newer version of ejabberd than you have installed, unless you installed ejabberd from trunk. in Emakefile replace all instances of:



And then run

  1. This will generate some *.beam files in the ebin directory. Copy these to the ejabberd ebin directory which should contain all the other ejabberd .beam files. The directory for me is /usr/lib/ejabberd/ebin/.
  2. Create the MySQL database schema using the SQL scripts from mod_archive. They are in ejabberd-modules/mod_archive/trunk/src/*.sql. The script for MySQL is mod_archive_odbc_mysql.sql.
  3. Add in the configuration options to enable mod_archive in ejabberd.cfg, under modules:
  4. {mod_archive_odbc, []},
  5. Create ODBC connection:
{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.

Note that the authentication won’t use this by default because in the configuration file there is an option:

{auth_method, internal}.

Which means it will use the internal mnesia database for auth.10. Finally, to view the archives in a web browser, add to the listen section of the ejabberd.cfg file:

{request_handlers, [{["archive"],mod_archive_webview}]}

So that the final section for port 5280 looks something like

{5280, ejabberd_http, [
                     {request_handlers, [{["archive"],mod_archive_webview}]}

  1. The archives should then be visible at http://host:5280/archive/

More info