[ejabberd] Port ejabberd Userdatabase to MySQL

Jeffrey Rogiers jeffrey.rogiers at gmail.com
Sat Oct 17 21:19:57 MSD 2009


On Oct 17, 2009, at 4:14 AM, Manuel Ritter wrote:

> Ok, i solved this problem. The offline_msg file in /var/lib/ejabberd  
> was owned by root.
> But I have another question.
> In my cfg under Hostname I have:
> {hosts, ["host-a.tld","host-b.tld"]}.
> But if I create a user in MySQL, he can login with both, user at host-a.tld 
>   and user at host-b.tld
> How can I say which user for which host in MySQL?

It all depends on the database it's configured to use. Each virtual  
host assumes it has an exclusive database, so you will have to point  
each virtual host to its own separate database.

Here's an example of how you can mix it.

{hosts, ["domain1.org","domain2.org","domain3.org"]}.

{host_config, "domain1.org", [
     {auth_method, [odbc]},
     {odbc_server, {mysql, "127.0.0.1", "domain1_db", "USER",  
"PASSWORD"}}
}.

{host_config, "domain2.org", [
     {auth_method, [odbc]},
     {odbc_server, {mysql, "127.0.0.1", "domain2_db", "USER",  
"PASSWORD"}}
}.

{host_config, "domain3.org", [
     {auth_method, [internal]}
}.

Hope this helps.

Thanks,
Jeffrey Rogiers

>
> Greetings Manuel
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd



More information about the ejabberd mailing list