Jabberd2 server is an application server based on XMPP protocol. This Guide describes the basic installation and configuration on Ubuntu 10.10 Maverick OS.
You need to be in privileged user mode in order for this guide to work.
$sudo -s password: #
1.) We neet to allow the universe Ubuntu repository. Make sure the following lines are included in "/etc/apt/sources.list" file (adapt the server address to your Ubuntu repository):
deb http://sk.archive.ubuntu.com/ubuntu maverick universe deb-src http://sk.archive.ubuntu.com/ubuntu maverick universe
After addition run
2.) Install MySQL database system which is an option for DB system required by Jabberd2 server.
#apt-get install mysql-server
During the installation you will be prompted for root database user.
3.) Install Jabberd2 server
#apt-get install jabberd2
The service is running right after the installation, but since it is not yet configured properly, we stop it using:
#service jabberd2 stop
4.) Create a database and a database user for Jabberd2 server. A script for database creation is shipped with the Jabberd2 installation and can be found at "/usr/share/doc/jabberd2/db-setup.mysql.gz". All you need to do is unzip it and run it in MySQL environment. The command for user creation is not included in the script, so we will need to type it ourselves. Log in to MySQL using root DB user password:
#gzip -d /usr/share/doc/jabberd2/db-setup.mysql.gz #mysql -p mysql> source /usr/share/doc/jabberd2/db-setup.mysql mysql> GRANT select,insert,delete,update ON jabberd2.* to jabberd2@localhost IDENTIFIED by 'secret'; mysql> quit
With the command GRANT we created user ‘jabberd2’ authenticated by password ‘secret’ (these are the default credentials for jabberd2 to authenticate itself in MySQL; it is strongly recomended to change them). The user was granted access to database named jabberd2 (created by the script).
5.) Final step si configuring ID parameter and data storage for Jabberd2. Configuration files are located in "/etc/jabberd2/" directory. The ones we will be editing are sm.xml and c2s.xml (Jabberd2 server is configured using few .xml configuration files).
In file "sm.xml" we need to edit the ID parameter (aprox. line 6)
This ID parameter is the domain in which Jabberd2 is deployed for XMPP services. It is also the "domain" part of the user’s JID (Jabber ID).
For examle, user in our domain would have JID:
The ID parameter can be set as domain name ONLY if you have "_xmpp-server._tcp.domain" SRV record in your DNS
(our case: "_xmpp-server._tcp.p2b.sip.uniza.sk").
Otherwise it needs to be set as a full FQDN of the machine the Jabberd2 is deployed on (in our case if we didn’t have _xmpp-server SRV record in DNS, we would set the ID parameter "server.p2b.sip.uniza.sk", which is a FQDN of the machine). This also requires at least type A record in DNS (if you do not have that either, it could be just a simple IP address of the machine).
This also aplies to ID parameter in c2s.xml (aprox. line 125).
Note: The "register-enable" property configures Jabberd2 to allow users to automatically create their non-existing accounts on first login. If you do not want to enable this, set the property to "false" value.
Configuring data storage and user authentication:
After the installation, Jabberd2 is configured for using MySQL by default. All we need to do is change MySQL credentials in sm.xml ale c2s.xml.
Data storage configuration in sm.xml:
<storage> ... <driver>mysql</driver> ... <mysql> <dbname>jabberd2</dbname> <user>jabberd2</user> <pass>secret</pass> ... </mysql> ... </storage>
Authentication of users in c2s.xml:
<authreg> ... <module>mysql</module> ... <mysql> ... <dbname>jabberd2</dbname> <user>jabberd2</user> <pass>secret</pass> ... </mysql> </authreg>
Jabberd2 is now configured for basic behaviour and we can start the service by:
#service jabberd2 start
Try testing your server with your favourite client (e.g. Miranda).