Ubuntu настройка ejabberd yml

Обновлено: 06.07.2024

ejabberd supports managing several independent XMPP domains on a single ejabberd instance, using a feature called virtual hosting.

The option hosts defines a list containing one or more domains that ejabberd will serve.

Of course, the hosts list can contain just one domain if you do not want to host multiple XMPP domains on the same instance.

Serving one domain:

Serving three domains:

Virtual Hosting

When managing several XMPP domains in a single instance, those domains are truly independent. It means they can even have different configuration parameters.

Options can be defined separately for every virtual host using the host_config option.

To define specific ejabberd modules in a virtual host, you can define the global modules option with the common modules, and later add specific modules to certain virtual hosts. To accomplish that, instead of defining each option in host_config use append_host_config with the same syntax.

In this example three virtual hosts have some similar modules, but there are also other different modules for some specific virtual hosts:

Logging

ejabberd configuration can help a lot by having the right amount of logging set up.

There are several toplevel options to configure logging:

    : Verbosity of log files generated by ejabberd. Privacy option to disable logging of IP address or sensitive data. : Setting count to N keeps N rotated logs. Setting count to 0 does not disable rotation, it instead rotates the file and keeps no previous versions around. Setting size to X rotate log when it reaches X bytes.

Default Language

The language option defines the default language of server strings that can be seen by XMPP clients. If a XMPP client does not support xml:lang , ejabberd uses the language specified in this option.

The option syntax is:

language: Language : The default value is en . In order to take effect there must be a translation file Language.msg in ejabberd ’s msgs directory.

For example, to set Russian as default language:

CAPTCHA

Some ejabberd modules can be configured to require a CAPTCHA challenge on certain actions, for instance mod_block_strangers, mod_muc, mod_register, and mod_register_web. If the client does not support CAPTCHA Forms ( XEP-0158 ), a web link is provided so the user can fill the challenge in a web browser.

Example scripts are provided that generate the image using ImageMagick’s Convert program and Ghostscript fonts. Remember to install those depencies (in Debian, install the imagemagick and gsfonts packages).

Note: if you use the ejabberd Docker Image, CAPTCHA doesn't work because it does not include ImageMagick by default. In order to use CAPTCHA in Docker, you must first install ImageMagick in the container.

ACME is used to automatically obtain SSL certificates for the domains served by ejabberd, which means that certificate requests and renewals are performed to some CA server (aka "ACME server") in a fully automated mode.

Setting up ACME

In ejabberd, ACME is configured using the acme top-level option, check there the available options and example configuration.

The automated mode can be disabled by setting auto option to false in the acme top-level option:

In this case automated renewals are still enabled, however, in order to request a new certificate, you need to run request_certificate API command:

If you only want to request certificates for a subset of the domains, run:

You can view the certificates obtained using ACME and list_certificates:

The output is mostly self-explained: every line contains the domain, the corresponding certificate file, and whether this certificate file is used or not. A certificate might not be used for several reasons: mostly because ejabberd detects a better certificate (i.e. not expired, or having a longer lifetime). It's recommended to revoke unused certificates if they are not yet expired (see below).

At any point you can revoke a certificate using revoke_certificate: pick the certificate file from the listing above and run:

If the commands return errors, consult the log files for details.

ACME implementation details

In nutshell, certification requests are performed in two phases. Firstly, ejabberd creates an account at the ACME server. That is an EC private key. Secondly, a certificate is requested. In the case of a revocation, no account is used - only a certificate in question is needed. All information is stored under acme directory inside spool directory of ejabberd (typically /var/lib/ejabberd ). An example content of the directory is the following:

Here, account.key is the EC private key used to identify the ACME account. You can inspect its content using openssl command:

Obtained certificates are stored under acme/live directory. You can inspect any of the certificates using openssl command as well:

In the case of errors, you can delete the whole acme directory - ejabberd will recreate its content on next certification request. However, don't delete it too frequently - usually there is a rate limit on the number of accounts and certificates an ACME server creates. In particular, for Let's Encrypt the limits are described here.

Access Rules

This section describes new ACL syntax introduced in ejabberd 16.06. For old access rule and ACL syntax documentation, please refer to configuration document archive

ACL Definition

Access control in ejabberd is performed via Access Control Lists (ACLs), using the acl option. The declarations of ACLs in the configuration file have the following syntax:

ACLType: ACLValue can be one of the following:

all : Matches all JIDs. Example:

user: Username : Matches the user with the name Username on any of the local virtual host. Example:

user: | Jid : Matches the user with the JID Username@Server and any resource. Example:

server: Server : Matches any JID from server Server . Example:

resource: Resource : Matches any JID with a resource Resource . Example:

shared_group: Groupname : Matches any member of a Shared Roster Group with name Groupname in the virtual host. Example:

shared_group: : Matches any member of a Shared Roster Group with name Groupname in the virtual host Server . Example:

ip: Network : Matches any IP address from the Network . Example:

user_regexp: Regexp : Matches any local user with a name that matches Regexp on local virtual hosts. Example:

user_regexp: | JidRegexp : Matches any user with a name that matches Regexp at server Server . Example:

server_regexp: Regexp : Matches any JID from the server that matches Regexp . Example:

resource_regexp: Regexp : Matches any JID with a resource that matches Regexp . Example:

node_regexp: : Matches any user with a name that matches UserRegexp at any server that matches ServerRegexp . Example:

user_glob: Glob :

server_glob: Glob :

resource_glob: Glob :

node_glob: : This is the same as above. However, it uses shell glob patterns instead of regexp. These patterns can have the following special characters:

* : matches any string including the null string.

? : matches any single character.

[. ] : matches any of the enclosed characters. Character ranges are specified by a pair of characters separated by a - . If the first character after [ is a ! , any character not enclosed is matched.

The following ACLName are pre-defined:

all : Matches any JID.

none : Matches no JID.

Access Rights

The access_rules option is used to allow or deny access to different services. The syntax is:

Each definition may contain arbitrary number of - allow or - deny sections, and each section can contain any number of acl rules (as defined in previous section, it recognizes one additional rule acl: RuleName that matches when acl rule named RuleName matches). If no rule or definition is defined, the rule all is applied.

Definition's - allow and - deny sections are processed in top to bottom order, and first one for which all listed acl rules matches is returned as result of access rule. If no rule matches deny is returned.

To simplify configuration two shortcut version are available: - allow: acl and - allow , example below shows equivalent definitions where short or long version are used:

If you define specific Access rights in a virtual host, remember that the globally defined Access rights have precedence over those. This means that, in case of conflict, the Access granted or denied in the global server is used and the Access of a virtual host doesn't have effect.

The following AccessName are pre-defined:

all : Always returns the value ‘ allow ’.

none : Always returns the value ‘ deny ’.

Shaper Rules

An entry allowing to declaring shaper to use for matching user/hosts. The syntax is:

Semantic is similar to that described in Access Rights section, only difference is that instead using - allow or - deny , name of shaper or number should be used.

Limiting Opened Sessions with ACL

The special access max_user_sessions specifies the maximum number of sessions (authenticated connections) per user. If a user tries to open more sessions by using different resources, the first opened session will be disconnected. The error session replaced will be sent to the disconnected session. The value for this option can be either a number, or infinity . The default value is infinity .

This example limits the number of sessions per user to 5 for all users, and to 10 for admins:

Several connections to a remote XMPP server with ACL

The special access max_s2s_connections specifies how many simultaneous S2S connections can be established to a specific remote XMPP server. The default value is 1 . There’s also available the access max_s2s_connections_per_node .

Allow up to 3 connections with each remote server:

Shapers

Shapers enable you to limit connection traffic. The basic syntax is:

where Rate stands for the maximum allowed incoming rate in bytes per second. When a connection exceeds this limit, ejabberd stops reading from the socket until the average rate is again below the allowed maximum.

This example defines a shaper with name normal that limits traffic speed to 1,000bytes/second, and another shaper with name fast that limits traffic speed to 50,000bytes/second:

You can use the full syntax to set the BurstSize too:

With BurstSize you can allow client to send more data, but its amount can be clamped reasonably. Each connection is allowed to send BurstSize of data before processing is delayed, and that amount is replenished by Rate each second, but never more than what BurstSize allows. This allows the client to send quite a bit of data at once, but still have limited amount of data to send on constant basis.

In this example, the normal shaper has Rate set to 1000 and the BurstSize takes that same value. The not_normal shaper has the same Rate that before, and sets a higher BurstSize :

There are several ways to install ejabberd Community Server:

    – for any Linux – for DEB and RPM based Linux – for System Operators – for Windows, macOS, Linux, . – for macOS – for developers and advanced administrators

Once installed, you can head to the next steps:

Linux RUN Installer

Those instructions assume installation on localhost for development purposes. In this document, when mentioning ejabberd-YY.MM , we assume YY.MM is the release number, for example 18.01. Also note that the installer scripts support many options useful for production or unattended, scripted installation. You can read more on installer options on unattended installation.

  1. Go to ejabberd official download page on ProcessOne website.
  2. Download the "Linux x86 64-bits Installer".
  3. Right-click on the downloaded file and select "Properties". Click on the "Permissions" tab and tick the box that says "Allow executing file as program".

Now you are able to double-click the file to execute it and start the installer. You can also set the installer as executable and start it using the command line:

Select the installer language you prefer, then click "Forward" to go through necessary installation steps:

  • accepting the license agreement,
  • selecting the installation directory,
  • defining the XMPP domain: by default, it's set to the name of your computer on the local network. if unsure, type localhost here,
  • setting the administrator username,
  • setting the administrator password,
  • selecting if this ejabberd instance will be part of a cluster: for simple local install, just select "No",
  • start the installation,

After successful installation, let's launch ejabberd using the Terminal. In the command line, go to the installation folder and execute ./bin/ejabberdctl live . This will start ejabberd in an interactive live mode with some useful messages printed in the Terminal.

If something goes wrong during the installation, and you would like to start from scratch, you will find the ejabberd uninstall in the directory where it was installed.

To start and stop ejabberd manually, use the desktop shortcuts created by the installer. If the machine doesn't have a graphical system, use the scripts ’start’ and ’stop’ in the ’bin’ directory where ejabberd is installed.

Linux DEB and RPM Installers

Those are self-sufficient packages that contain a minimal Erlang distribution, this ensures that it does not interfere with your existing Erlang version and is also a good way to make sure ejabberd will run with the latest Erlang version.

Those packages install ejabberd in /opt/ejabberd-XX.YY/ . Your configuration and Mnesia database are available in /opt/ejabberd/ .

You can download the DEB and RPM packages from the ejabberd official download page.

Operating System Packages

Many operating systems provide specific ejabberd packages adapted to the system architecture and libraries. They usually also check dependencies and perform basic configuration tasks like creating the initial administrator account.

List of known ejabberd packages:

Consult the resources provided by your Operating System for more information.

There's also an ejabberd snap to install ejabberd on serveral operating systems using Snap package manager.

Docker Image

If you already have Docker installed, the ejabberd/ecs Docker image allows to install ejabberd in one single command:

If you use Microsoft Windows 7, 10, or similar operating systems, check those tutorials:

For bug reports and improvement suggestions, please go to the docker-ejabberd Git Repository.

Homebrew

Homebrew is a package manager for macOS that aims to port the many Unix & Linux software that is not easily available or compatible. Homebrew installation is simple and the instruction is available on its website.

The ejabberd configuration included in Homebrew's ejabberd has as default domain localhost , and has already granted administrative privileges to the account admin@localhost .

Once you have Homebrew installed, open Terminal. Run

This should install the latest or at most the one-before-latest version of ejabberd. The installation directory should be reported at the end of this process, but usually the main executable is stored at /usr/local/sbin/ejabberdctl .

Start ejabberd in interactive mode, which prints useful messages in the Terminal.

Create the account admin@localhost with password set as password :

Without configuration there's not much to see here, therefore the next step is to get to know how to configure ejabberd.

Source Code

The canonical form for distribution of ejabberd stable releases is the source code package. Compiling ejabberd from source code is quite easy in *nix systems, as long as your system have all the dependencies.

Requirements

To compile ejabberd on a ‘Unix-like’ operating system, you need:

  • GNU Make
  • GCC
  • Libexpat 1.95 or higher
  • Libyaml 0.1.4 or higher 19.3 or higher. We recommend using Erlang OTP 21.2.
  • OpenSSL 1.0.0 or higher, for STARTTLS, SASL and SSL encryption.
  • Zlib 1.2.3 or higher. Optional. For Zlib Stream Compression
  • PAM library. Optional. For PAM Authentication
  • ImageMagick’s Convert program and Ghostscript fonts. Optional. For CAPTCHA challenges. 1.10.3 or higher. Optional. For Elixir Development

Downloading

Released versions of ejabberd are available on ProcessOne ejabberd official download page.

Alternatively, the latest development source code can be retrieved from the Git repository using the commands:

Compilation

To compile ejabberd execute the commands:

This tells the configuration to prepare the installed program to run with a user called ejabberd, so please create that user or tell to use another local user. It isn't recommended to run ejabberd with root user.

Note: To build ejabberd, you will need Internet access, as dependencies will be downloaded depending on the selected options.

The build configuration script allows several options. To get the full list run the command:

Options

There are many options to modify the default compilation behaviour:

-–bindir=/ : Specify the path to the user executables (where epmd and iex are available).

-–prefix=/ : Specify the path prefix where the files will be copied when running the make install command.

--with-rebar=/ : Specify the path to rebar, rebar3 or mix

-–enable-user[=USER] : Allow this normal system user to execute the ejabberdctl script (see section ejabberdctl), read the configuration files, read and write in the spool directory, read and write in the log directory. The account user and group must exist in the machine before running make install . This account needs a HOME directory, because the Erlang cookie file will be created and read there.

-–enable-group[=GROUP] : Similar to the previous option, but for system groups.

–-enable-all : Enable many of the database and dependencies options described here, this is useful for Dialyzer checks: --enable-debug --enable-elixir --enable-mysql --enable-odbc --enable-pam --enable-pgsql --enable-redis --enable-sip --enable-sqlite --enable-stun --enable-tools --enable-zlib

–-disable-debug : Compile without +debug_info .

–-enable-elixir : Build ejabberd with Elixir extension support. Works only with rebar2. If interested in Elixir development, you may prefer to install Elixir yourself and use --with-rebar=mix

–-disable-erlang-version-check : Don't check Erlang/OTP version.

-–enable-full-xml : Use XML features in XMPP stream (ex: CDATA). This requires XML compliant clients).

–-enable-hipe : Compile natively with HiPE. This is an experimental feature, and not recommended.

-–enable-lager : Use lager Erlang logging tool instead of standard error logger.

--enable-latest-deps : Makes rebar use latest versions of dependencies developed alongside ejabberd instead of version specified in rebar.config. Should be only used when developing ejabberd.

-–enable-lua : Enable Lua support, to import from Prosody.

-–enable-mssql : Enable Microsoft SQL Server support, this option requires --enable-odbc (see [Supported storages][18]).

-–enable-mysql : Enable MySQL support (see [Supported storages][18]).

-–enable-new-sql-schema : Use new SQL schema.

-–enable-odbc : Enable pure ODBC support.

-–enable-pam : Enable the PAM authentication method (see PAM Authentication section).

-–enable-pgsql : Enable PostgreSQL support (see [Supported storages][18]).

-–enable-redis : Enable Redis support to use for external session storage.

-–enable-roster-gateway-workaround : Turn on workaround for processing gateway subscriptions.

-–enable-sip : Enable SIP support.

-–enable-sqlite : Enable SQLite support (see [Supported storages][18]).

-–disable-stun : Disable STUN/TURN support.

--enable-system-deps : Makes rebar use locally installed dependencies instead of downloading them.

-–enable-tools : Enable the use of development tools.

-–disable-zlib : Disable Stream Compression (XEP-0138) using zlib.

Installation

There are several ways to install and run the ejabberd compiled from source code: installing in the system, building a production release, or building a development release.

System Install

To install ejabberd in the destination directories, run the command make install .

Note that you probably need administrative privileges in the system to install ejabberd.

The files and directories created are, by default:

/etc/ejabberd/ : Configuration directory:

  • ejabberd.yml : ejabberd configuration file
  • ejabberdctl.cfg : Configuration file of the administration script
  • inetrc : Network DNS configuration file for Erlang
  • ebin/ : Erlang binary files (*.beam)
  • include/ : Erlang header files (*.hrl)
  • priv/ : Additional files required at runtime
  • bin/ : Executable programs
  • lib/ : Binary system libraries (*.so)
  • msgs/ : Translation files (*.msgs)

/sbin/ejabberdctl : Administration script (see section ejabberdctl).

/share/doc/ejabberd/ : Documentation of ejabberd

/var/lib/ejabberd/ : Spool directory:

  • .erlang.cookie : The Erlang cookie file
  • acl.DCD, . : Mnesia database spool files (*.DCD, *.DCL, *.DAT)

/var/log/ejabberd/ : Log directory (see section [logfiles]):

  • ejabberd.log : ejabberd service log
  • erlang.log : Erlang/OTP system log

Production Release

You can build a release that includes ejabberd, Erlang/OTP and all the required erlang dependencies in a single tar.gz file. Then you can copy that file to another machine that has the same machine architecture, and run ejabberd without installing anything else.

To build that release, run:

If you configured --with-rebar to use rebar3 or mix, this will directly produce a tar.gz that you can copy. For example:

Development Release

If you configured --with-rebar to use rebar3 or mix, you can build a development release.

This is designed to run ejabberd in the local machine for development, manual testing. without installing in the system.

This development release has some customizations: uses a dummy certificate file, if you register the account admin@localhost it has admin rights.

To build a development release and start ejabberd in live mode:

Specific notes

The command to compile ejabberd in BSD systems is gmake .

macOS

If compiling from sources on macOS, you must configure ejabberd to use custom OpenSSL, Yaml, iconv. The best approach is to use Homebrew to install your dependencies, then exports your custom path to let configure and make be aware of them.

Next steps

Starting ejabberd

Depending on how you installed ejabberd, it may be started automatically by the operating system at system boot time.

You can use the ejabberdctl command line administration script to start and stop ejabberd, check its status and many other administrative tasks.

If you provided the configure option –enable-user=USER (see compilation options), you can execute ejabberdctl with either that system account or root.

If ejabberd doesn't start correctly and a crash dump file is generated, there was a severe problem. You can try to start ejabberd in interactive mode with the command bin/ejabberdctl live to see the error messages provided by Erlang and identify the exact the problem.

The ejabberdctl administration script is included in the bin directory in the Linux Installers and Docker image.

Please refer to the section ejabberdctl for details about ejabberdctl , and configurable options to fine tune the Erlang runtime system.

Autostart on Linux

On a *nix system, create a system user called 'ejabberd', give it write access to the directories database/ and logs/ , and set that as home.

If you want ejabberd to be started as daemon at boot time with that user, copy ejabberd.init from the bin directory to something like /etc/init.d/ejabberd . Then you can call /etc/inid.d/ejabberd start to start the server.

Or if you have a systemd distribution:

  1. copy ejabberd.service to /etc/systemd/system/
  2. run systemctl daemon-reload
  3. run systemctl enable ejabberd.service
  4. To start the server, you can run systemctl start ejabberd

When ejabberd is started, the processes that are started in the system are beam or beam.smp , and also epmd . For more information regarding epmd consult the section relating to epmd.

Administration Account

ejabberd binary installer prompts you for an admin account, so in that case, you can probably skip this step.

However, if you use another way of installing ejabberd you may need to create an admin XMPP account.

You need an XMPP account with administrative privileges to enter the ejabberd Web Admin. Here are the steps to create it:

Using an XMPP client and In-Band Registration.

Edit the ejabberd configuration file to give administration rights to the XMPP account you created:

You can grant administrative privileges to many XMPP accounts, and also to accounts in other XMPP servers.

Restart ejabberd to load the new configuration.

Configuring ejabberd

Now that you got ejabberd installed and running, it's time to configure it to your needs. You can follow on the Configuration section and take also a look at the Tutorials.

Установка Jabber-сервера в Ubuntu 20.04

Рассматриваемый далее сервер ejabberd являются бесплатным, поддерживает кластеризацию, имеет высокую отказоустойчивость, поддерживает веб-интерфейс и являются кроссплатформенным.

1. Установка ejabberd

ejabberd – отказоустойчивый XMPP сервер, написанный на языке программирования Erlang. Установить сервер можно при помощи официального скрипта установки. Далее будет рассмотрен данный способ.

На момент написания статьи, последней актуальной версией ejabberd была версия 21.07. Перейдите на официальный сайт ejabberd и скачайте самый первый файл с именем Linux x86 64-bits:

AYlVYfDCAMYFAAAAAElFTkSuQmCC

Перейдите в директорию куда был скачен файл (по умолчанию это директория Downloads) и сделайте скрипт исполняемым при помощи команды:

w93fidonBCo6gAAAABJRU5ErkJggg==

Далее запустите скрипт при помощи команды:

В появившемся окне необходимо выбрать язык и далее нажать на кнопку ОК:

8DcWs1pS4PbqsAAAAASUVORK5CYII=

Во всех последующих шагах после выбора настроек необходимо нажимать на кнопку Forward для перехода к следующему шагу:

gAAAABJRU5ErkJggg==

Далее необходимо принять условия лицензионного соглашения поставить чек бокс напротив фразы I accept the agreement:

fOpbD2VaL0oAAAAASUVORK5CYII=

На следующем этапе необходимо выбрать директорию куда будет установлен ejabberd. Можно оставить путь по умолчанию (домашняя директория текущего пользователя) или выбрать любой другой путь:

FqfbBcjQic3Nw+02UN2DxieWREbYkNvmwAMpfW78EZcUcxJyv2IzoduOgpvQ8EMqiIVEqflERaiVc8+f8BEE0GM7zOPIcAAAAASUVORK5CYII=

Следующий шаг – выбор доменного имени устройства. На данном этапе программа автоматически определяет hostname устройства:

D4NLNDPBUYYfAAAAAElFTkSuQmCC

Далее необходимо задать имя для учетной записи администратора:

P7schOu8Igt+AAAAAElFTkSuQmCC

Придумайте пароль для учетной записи администратора:

ASF0XPcgoPN0AAAAAElFTkSuQmCC

На следующем шаге программа спросит будет ли данная надо являться частью кластера. Так как кластер создан не будет можно выбрать No и продолжить установку:

P8BmMXY8Wty+vwAAAAASUVORK5CYII=

После этого установщик сообщит что программа готова к установке:

SKAHDm+VTggAAAABJRU5ErkJggg==

Необходимо дождаться завершения установки. Установка занимает менее минуты:

Tc5MmHYwC1YAAAAASUVORK5CYII=

2. Запуск ejabberd

После завершения установки на рабочем столе появятся 2 ярлыка: Start ejabberd.desktop и Stop ejabberd.desktop:

Y9C3QZsapAAAAABJRU5ErkJggg==

Данные ярлыки отвечают за запуск и остановку ejabberd. Необходимо щелкнуть правой кнопкой мыши по каждому из этих 2 ярлыков и выбрать пункт Allow launching. Далее запустите ярлык Start ejabberd.desktop для запуска сервера. Откроется браузер и отобразится приветственная страница с информацией:

AOPxsiMxddpaAAAAAElFTkSuQmCC

Необходимо щёлкнуть по ссылке admin interface для перехода в веб-интерфейс ejabberd. Веб интерфейс расположен по адресу localhost:5280. В поле username необходимо ввести имя пользователя в формате имя учетной записи@имя хоста системы и пароль, который был задан во время установки:

A36UBwlwWjzUAAAAAElFTkSuQmCC

После ввода учетной записи отобразится веб-интерфейс ejabberd:

ckJgajenwtGrL96nJYMG7ueo9nZ8gsPRLjaFLTI82SIyNw4Rm1+pdu5MzSx69wuDi5paEYUOXO1ojROZHXeqL7kVuPc0VMlZL0yWCy6lFQwFfarguOogWqapLVc7VQaIz1H7dMXi9Wr8uY20tTkwsUUlKfXFYjec5JRsQgIDDrBTSoZihlPdcRQ+pvNwv8Kx2HXgxGTQpQAAAAASUVORK5CYII=

Подключение к серверу ejabberd

