Let’s see what we have got here:
A xmpp server based on ejabberd on my host: lofyer.org.
Windows client: Jitsi(Recommended), Pidgin.
(Optional)A Android client: Xabber.
MAXS on my Nexus 5 Android phone.
1. Prepare the server(Debian 7)
1
2
|
# apt-get install ejabberd
# cd /etc/ejabberd/; wget http://people.collabora.com/~robot101/olpc-ejabberd/ejabberd.cfg
|
Change hosts and admin section to your FQDN.
Here’s a example:
1
2
|
{hosts, ["lofyer.org"]}.
{acl, admin, {user, "mypassword", "lofyer.org"}}.
|
Then you should restart ejabberd, and maybe a reboot is essential.
1 |
# /etc/init.d/ejabberd restart |
Enable Jingle(voice and video)
You need JingleNodes module on your server.
1
2
3
4
5
|
# apt-get install erlang-tools
# git clone git://git.process-one.net/exmpp/mainline.git exmpp
# cd exmpp; ./configure; make; make install
# svn checkout http://jinglenodes.googlecode.com/svn/ jinglenodes
# cd jinglenodes; ./configure --prefix=/usr/; make; make install
|
Add following content to your ejabberd.cfg in the modules section.
1
2
3
4
5
6
|
{mod_jinglenodes, [
{host, "jinglenodes.@HOST@"},
{public_ip, "192.168.1.148"},
{purge_period, 5000},
{relay_timeout, 60000}
]},
|
Enable web register(optional)
Add to ejabberd.cfg, ‘modules’ section the basic configuration:
1
2
3
4
5
|
{modules, [
...
{mod_register_web, []},
...
]}.
|
In the ‘listen’ section enable the web page:
1
2
3
4
5
6
7
8
9
10
11
|
{listen, [
...
{5281, ejabberd_http, [
tls,
{certfile, "/etc/ejabberd/ejabberd.pem"},
{request_handlers, [
{["register"], mod_register_web}
]}
]},
...
]}.
|
Use your own certificate
1
2
3
4
|
openssl req -new -x509 -newkey rsa:1024 -days 3650 -keyout privkey.pem -out server.pem
openssl rsa -in privkey.pem -out privkey.pem
cat privkey.pem >> server.pem
rm privkey.pem
|
The port numbers you should open are: 5281(http://localhost:5281/register/) 5280(http://localhost:5280/admin) and 5222(for c2s).
Register users:
1
2
3
|
# ejabberdctl register admin lofyer.org mypassword
# ejabberdctl register myphone lofyer.org mypassword
# ejabberdctl register mypc lofyer.org mypassword
|
2. Pidgin and MAXS test
Pidgin: admin@lofyer.org
MAXS: myphone@lofyer.org
By the way, guarantee that there is only one running jabber client on your phone during this period.
Pidgin
Add a friend
Shell test
SMS test
And a msg to my GF.