Quick introduction –
jabber or rather
XMPP is a protocol or set of protocols
which define a transport layer for messages and media streams. Similar to
it is a sort of signaling medium on which messages can be exchanged.
Jabberd2 is the successor of
jabberd1 and can be found at http://jabberd2.xiaoka.com/
In general, it is possible to think of the
jabberd concept as an implementation of a
collaboration framework, much like an enhanced IRC implementation.
We will deploy it to provide Instant Messaging and Conferencing between users.
First off, meet the package requirements and install: OpenSSL support
- libssl-dev (>= 0.9.6b)
apt-get install libssl-dev libssl0.9.8 openssl
apt-get install libidn11 libidn11-dev
apt-get install libexpat1 libexpat1-dev
apt-get install libxml-simple-perl libdigest-sha1-perl
If you don’t have MySQL installed already then also:
apt-get install mysql-server-5.0 libmysqlclient15-dev libmysqlclient15off
Another important requirement is that you have resolvable domain names which will resolve
to the IP address of the
jabberd server. If you plan on also deploying the conference plugin
to allow chat rooms then you will need 2 domain names.
We will assume through-out the document that the domain names are: im.example.com and conf.example.com
tar -xvf jabberd-2.1.17.tar.bz2 cd jabberd-2.1.17 ./configure –enable-mysql –enable-ssl –enable-idn –with-extra-include-path=/usr/local/lib/:/usr/lib/ssl/ –with-extra-library-path=/usr/lib
If at this point you receive errors from configure it means you probably didn’t meet at least one of the dependencies or you have it installed elsewhere, if which that is the case then tweak the include or library configure options accordingly. To continue:
make make install chown -R root:jabber /usr/local/etc/jabberd* chmod -R 640 /usr/local/etc/jabberd* mkdir -p /usr/local/var/jabberd/pid mkdir -p /usr/local/var/jabberd/log mkdir -p /usr/local/var/jabberd/spool/rooms
Then change to the /usr/local/etc directory and perform changes as following to the configuration xml files that are present there:
c2s.xml: im.example.com register-enable='true' pemfile='/usr/local/etc/server.pem'>im.example.com
- Make the tag changes in the c2s.xml file as shown above.
- To the end of the file there’s the mysql module configuration, you can leave it as it is with the default jabberd2/secret user/pass account or change it (but you will also have to remember to make those changes later when we create that user in mysql)
sm.xml: im.example.com email@example.com
(Controlling what users automatically appear on the contact list)
- Uncomment that query tag and make it look something like that.
in the source package where the tar.gz file was extracted there’s a directory tools/
and inside it a
With the root user account run:
mysql -u root -p < db-setup.mysql
It will create the database
jabberd2 and populate all the tables.
Then we need to allow the
jabberd2 user which is configured in all the files (c2s, sm, etc)
access to the database, inside mysql console run:
GRANT select,insert,delete,update ON jabberd2.* to jabberd2@localhost IDENTIFIED by 'secret';
Note, if you change that password from ‘secret’ to something else be sure to make changes in the configuration files as well.
If everything went well you can run the jabberd program (it’s actually a script that calls the rest of the server components) as follows:
And now check syslog, hopefully for successful messages.
mu-conference conferencing plugin is done as follows:
Get the program from: http://download.gna.org/mu-conference/
wget http://download.gna.org/mu-conference/mu-conference_0.7.tar.gz tar -zxvf mu-conference_0.7.tar.gz cd mu-conference_0.7 make copy the mu-conference binary to /usr/local/bin copy the muc.xml configuration file to /usr/local/etc configure the muc.xml file as follows: conf.example.com conf.example.com 127.0.0.15347 secret /usr/local/var/jabberd/spool/rooms /usr/local/var/jabberd/log/usr/local/var/jabberd/pid/mu-conference.pid 255 firstname.lastname@example.org
- Changing the
loglevelto 255 is a good idea when starting out, later you can change it back.
For creating persistent rooms – meaning that they always exist on the server without having each user create them manually when he or she pleases:
in the source directory for mu-conference there’s a scripts/ directory, there you can
roommaker.pl script, run it and answer the questions as follows:
Please enter spool directory path (e.g. /usr/local/jabber/spool): /usr/local/var/jabberd/spool/rooms Please enter jid for the room: email@example.com /usr/local/var/jabberd/spool/conf.example.com/ doesn’t exist – Create? (Y/N) y Creating Directory Configuring room firstname.lastname@example.org Filename: /usr/local/var/jabberd/spool/conf.example.com/[long-alpha-numeric-text].xml General Options — Room name (text) [Default: lobby]: Password (text) [Default: ]: Room description/MOTD (text) [Default: ]: Room subject (text) [Default: ]: Bare JID of room creator (text) [Default: ]: email@example.com Is room public (0/1) [Default: 0]: Maximum Users (value) [Default: 0]: 256 Permission Options — Allow non-admins to see real jids (0/1) [Default: 0]: Can users change subject (0/1) [Default: 0]: Allow users to IQ query other users (0/1) [Default: 0]: Legacy Options: — Consider all clients legacy (0/1) [Default: 0]: Legacy join message (text) [Default: ]: Legacy leave message (text) [Default: ]: Legacy rename message (text) [Default: ]: Moderation Options: — Is room moderated (0/1) [Default: 0]: Skipping Moderation options Member-Only Options: — Make room member-only (0/1) [Default: 0]: Skipping Moderation options Logging Options: — Enable native room logging (0/1) [Default: 0]: 1 Log Format 0] Plain Text 1] XML 2] XHTML [Default: 0]: 0 Owner List: — JID of owner (Empty line to exit): firstname.lastname@example.org JID of owner (Empty line to exit): Admin List: — JID of admin (Empty line to exit): email@example.com JID of admin (Empty line to exit): Member List: — JID of member (Empty line to exit): Outcast List: — JID of outcast (Empty line to exit): Writing Room definition file Room registry not found. Creating Writing updated Room registry file [jabberd@opennms scripts]
What it will do is create
rooms.xml and another
long-name.xml file inside the
/usr/local/var/jabberd/spool/rooms/conf.example.com/ directory, copy those files
to the actual
/usr/local/var/jabberd/spool/rooms/ folder (overwrite the
rooms.xml it’s ok)
Then try running jabberd, after that you can run the
mu-conference program manually
/usr/local/bin/mu-conference -c /usr/local/etc/muc.xml
And check it’s log file at:
to see that everything is ok.
Bibliography: very useful information can be found at
jabberd2 deployment: http://jabberd2.xiaoka.com/wiki/InstallGuide/
mu-conference configuration and package: