This wiki page is shamefully pumped from http://doc.ubuntu-fr.org/jabberd2
Note that the jabberd2 package is only available under Debian in unstable.
If you haven’t already, add this line to your /etc/apt/sources.list
deb http://debian.mines.inpl-nancy.fr/debian/ unstable main contrib non-free
The purpose of this document is to provide a quick and easy way to install a jabberd2 server. For a more detailed configuration, refer to the official jabberd2 documentation which was used to create this page.
Prerequisites
To keep information related to users, you must have a database server installed (postgre, mysql…).
This should work for dapper and edgy (chances are it’ll still work for feisty).
To add a user to the server, run the following command as root:
# groupadd jabber
# useradd -g jabber jabber
Then choose a password for this account using the following command:
# passwd jabber
After changing the password, we need to create a directory where the process will store its logs and pids.
To do this, run the following commands:
# mkdir -p /usr/local/var/jabberd/pid/
# mkdir /usr/local/var/jabberd/log/
Once the directories are created, let’s change the ownership of the directories so that the jabber user can write to them. Run the following commands:
# chown -R jabber:jabber /usr/local/var/jabberd/
Installation du package jabberd2
# apt-get update && apt-get install jabberd2
You can also use Synaptic.
Via phpmyadmin, create a jabberd2 user and its jabberd2 table and note down its password, it will be used below.
(pour installer phpmyadmin et la base MYSql: {CODE()}# apt-get install mysql-server phpmyadmin{CODE}
The script to create the tables:
CREATE DATABASE jabberd2;
USE jabberd2;
—
—c2s authentication/registration table
—
CREATE TABLE `authreg` (
`username` TEXT, KEY `username` (`username`(255)),
`realm` TINYTEXT, KEY `realm` (`realm`(255)),
`password` TINYTEXT ) DEFAULT CHARSET=UTF8;
—
—Session manager tables
—
—
—Active (seen) users
—Used by: core
—
CREATE TABLE `active` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`time` INT ) DEFAULT CHARSET=UTF8;
—
—Logout times
—Used by: mod_iq_last
—
CREATE TABLE `logout` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`time` INT ) DEFAULT CHARSET=UTF8;
—
—Roster items
—Used by: mod_roster
—
CREATE TABLE `roster-items` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`jid` TEXT,
`name` TEXT,
`to` TINYINT,
`from` TINYINT,
`ask` INT ) DEFAULT CHARSET=UTF8;
—
—Roster groups
—Used by: mod_roster
—
CREATE TABLE `roster-groups` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`jid` TEXT,
`group` TEXT ) DEFAULT CHARSET=UTF8;
—
—vCard (user profile information)
—Used by: mod_iq_vcard
—
CREATE TABLE `vcard` (
`collection-owner` VARCHAR(255) NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`fn` VARCHAR(255),
`nickname` VARCHAR(255),
`url` VARCHAR(255),
`tel` VARCHAR(255),
`email` VARCHAR(255),
`jabberid` VARCHAR(3071),
`mailer` VARCHAR(1023),
`title` VARCHAR(255),
`role` VARCHAR(255),
`bday` VARCHAR(255), # Shouldn’t this be a DATE?
`tz` VARCHAR(7),
`n-family` VARCHAR(255),
`n-given` VARCHAR(255),
`n-middle` VARCHAR(255),
`n-prefix` VARCHAR(255),
`n-suffix` VARCHAR(255),
`adr-street` VARCHAR(255),
`adr-extadd` VARCHAR(255),
`adr-pobox` VARCHAR(15),
`adr-locality` VARCHAR(255),
`adr-region` VARCHAR(255),
`adr-pcode` VARCHAR(31),
`adr-country` VARCHAR(63),
`geo-lat` VARCHAR (255),
`geo-lon` VARCHAR(255),
`org-orgname` VARCHAR(255),
`org-orgunit` VARCHAR(255),
`agent-extval` VARCHAR(255),
`sort-string` VARCHAR(255),
`desc` TEXT,
`note` TEXT,
`uid` VARCHAR(255),
`photo-type` VARCHAR(127),
`photo-binval` TEXT,
`photo-extval` VARCHAR(255),
`logo-type` VARCHAR(127),
`logo-binval` TEXT,
`logo-extval` VARCHAR(255),
`sound-phonetic` VARCHAR(255),
`sound-binval` TEXT,
`sound-extval` VARCHAR(255),
`key-type` VARCHAR(127),
`key-cred` TEXT,
`rev` VARCHAR(255)
) DEFAULT CHARSET=UTF8;
—
—Offline message queue
—Used by: mod_offline
—
CREATE TABLE `queue` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`xml` MEDIUMTEXT ) DEFAULT CHARSET=UTF8;
—
—Private XML storage
—Used by: mod_iq_private
—
CREATE TABLE `private` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`ns` TEXT,
`xml` MEDIUMTEXT ) DEFAULT CHARSET=UTF8;
—
—Message Of The Day (MOTD) messages (announcements)
—Used by: mod_announce
—
CREATE TABLE `motd-message` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`xml` TEXT ) DEFAULT CHARSET=UTF8;
—
—Times of last MOTD message for each user
—Used by: mod_announce
—
CREATE TABLE `motd-times` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`time` INT ) DEFAULT CHARSET=UTF8;
—
—User-published discovery items
—Used by: mod_disco_publish
—
CREATE TABLE `disco-items` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`jid` TEXT,
`name` TEXT,
`node` TEXT ) DEFAULT CHARSET=UTF8;
—
—Default privacy list
—Used by: mod_privacy
—
CREATE TABLE `privacy-default` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`default` text ) DEFAULT CHARSET=UTF8;
—
—Privacy lists
—Used by: mod_privacy
—
CREATE TABLE `privacy-items` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`list` TEXT,
`type` TEXT,
`value` TEXT,
`deny` TINYINT,
`order` INT,
`block` INT ) DEFAULT CHARSET=UTF8;
—
—Vacation settings
—Used by: mod_vacation
—
CREATE TABLE `vacation-settings` (
`collection-owner` TEXT NOT NULL, KEY(`collection-owner`(255)),
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(`object-sequence`),
`start` INT,
`end` INT,
`message` TEXT ) DEFAULT CHARSET=UTF8;
—
—Users statuses
—Used by: mod_status
—
CREATE TABLE `status` (
`collection-owner` TEXT NOT NULL,
`object-sequence` BIGINT NOT NULL AUTO_INCREMENT, KEY(`object-sequence`),
`status` TEXT NOT NULL,
`show` TEXT NOT NULL,
`last-login` INT DEFAULT ‘0’,
`last-logout` INT DEFAULT ‘0’,
`xml` TEXT);
Configuration
The server name in sm.xml and c2s.xml
Your server name must be filled in both /etc/jabberd2/sm.xml and /etc/jabberd2/c2s.xml.
Edit /etc/jabberd2/sm.xml:
# vi /etc/jabberd2/sm.xml
Fill in the id field of the sm section (~ line 1):
<!—Session manager configuration—>
<sm>
<!—Our ID on the network. Users will have this as the domain part of
their JID. If you want your server to be accessible from other
Jabber servers, this ID must be resolvable by DNS.s
(default: localhost)—>
<id>ma_machine.mon_domaine.com</id>
<!—Par exemple <id>marvin.asrall.iuta.univ-nancy2.fr</id>—>
Edit /etc/jabberd2/c2s.xml:
#vi /etc/jabberd2/c2s.xml
Fill in the local section id field (~ line 63):
<!—Local network configuration—>
<local>
<!—Who we identify ourselves as. This should correspond to the
ID (host) that the session manager thinks it is. You can
specify more than one to support virtual hosts, as long as you
have additional session manager instances on the network to
handle those hosts. The realm attribute specifies the auth/reg
or SASL authentication realm for the host. If the attribute is
not specified, the realm will be selected by the SASL
mechanism, or will be the same as the ID itself. Be aware that
users are assigned to a realm, not a host, so two hosts in the
same realm will have the same users.
If no realm is specified, it will be set to be the same as the
ID.—>
<id>ma_machine.mon_domaine.com</id>
As mentioned in the c2s.xml file, the server name (which is concatenated to the jabber id) must be resolvable by DNS (or via /etc/hosts) ❗ AVOID localhost, a jabber id is <name of ‘user>@<server name>, so when a client connects to your server it must have the correct server name and not localhost ❗
Mysql
Edit your /etc/jabberd2/c2s.xml again
<!—MySQL driver configuration—>
<mysql>
<!—Database server host and port—>
<host>localhost</host>
<port>3306</port>
<!—Database name—>
<dbname>jabberd2</dbname>
<!—Database username and password—>
<user>jabberd2</user>
<pass>secret</pass>
You only need to change the host field if your database is not on the same machine as the jabberd2 server. If you are not using mysSQL’s default port (3306), you must modify the port field.
Of course the pass is not “secret” but corresponds to the password for the MySQL database of your jabberd2 user created at the beginning of the tutorial.
Jabberd2 is now configured. All you have to do is test your installation.
Installation testing
The jabberd2 server being launched as soon as the package is installed, it must be restarted in order to take the previous steps into account:
# /etc/init.d/jabberd2 restart
Or
# service jabberd2 restart
Then configure a jabber client (psi for example) from a local network machine to connect to your jabberd2 server. If that doesn’t work, good luck! Still go take a look in the logs (/var/log/jabber/).
If this operation succeeds and you want your server to be accessible from the internet, repeat the operation from a machine outside your network (or a live service like JWchat), if that does not work check your firewalls and that you are using an FQDN (try for example to resolve your DNS not one of the sites that offers this service)
In another post, I will tell you how to install the multi-user chat component.
EDIT : Er, no, in fact I won’t explain how to install the multi-user chat, I struggled too much when I did it and anyway I forgot how to do it.
[…] not for Debian Bullseye (Debian 11)! Indeed, the Debian update releases the packages relating to Ganeti 2.16, leaving […]
LikeLike