Hi,
I am configuring two virtual hosts. I would like to customise module behaviour for each host. For example :
* Virtual host example.com does LDAP authentication and uses the module mod_vcard_ldap for its jabber users directory.
* Virtual host guests.example.com does internal (mnesia) authentication and uses the module mod_vcard for its jabber users directory.
The different authentication is not a problem (that's working), plus all the modules are configured and working for example.com. Now I'm adding guest.example.com and I want the module behaviour for this virtual host to be different.
How should I be structuring my ejabberd.cfg file to achieve this?
Thanks,
Warren.
mod_vcard and mod_vcard_ldap compatibility
Hi,
Now I have configured
{mod_vcard, [{host, "jud.guests.example.com"}]},
{mod_vcard_ldap, [{host, "jud.example.com"},
However now the problem is that when mod_vcard_ldap is enabled mod_vcard breaks, they are not compatible! With the config as above the mod_vcard server appears (via service discovery) to be available to Jabber users of guests.example.com, but they are unable to update their vcard entries. This problem is rectified by commenting out mod_vcard_ldap, but then the LDAP Jabber User Directory service for users of example.com is no longer available...
So how do I enable both mod_vcard and mod_vcard_ldap for different hosts at the same time? Please note that the version of ejabberd I am using is 1.1.2.
Thanks,
Warren.
try add for each host
try add for each host section like this:
{host_config, "example.net", [{auth_method, internal}, {modules, [{mod_vcard,[]}, ....]}]}.
Try host_config, else try host_config+add patch
try add for each host section like this:
{host_config, "example.net", [{auth_method, internal}, {modules, [{mod_vcard,[]}, ....]}]}.
This should work on theory with modules, but probably does not on practice. If it doesn't work (modules config is messed by ejabberd...) then you can trythis patch .
Tried the host_config+add patch.
Hi,
Thanks for the suggestion. I've installed and tested with this patch. However the behaviour with or without the patch remains the same. According to my testing it is not possible to add the mod_vcard module by using the host_config line. With or without the "add" patch or with or without the presence of mod_vcard_ldap.
I've gone back to testing the setup which in my opion should work :
{mod_vcard, [{host, "jud.guests.example.com"}]},
{mod_vcard_ldap, [{host, "jud.example.com"},
When I check the loaded modules for each virtual host I see that mod_vcard and mod_vcard_ldap are loaded for both virtual hosts.
I tried using the admin interface to stop the running mod_vcard_ldap modules on both virtual hosts, but this does not help. The only way I can get mod_vcard to work is to not load mod_vcard_ldap in the first place.
Regards,
Warren.
Should work; example configuration
However the behaviour with or without the patch remains the same. According to my testing it is not possible to add the mod_vcard module by using the host_config line.
ejabberd does not allow to run mod_vcard and mod_vcard_ldap on the same vhost, for the same reason that it does not allow to run two mod_vcards on the same vhost.
I made an experiment. Since I don't have LDAP installed, I tried to run two mod_vcards, one for each vhost on my system (localhost and atenea). Each module will have a different configuration.
It works for me. The vcard on localhost is called loki, and the vcard on atenea is called ati.
I have a working config now!
Hi,
Thanks for the tip. I now have a working mod_vcard on virtual host "A" + mod_vcard_ldap on virtual host "B" setup, by following your example above. However it did not work for me straight away, it seems that the ORDER of the commands in the config file is important. My apologies if this is a well understood or documented point. In my earlier attempts I had been following the ejabberd.cfg "stanza" and I was adding my host_config changes to the "host_config section" which occurs BEFORE the "common modules" section. It was only when I moved my "host_config" lines to the bottom of the ejabberd.cfg file that things began to work as expected.
With thanks,
Warren.
Still looks like mod_vcard and mod_vcard_ldap are not compatible
Hi,
Thanks for the suggestion. I tried this :
{host_config, "guests.example.com", [{auth_method, internal},
{modules, [
{mod_vcard, [{host, "jud.guests.example.com"}]}]}
]}.
Possibly I've got a typo in there but running with the above line resulted in the mod_vcard service disappearing altogether for the guests.example.com vhost.
Thanks,
Warren.