Запустите сервер ejabberd, кликнув по ярлыку Start ejabberd.desktop на рабочем столе. Далее необходимо перейти в веб-интерфейс и на открывшейся странице выбрать раздел Virtual Hosts.


В открывшемся меню выберите свой хост.



Для подключения к XMPP серверу необходима программа клиент. Существует большое количество, таких программ, которые доступны на разных ОС – Windows, Linux, Mac OS, Android, iOS.

В качестве примера была выбрана программа Spark. Перейдите на официальный сайт Spark и скачайте программу. Spark доступен на Windows, Linux и Mac OS.


После установки откройте программу и в окне для подключения введите имя пользователя, пароль и домен. В качестве пользователя необходимо ввести ранее созданного пользователя в веб-интерфейсе ejabberd. В качестве имени домена можно указать как IP адрес сервера, так и имя хоста на котором установлен ejabberd. После ввода аутентфикационых данных нажмите на кнопку Войти.


При успешном входе откроется окно с карточкой контакта. Для начала чата с другим пользователем необходимо нажать на кнопку Контакты далее выбрать Добаввить контакт.

Добавляемый пользователь должен быть зарегистрирван на сервере ejabberd. Для начала чата необходимо перейти в меню Действия и выбрать пункт Начать чат, выбрав имя необходимого пользователя.


Выводы

В данной статье была рассмотрена установка Jabber в Ubuntu 20.04 на примере ejabberd. Благодаря простоте установка занимает считанные минуты. После этого программой можно пользоваться без дополнительных настроек таких как правка конфигурационных файлов, подключение к СУБД и т.д. что характерно для других XMPP серверов. Если у вас еще остались вопросы, спрашивайте в комментариях!

Для начала нужно запустить сервер Ubuntu 12.10 x64 как пользователь root.

1: Установка eJabberd

apt-get -y install ejabberd

2: Настройка учетной записи администратора

Примечание: вместо password укажите пароль учетной записи администратора.

ejabberdctl register admin localhost password

Привилегии администратора

В качестве стандартного имени хоста eJabberd использует «localhost», но это можно изменить в конфигурационном файле. В данном руководстве вместо стандартного имени будет использоваться «admin@localhost»; отредактируйте следующие строки файла /etc/ejabberd/ejabberd.cfg: %% Admin user >. %% Hostname .

Перезапуск eJabberd

service ejabberd restart

Добавление пользователей

eJabberdAddUser

В левом боковом меню интерфейса нажмите Virtual Hosts -> localhost -> Users.

eJabberdAdmin2

Кроме того, пользователя можно добавить и из командной строки через SSH:

eJabberdRegisterUser

Затем можно установить клиент (например, Pidgin) для подключения к XMPP:

eJabberdPidgin1

Для шифрованного подключения к XMPP-серверу используйте порт 5222.

Внесение пользователей в Buddy List

В Pidgin можно открыть список контактов под названием Buddy List и внести в него пользователя, выбрав в меню Buddies -> Add Buddy (или же нажать CTRL+B):

eJabberdAddBuddy

First, we would have to spin up a Ubuntu 12.10 x64 droplet:


Next, login to your droplet via SSH as root.

Step 1 - Install eJabberd

Step 2 - Setup Admin User

Change " password " to your own value:

Give Admin Privileges

By default, hostname used by eJabberd is 'localhost', which can be modified from config file.

For our example we will call our admin user " admin@localhost " and modify the following lines in /etc/ejabberd/ejabberd.cfg :

Restart eJabberd

Now you can navigate to your eJabberd Web Admin interface on droplet's IP address port 5280

The login username is user@domain ("admin@localhost" in our case):


From the web admin interface you can modify all the settings:


Adding New Users

From web admin interface, click Virtual Hosts -> localhost -> Users



You can also add a user from command line via SSH:


Now you can install a client like Pidgin to connect to XMPP:


Remember to use port 5222 to connect to your XMPP server using encryption:


Adding Users to your Buddy List

From Pidgin you can either press CTRL+B or from menu "Buddies" -> "Add Buddy" to buddies:


Your buddy would receive a friend request that they would have to authorize:


Now you will be able to communicate securely using XMPP and OTR encryption module in Pidgin:

Читайте также: