ejabberd - Comments for "One database per virtualhost" https://www.ejabberd.im/node/3242 en It's strange... https://www.ejabberd.im/node/3242#comment-53714 <p>Thanks for your reply, badlop.</p> <p>I'm using a similar configuration:</p> <div class="codeblock"><code>{hosts, [ &quot;hermes.freesoftware.org&quot;, &quot;sysadminhaiku.com.ar&quot; ]}. <p>{auth_method, odbc}.</p> <p>{host_config, &quot;sysadminhaiku.com.ar&quot;, [<br />&nbsp; {odbc_server, {mysql, &quot;sysadminhaiku.com.ar&quot;, &quot;sysadminhaiku&quot;, &quot;ejabberd&quot;, &quot;pass1&quot;}}<br />]}.</p> <p>{host_config, &quot;hermes.freesoftware.org&quot;, [<br />&nbsp; {odbc_server, {mysql, &quot;hermes.freesoftware.org&quot;, &quot;freesoftware&quot;, &quot;ejabberd&quot;, &quot;pass2&quot;}}<br />]}.</p></code></div> <p>But I get in <noindex><a href="https://10.1.0.4:5281/admin/vhosts/" title="https://10.1.0.4:5281/admin/vhosts/" rel="nofollow" >https://10.1.0.4:5281/admin/vhosts/</a></noindex></p> <div class="codeblock"><code>Domain &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; registered users connected users<br />hermes.freesoftware.org &nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2<br />sysadminhaiku.com.ar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0</code></div> <p>And the stats for freesoftware.org shows:</p> <div class="codeblock"><code>Registered users:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br />Connected users:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2</code></div> <p>Erasing the databases and creating these again I obtain the same results.</p> <p>A doubt about creation of databases:</p> <p>By each database, I execute the following commands:</p> <div class="codeblock"><code># mysql -D database -p -u ejabberd &lt; ~/download/ejabberd/src/odbc/mysql.sql<br /># mysql -D database -p -u root &lt; ~/download/ejabberd-modules/mod_archive/trun/src/mod_archive_odbc_mysql.sql</code></div> <p>Commenting the first two lines in mod_archive_odbc_mysql.sql:</p> <div class="codeblock"><code>-- CREATE DATABASE IF NOT EXISTS ejabberd CHARACTER SET utf8 COLLATE utf8_general_ci;<br />-- USE ejabberd;</code></div> <p>This procedure is correct?</p> <p>Regards,<br /> Daniel</p> Sun, 02 Nov 2008 21:50:31 +0000 Dr_Knuth comment 53714 at https://www.ejabberd.im No idea of reason. It works for me https://www.ejabberd.im/node/3242#comment-53686 <p>I don't know what could be the problem. It works for me, I tried ejabberd 2.0.2 with this config:</p> <pre> {hosts, ["localhost"]}. {auth_method, odbc}. {host_config, "localhost", [ {odbc_server, {mysql, "localhost", "ejadb", "ejauser", "ejapass"}} ]}. </pre><p> And I see the correct number of registered users of "localhost" in both pages:<br /> <noindex><a href="http://localhost:5280/admin/vhosts/" title="http://localhost:5280/admin/vhosts/" rel="nofollow" >http://localhost:5280/admin/vhosts/</a></noindex><br /> <noindex><a href="http://localhost:5280/admin/server/localhost/stats/" title="http://localhost:5280/admin/server/localhost/stats/" rel="nofollow" >http://localhost:5280/admin/server/localhost/stats/</a></noindex></p> Mon, 27 Oct 2008 11:37:00 +0000 mfoss comment 53686 at https://www.ejabberd.im Inconsistency in the web interface https://www.ejabberd.im/node/3242#comment-53671 <p>Thanks for your reply, badlop.</p> <p>It works, but nevertheless in the listing of domains/registered users/online users, I see zero registered users although I have users registered in both domains. In fact, by means of web interface I can see the registered users that I have in each of them and the correct amount of users who are connected. Some idea of the cause by which this inconsistency takes place?</p> <p>In case it serves, the process that I used to leave the two operational bases was the following one:</p> <ul> <li>To export the current database (with name ejabberd). </li><li>Erase it. </li><li>To create a new database with the name of my public domain. </li><li>To import the dump in that database erasing the users of my internal domain. </li><li>To create a new database with the name of my internal domain. </li><li>To create the local accounts for users on my LAN. </li></ul> <p>Regards,<br /> Daniel</p> Sat, 18 Oct 2008 16:06:31 +0000 Dr_Knuth comment 53671 at https://www.ejabberd.im Use host_config option https://www.ejabberd.im/node/3242#comment-53664 <p>Yes, using host_config you can define options that are specific to some vhost. Check the ejabberd Guide.</p> <p>In your case, instead of one database for all vhosts:</p> <pre>{hosts, ["example.com", "example.org", "example.net"]}. {odbc_server, {mysql, "example.com", "test", "root", "password"}}.</pre><p> You should define one database for each vhost:</p> <pre> {hosts, ["example.com", "example.org", "example.net"]}. {host_config, "example.com", [ {odbc_server, {mysql, "example.com", "test", "root", "password"}} ]}. {host_config, "example.org", [ {odbc_server, {mysql, "example.org", "test", "root", "password"}} ]}. {host_config, "example.net", [ {odbc_server, {mysql, "example.net", "test", "root", "password"}} ]}.</pre> Thu, 16 Oct 2008 21:31:15 +0000 mfoss comment 53664 at https://www.ejabberd.im