ejabberd
ejabberd is an open source, multi-platform, XMPP application server and MQTT broker, written mainly in Erlang.
Installation
USE flags
USE flags for net-im/ejabberd Robust, scalable and extensible XMPP server
+stun
|
Enable STUN/TURN support |
captcha
|
Support for CAPTCHA Forms (XEP-158) on registration |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
full-xml
|
Use XML features in XMPP stream (ex: CDATA), requires XML compliant clients |
ldap
|
Add LDAP support (Lightweight Directory Access Protocol) |
mssql
|
Enable Microsoft SQL Server support (via ODBC) for data storage |
mysql
|
Enable MySQL support for data storage |
odbc
|
Enable ODBC support to access data storage |
pam
|
Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip |
postgres
|
Enable PostgreSQL support for data storage |
redis
|
Enable Redis support for transient data |
roster-gw
|
Turn on workaround for processing gateway subscriptions |
selinux
|
!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur |
sip
|
Enable SIP support |
sqlite
|
Enable SQLite database support |
zlib
|
Enable Stream Compression (XEP-0138) using zlib |
Emerge
Install ejabberd:
root #
emerge --ask net-im/ejabberd
Adding various modules through USE flags will trigger things like: dev-lang/erlang, net-im/ejabberd, etc. to be installed with ejabberd.
Configuration
Files
ejabberd.cfg has been superseded by ejabberd.yml, which is formatted in a completely different way. For old .cfg config files, "man ejabberdctl" for an automatic conversion script, see convert_to_yaml.
In /etc/jabber/ejabberd.cfg put:
:{acl, admin, {user, "bob", "süpercomputer"}}.
And:
:{hosts, ["foo.bar"]}.
Where foo.bar is what is required for the accounts, like bob@foo.bar (so the server should be available at foo.bar. If not, clientside configuration needs extra server parameter).
In /etc/jabber/ejabberctl.cfg put:
:ERLANG_NODE=ejabberd
So the node will be called ejabberd@süpercomputer while süpercomputer is the one configured in /etc/conf.d/hostname If this is changed, remember to issue:
root #
rc-service hostname restart
Service
OpenRC
Then start:
root #
rc-service ejabberd start
Then create users:
user $
ejabberdctl register {name} {domain} {password}
For example:
user $
ejabberdctl register bob foo.bar süpersecret
Set up a jabber server using ejabberd
This often fails at first try, because the whole ejabberd-erlang-mnesia thing can be really picky sometimes. So, one hint may be to not initialize/start/test anything until the final hostname selections are in every config file. Changing hostname afterwards can cause problems, at least before becoming familiar with the above mentioned tools.
Second hint: If errors are encountered when restarting here, Erlang nodes might have to be stopped, which unfortunately are not called 'erlang' or something, but 'beam', so this might be found useful:
user $
killall beam -9