I have 2 vhosts
e.g.:
{hosts, ["one", "two"]}.
how can i set different modules for each?
for one
{modules,
[
.... one set of modules ....]}.
{modules,
[.... set for two host ....]}.
To access the most up-to-date ejabberd documentation, please visit docs.ejabberd.im »
I have 2 vhosts
e.g.:
{hosts, ["one", "two"]}.
how can i set different modules for each?
for one
{modules,
[
.... one set of modules ....]}.
{modules,
[.... set for two host ....]}.
Patch available
Initially, 'host_config' is intended for this. However, it does not work with 'modules' and other parts of ejabberd.cfg.
A solution is to start ejabberd, and then modify the modules configuration manually using the Web Admin. However, this is not practical because those changes are not kept after a server restart.
So, I wrote a patch that allows you to define modules in a modular way: .
With this patch, if you want both vhosts to have same modules, and each vhost to have certain modules:
% This ejabberd server has two vhosts: {hosts, ["one.example.org", "two.example.org"]}. % Configuration of modules that are common on both vhosts {modules, [ {mod_register, [{access, register}]}, {mod_roster, []}, {mod_privacy, []}, {mod_adhoc, []}, {mod_configure, []}, {mod_disco, []}, {mod_stats, []}, {mod_vcard, []}, {mod_offline, []}, {mod_announce, [{access, announce}]}, % Depends on mod_adhoc {mod_private, []}, {mod_irc, []}, {mod_pubsub, [{access_createnode, pubsub_createnode}]}, {mod_time, []}, {mod_last, []}, {mod_proxy65, []}, {mod_version, []} ]}. % Add some modules to vhost one: {host_config, "one.example.org", [{{add, modules}, [ {mod_http_bind, []}, {mod_muc, [{host, "chatrooms.one.example.org"} {access, muc}, {access_create, muc}, {access_admin, muc_admin}]}, {mod_logxml, []} ]}]}. % Add some modules to vhost two: {host_config, "two.example.org", [{{add, modules}, [ {mod_muc, [{host, "muc.two.example.org"} {access, muc}, {access_create, muc}, {access_admin, muc_admin}]}, {mod_echo, [{host, "eeeeecho.two.example.org"}]} ]}]}.This patch was integrated in
This patch was integrated in ejabberd: