The task is to install a corporate jabber server in the local network with storing user correspondence in mysql through the mod_logdb module, and everything else in the built-in mnesia database.
Debian GNU/Linux (Etch, Lenny, Squeeze, Wheezy) or Ubuntu LTS Server
I install in Debian Wheezy but the difference with Debian Lenny, Squeeze is only in the patch version (specified in the instructions)
Assume that the server is installed according to the instructions:Installation of Debian Wheezy server with detailed screenshots
Established hosting panel for the convenience of adding a domain, database, site according to the instructions: Install and configure hosting panel ISPConfig 3 in Debian
Assume you haven’t added a repository yet, so let’s add a command to your distribution:
For Debian Lenny:
echo 'deb http://archive.debian.org/debian/ lenny main contrib non-freedeb-src http://archive.debian.org/debian/ lenny mainFor Debian Squeeze:
echo 'deb http://mirror.yandex.ru/debian/ squeeze main contrib non-free
deb-src http://mirror.yandex.ru/debian/ squeeze main
' > /etc/apt/sources.list
For Debian Wheezy:
echo 'deb http://mirror.yandex.ru/debian/ wheezy main contrib non-free
deb-src http://mirror.yandex.ru/debian/ wheezy main
' > /etc/apt/sources.list
!!! If you need to put an ejabberd version with Lenny on Squeeze, then add the Lenny repository by following the command:
echo 'deb http://archive.debian.org/debian/ lenny main contrib non-freedeb-src http://archive.debian.org/debian/ lenny mainInstall the necessary packages to compile source code for all versions of Debian:
aptitude install -y build-essential fakeroot subversion erlang
Let's create a folder. /usr/src/ejabberd And then we go to the folder where we build Ejabberd.
mkdir /usr/src/ejabberd cd /usr/src/ejabberd
Next, download the source from the official repository:
apt-get source ejabberd
! If you need to download the Squeeze version of ejabberd c Lenny, follow the command:
apt-get source ejabberd -t lenny
We're checking what we got.
ls
The team output for Debian Wheezy (other versions of ejabberd will be available for others):
ejabberd-2.1.10 ejabberd_2.1.10-4+deb7u1.diff.gz ejabberd_2.1.10-4+deb7u1.dsc ejabberd_2.1.10.orig.tar.gz
Go to the unpacked folder for assembling a package for Wheezy:
cd ejabberd-2.1.10/
Go to the unpacked folder for assembling a package for Squeeze:
cd ejabberd-2.1.5/
Go to the unpacked folder for assembling a package for Lenny:
cd ejabberd-2.0.1/src
Pumping patches.
Patch and driver for mysql are on website
For Debian Lenny, in the ejabberd 2.0.1 repository, you need to patch 2 mod_Logdb patches and the patch that adds instead of the login displays the contents of the nickname if it is filled out, for example, ivanov login, and Ivanov's Nick - will display the nickname for displaying on the screen:
Download the mod_logdb patch for Debian Lenny from the official website and patch:
wget http://softnastroy.com/downloads/ejabberd/patch-src-mod_logdb-2.0.5.diff patch -p0 < patch-mod_logdb-2.0.5.diff
Download the patch changing login to nickname from my site, only for ejabberd 2.0.1 and 2.0.5 (Lenny) as I did not find the author's website:
cd .. wget http://softnastroy.com/downloads/ejabberd/mod_shared-name.diff patch -p0 < mod_shared-name.diff
!!! If you need to install a version Ejabberd 2.0.5Follow the commands that download and unpack the source, then apply patches as above:
wget http://softnastroy.com/downloads/ejabberd/ejabberd_2.0.5-1.1.dsc wget http://softnastroy.com/downloads/ejabberd/ejabberd_2.0.5.orig.tar.gz wget http://softnastroy.com/downloads/ejabberd/ejabberd_2.0.5-1.1.diff.gz dpkg-source -x ejabberd_2.0.5*.dsc cd ejabberd-2.0.5/src/
Download the patch. mod_logdb for Debian Squeeze (ejabberd 2.1.5) from the official website:
wget http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-2.1.3.diff
Download the patch. mod_logdb for Debian Squeeze (ejabberd 2.1.5) from my website:
wget http://softnastroy.com/downloads/ejabberd/patch-mod_logdb-2.1.3.diff
Download the patch. mod_logdb for Debian Wheezy (ejabberd 2.1.10) from the official website:
wget http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-2.1.10.diff
Download the patch. mod_logdb for Debian Wheezy (ejabberd 2.1.10) from my website:
wget http://softnastroy.com/downloads/ejabberd/patch-mod_logdb-2.1.10.diff
Impose the mod_logdb patch with the command:
patch -p0 < patch-mod_logdb*
Should give you something like this:
patching file mod_logdb.erl patching file mod_logdb.hrl patching file mod_logdb_mnesia.erl patching file mod_logdb_mysql.erl patching file mod_logdb_mysql5.erl patching file mod_logdb_pgsql.erl patching file mod_logdb_mnesia_old.erl patching file gen_logdb.erl patching file mod_muc/mod_muc_room.erl Hunk #1 succeeded at 605 (offset -27 lines). patching file msgs/uk.msg Hunk #1 succeeded at 375 (offset 6 lines). patching file msgs/ru.msg Hunk #1 succeeded at 375 (offset 6 lines). patching file msgs/pl.msg Hunk #1 succeeded at 375 (offset 5 lines). patching file msgs/nl.msg Hunk #1 succeeded at 375 (offset 6 lines). patching file mod_roster.erl patching file mod_roster_odbc.erl
Install the necessary packages for assembly by command (if you need to put packets from another distribution, add the -t lenny key to the command):
apt-get build-dep ejabberd
Let's go to the file. /usr/src/ejabberd/ejabberd-2.1.10/
cd /usr/src/ejabberd/ejabberd-2.1.10/
We start the assembly of our patched ejabberd command:
fakeroot dpkg-buildpackage -us -uc
Here is a compilation and assembly, and ends with something like this:
... dpkg-deb: сборка пакета «ejabberd» в файл «../ejabberd_2.1.5-3+squeeze1_i386.deb». dpkg-genchanges >../ejabberd_2.1.5-3+squeeze1_i386.changes dpkg-genchanges: в закачку не включён оригинальный исходный код dpkg-source --after-build ejabberd-2.1.5 dpkg-buildpackage: закачка только двоичных пакетов и diff (без пакетов оригинального исходного кода)
Go to the folder up with the command:
cd ..
And we're checking out what the team is doing. ls:
ls ejabberd-2.1.5 ejabberd_2.1.5-3+squeeze1.dsc ejabberd_2.1.5-3+squeeze1_i386.deb ejabberd_2.1.5-3+squeeze1.diff.gz ejabberd_2.1.5-3+squeeze1_i386.changes ejabberd_2.1.5.orig.tar.gz
We see our assembled deb file ejabberd_2.1.5-3+squeeze1_i386.debThat's what we're gonna install.
Before installation, it is necessary to determine the domain name on which our company will work. ejabberd server, file /etc/hosts We add a line:
192.168.0.1 jabber.local.ua jabber
wherein 192.168.0.1 ip address of our server on the local network
local.ua For example, we have a domain name on our network.
jabber.local.ua - the domain name of our jabber server, through which users will connect to the server.
Change the server name in the file /etc/hostname on jabber.local.ua
Start using the name of the team:
/etc/init.d/hostname.sh
Check out what name the teams are using:
hostname hostname -f
Must be given to each team:
jabber.local.ua
It is also advisable to install and configure a DNS server on the local network so that users do not prescribe an IP server in the client, but rather use the domain name of the network.
Let's move on to the server installation.
Installation of the patched and assembled ejabberd server is performed by the command:
dpkg -i /usr/src/ejabberd/ejabberd_2.1.5-3+squeeze1_i386.deb
Check that the mod_logdb module is a command:
ls /usr/lib/ejabberd/ebin/*logdb*
Team conclusion:
/usr/lib/ejabberd/ebin/gen_logdb.beam /usr/lib/ejabberd/ebin/mod_logdb_mysql5.beam /usr/lib/ejabberd/ebin/mod_logdb.beam /usr/lib/ejabberd/ebin/mod_logdb_mysql.beam /usr/lib/ejabberd/ebin/mod_logdb_mnesia.beam /usr/lib/ejabberd/ebin/mod_logdb_pgsql.beam /usr/lib/ejabberd/ebin/mod_logdb_mnesia_old.beam
Install drivers for mod_logdb c mysql
Download drivers from the official website:
wget http://www.dp.uz.gov.ua/o.palij/mod_logdb/erlang-mysql-850-with-userflags.tar.bz2
Download drivers from my website:
wget http://softnastroy.com/downloads/ejabberd/erlang-mysql-850-with-userflags.tar.bz2
We're unpacking the archive with a command:
tar xvjf erlang-mysql-850-with-userflags.tar.bz2
Let's go into the file. erlang-mysql
cd erlang-mysql
And we collect the drivers with the command:
sh build.sh
After assembly, copy the driver to the folder /usr/lib/ejabberd/ebin/ team:
cp ebin/* /usr/lib/ejabberd/ebin/
Installation of our ejabberd server is completed, then proceed directly to the configuration of the newly installed ejabberd server.
I was with you. Sergey Lazarenko.
Continuation of instruction: Configure ejabberd and mod_logdb in Debian
Watch the video about WIFI for Dummies:



comment