ejabberd - Comments for "Multiple DNS domain configuration file troubles" https://www.ejabberd.im/node/3570 en > it works, start with no https://www.ejabberd.im/node/3570#comment-54477 <p>&gt; it works, start with no errors but when i try to connect to domain2.com from a client it's impossible to connect.</p> <p>Maybe it's a DNS configuration problem. When you do "telnet domain2.com 5222" in a machine that runs a Jabber client, it should connect to ejabberd, and a line should be printed in ejabberd.log. If it doesn't, then you have a DNS problem probably.</p> Wed, 22 Jul 2009 08:12:37 +0000 mfoss comment 54477 at https://www.ejabberd.im It works but... https://www.ejabberd.im/node/3570#comment-54457 <p>Hi, it works, start with no errors but when i try to connect to domain2.com from a client it's impossible to connect. Here is my config file</p> <div class="codeblock"><code>%%%<br />%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ejabberd configuration file<br />%%% <p>%%% The parameters used in this configuration file are explained in more detail<br />%%% in the ejabberd Installation and Operation Guide.<br />%%% Please consult the Guide in case of doubts, it is included in <br />%%% your copy of ejabberd, and is also available online at<br />%%% <noindex><a href="http://www.process-one.net/en/ejabberd/docs/" title="http://www.process-one.net/en/ejabberd/docs/" rel="nofollow" >http://www.process-one.net/en/ejabberd/docs/</a></noindex></p> <p>%%% This configuration file contains Erlang terms.<br />%%% In case you want to understand the syntax, here are the concepts:<br />%%%<br />%%%&nbsp; - The character to comment a line is %<br />%%%<br />%%%&nbsp; - Each term ends in a dot, for example:<br />%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; override_global.<br />%%%<br />%%%&nbsp; - A tuple has a fixed definition, its elements are <br />%%%&nbsp;&nbsp;&nbsp; enclosed in {}, and separated with commas:<br />%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {loglevel, 4}.<br />%%%<br />%%%&nbsp; - A list can have as many elements as you want, <br />%%%&nbsp;&nbsp;&nbsp; and is enclosed in [], for example:<br />%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [http_poll, web_admin, tls]<br />%%%<br />%%%&nbsp; - A keyword of ejabberd is a word in lowercase. <br />%%%&nbsp;&nbsp;&nbsp; The strings are enclosed in &quot;&quot; and can have spaces, dots...<br />%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {language, &quot;en&quot;}.<br />%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {ldap_rootdn, &quot;dc=example,dc=com&quot;}. <br />%%%<br />%%%&nbsp; - This term includes a tuple, a keyword, a list and two strings:<br />%%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {hosts, [&quot;jabber.example.net&quot;, &quot;im.example.com&quot;]}.<br />%%%</p> <p>%%%&nbsp;&nbsp; =======================<br />%%%&nbsp;&nbsp; OVERRIDE STORED OPTIONS</p> <p>%%<br />%% Override the old values stored in the database.<br />%%</p> <p>%%<br />%% Override global options (shared by all ejabberd nodes in a cluster).<br />%%<br />%%override_global.</p> <p>%%<br />%% Override local options (specific for this particular ejabberd node).<br />%%<br />%%override_local.</p> <p>%%<br />%% Remove the Access Control Lists before new ones are added.<br />%%<br />%%override_acls.</p> <p>%%%&nbsp;&nbsp; =========<br />%%%&nbsp;&nbsp; DEBUGGING</p> <p>%%<br />%% loglevel: Verbosity of log files generated by ejabberd.<br />%% 0: No ejabberd log at all (not recommended)<br />%% 1: Critical<br />%% 2: Error<br />%% 3: Warning<br />%% 4: Info<br />%% 5: Debug<br />%%<br />{loglevel, 4}.</p> <p>%%<br />%% watchdog_admins: If an ejabberd process consumes too much memory, <br />%% send live notifications to those Jabber accounts.<br />%%<br />%%{watchdog_admins, [&quot;admin@grupoqualitex.com&quot;]}.</p> <p>%%%&nbsp;&nbsp; ================<br />%%%&nbsp;&nbsp; SERVED HOSTNAMES</p> <p>%%<br />%% hosts: Domains served by ejabberd.<br />%% You can define one or several, for example:<br />%% {hosts, [&quot;example.net&quot;, &quot;example.com&quot;, &quot;example.org&quot;]}.<br />%%<br />{hosts, [&quot;domain1.com&quot;, &quot;domain2.com&quot;]}.</p> <p>%%<br />%% route_subdomains: Delegate subdomains to other Jabber server.<br />%% For example, if this ejabberd serves example.org and you want<br />%% to allow communication with a Jabber server called im.example.org.<br />%%<br />%%{route_subdomains, s2s}.</p> <p>%%%&nbsp;&nbsp; ===============<br />%%%&nbsp;&nbsp; LISTENING PORTS</p> <p>%%<br />%% listen: Which ports will ejabberd listen, which service handles it<br />%% and what options to start it with.<br />%%<br />{listen,<br /> [</p> <p>&nbsp; {5222, ejabberd_c2s, [<br /> {certfile, &quot;D:\\ejabberd\\conf\\server.pem&quot;}, starttls,<br /> {access, c2s},<br /> {shaper, c2s_shaper},<br /> {max_stanza_size, 65536}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]},</p> <p>&nbsp; %%<br />&nbsp; %% To enable the old SSL connection method in port 5223:<br />&nbsp; %%<br />&nbsp; %%{5223, ejabberd_c2s, [<br />&nbsp; %% {certfile, &quot;D:\\ejabberd\\conf\\server.pem&quot;}, tls,<br />&nbsp; %% {access, c2s},<br />&nbsp; %% {shaper, c2s_shaper},<br />&nbsp; %% {max_stanza_size, 65536}<br />&nbsp; %% &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]},</p> <p>&nbsp; {5269, ejabberd_s2s_in, [<br /> &nbsp;&nbsp; {shaper, s2s_shaper},<br /> &nbsp;&nbsp; {max_stanza_size, 131072}<br /> &nbsp; ]},</p> <p>&nbsp; %%<br />&nbsp; %% ejabberd_service: Interact with external components (transports...)<br />&nbsp; %%<br />&nbsp; %%{8888, ejabberd_service, [<br />&nbsp; %% &nbsp;&nbsp;&nbsp; {access, all}, <br />&nbsp; %% &nbsp;&nbsp;&nbsp; {shaper_rule, fast},<br />&nbsp; %% &nbsp;&nbsp;&nbsp; {ip, {127, 0, 0, 1}},<br />&nbsp; %% &nbsp;&nbsp;&nbsp; {hosts, [&quot;icq.example.org&quot;, &quot;sms.example.org&quot;],<br />&nbsp; %% &nbsp;&nbsp;&nbsp;&nbsp; [{password, &quot;secret&quot;}]<br />&nbsp; %% &nbsp;&nbsp;&nbsp; }<br />&nbsp; %% &nbsp;&nbsp; ]},</p> <p>&nbsp; {5280, ejabberd_http, [<br /> http_bind, <br /> http_poll, <br /> web_admin<br /> ]}</p> <p> ]}.</p> <p>%%<br />%% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.<br />%% Allowed values are: true or false.<br />%% You must specify a certificate file.<br />%%<br />%%{s2s_use_starttls, true}.</p> <p>%%<br />%% s2s_certfile: Specify a certificate file.<br />%%<br />%%{s2s_certfile, &quot;D:\\ejabberd\\conf\\server.pem&quot;}.</p> <p>%%<br />%% domain_certfile: Specify a different certificate for each served hostname.<br />%%<br />%%{domain_certfile, &quot;example.org&quot;, &quot;D:\\ejabberd\\conf\\example_org.pem&quot;}.<br />%%{domain_certfile, &quot;example.com&quot;, &quot;D:\\ejabberd\\conf\\example_com.pem&quot;}.</p> <p>%%<br />%% S2S whitelist or blacklist<br />%%<br />%% Default s2s policy for undefined hosts.<br />%%<br />%%{s2s_default_policy, allow}.</p> <p>%%<br />%% Allow or deny communication with specific servers.<br />%%<br />%%{{s2s_host, &quot;goodhost.org&quot;}, allow}.<br />%%{{s2s_host, &quot;badhost.org&quot;}, deny}.</p> <p>%%%&nbsp;&nbsp; ==============<br />%%%&nbsp;&nbsp; AUTHENTICATION</p> <p>%%<br />%% auth_method: Method used to authenticate the users.<br />%% The default method is the internal.<br />%% If you want to use a different method, <br />%% comment this line and enable the correct ones.<br />%%<br />{auth_method, internal}.</p> <p>%%<br />%% Authentication using external script<br />%% Make sure the script is executable by ejabberd.<br />%%<br />%%{auth_method, external}.<br />%%{extauth_program, &quot;\\path\\to\\authentication\\script&quot;}.</p> <p>%%<br />%% Authentication using ODBC<br />%% Remember to setup a database in the next section.<br />%%<br />%%{auth_method, odbc}.</p> <p>%%<br />%% Authentication using PAM<br />%%<br />%%{auth_method, pam}.<br />%%{pam_service, &quot;pamservicename&quot;}.</p> <p>%%<br />%% Authentication using LDAP<br />%%<br />%%{auth_method, ldap}.<br />%%<br />%% List of LDAP servers:<br />%%{ldap_servers, [&quot;grupoqualitex.com&quot;]}.&nbsp;&nbsp;&nbsp; <br />%%<br />%% LDAP attribute that holds user ID:<br />%%{ldap_uids, [{&quot;mail&quot;, &quot;%u@mail.example.org&quot;}]}. <br />%%<br />%% Search base of LDAP directory:<br />%%{ldap_base, &quot;dc=example,dc=com&quot;}. <br />%%<br />%% LDAP manager:<br />%%{ldap_rootdn, &quot;dc=example,dc=com&quot;}. <br />%%<br />%% Password to LDAP manager:<br />%%{ldap_password, &quot;******&quot;}. </p> <p>%%<br />%% Anonymous login support:<br />%%&nbsp;&nbsp; auth_method: anonymous<br />%%&nbsp;&nbsp; anonymous_protocol: sasl_anon | login_anon | both<br />%%&nbsp;&nbsp; allow_multiple_connections: true | false<br />%%<br />%%{host_config, &quot;public.example.org&quot;, [{auth_method, anonymous},<br />%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {allow_multiple_connections, false},<br />%%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {anonymous_protocol, sasl_anon}]}.<br />%%<br />%% To use both anonymous and internal authentication:<br />%%<br />%%{host_config, &quot;public.example.org&quot;, [{auth_method, [internal, anonymous]}]}.<br />{host_config, &quot;domain1.com&quot;, [{auth_method, internal}]}.<br />{host_config, &quot;domain2.com&quot;, [{auth_method, odbc},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {odbc_server, {mysql, &quot;localhost&quot;, &quot;domain2&quot;, &quot;username&quot;, &quot;password&quot;}} ]}.</p> <p>%%%&nbsp;&nbsp; ==============<br />%%%&nbsp;&nbsp; DATABASE SETUP</p> <p>%% ejabberd uses by default the internal Mnesia database,<br />%% so you can avoid this section.<br />%% This section provides configuration examples in case<br />%% you want to use other database backends.<br />%% Please consult the ejabberd Guide for details about database creation.</p> <p>%%<br />%% MySQL server:<br />%%<br />%%{odbc_server, {mysql, &quot;server&quot;, &quot;database&quot;, &quot;username&quot;, &quot;password&quot;}}.<br />%%<br />%% If you want to specify the port:<br />%%{odbc_server, {mysql, &quot;server&quot;, 1234, &quot;database&quot;, &quot;username&quot;, &quot;password&quot;}}.</p> <p>%%<br />%% PostgreSQL server:<br />%%<br />%%{odbc_server, {pgsql, &quot;server&quot;, &quot;database&quot;, &quot;username&quot;, &quot;password&quot;}}.<br />%%<br />%% If you want to specify the port:<br />%%{odbc_server, {pgsql, &quot;server&quot;, 1234, &quot;database&quot;, &quot;username&quot;, &quot;password&quot;}}.<br />%%<br />%% If you use PostgreSQL, have a large database, and need a<br />%% faster but inexact replacement for &quot;select count(*) from users&quot;<br />%%<br />%%{pgsql_users_number_estimate, true}.</p> <p>%%<br />%% ODBC compatible or MSSQL server:<br />%%<br />%%{odbc_server, &quot;DSN=ejabberd;UID=ejabberd;PWD=ejabberd&quot;}.</p> <p>%%%&nbsp;&nbsp; ===============<br />%%%&nbsp;&nbsp; TRAFFIC SHAPERS</p> <p>%%<br />%% The &quot;normal&quot; shaper limits traffic speed to 1.000 B/s<br />%%<br />{shaper, normal, {maxrate, 1000}}.</p> <p>%%<br />%% The &quot;fast&quot; shaper limits traffic speed to 50.000 B/s<br />%%<br />{shaper, fast, {maxrate, 50000}}.</p> <p>%%%&nbsp;&nbsp; ====================<br />%%%&nbsp;&nbsp; ACCESS CONTROL LISTS</p> <p>%%<br />%% The &#039;admin&#039; ACL grants administrative privileges to Jabber accounts.<br />%% You can put as many accounts as you want.<br />%%<br />{acl, admin, {user, &quot;admin&quot;, &quot;grupoqualitex.com&quot;}}.</p> <p>%%<br />%% Blocked users<br />%%<br />%%{acl, blocked, {user, &quot;baduser&quot;, &quot;example.org&quot;}}.<br />%%{acl, blocked, {user, &quot;test&quot;}}.</p> <p>%%<br />%% Local users: don&#039;t modify this line.<br />%%<br />{acl, local, {user_regexp, &quot;&quot;}}.</p> <p>%%<br />%% More examples of ACLs<br />%%<br />%%{acl, jabberorg, {server, &quot;jabber.org&quot;}}.<br />%%{acl, aleksey, {user, &quot;aleksey&quot;, &quot;jabber.ru&quot;}}.<br />%%{acl, test, {user_regexp, &quot;^test&quot;}}.<br />%%{acl, test, {user_glob, &quot;test*&quot;}}.</p> <p>%%%&nbsp;&nbsp; ============<br />%%%&nbsp;&nbsp; ACCESS RULES</p> <p>%% Define the maximum number of time a single user is allowed to connect:<br />{access, max_user_sessions, [{10, all}]}.</p> <p>%% This rule allows access only for local users:<br />{access, local, [{allow, local}]}.</p> <p>%% Only non-blocked users can use c2s connections:<br />{access, c2s, [{deny, blocked},<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {allow, all}]}.</p> <p>%% For all users except admins used &quot;normal&quot; shaper<br />{access, c2s_shaper, [{none, admin},<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {normal, all}]}.</p> <p>%% For all S2S connections used &quot;fast&quot; shaper<br />{access, s2s_shaper, [{fast, all}]}.</p> <p>%% Only admins can send announcement messages:<br />{access, announce, [{allow, admin}]}.</p> <p>%% Only admins can use configuration interface:<br />{access, configure, [{allow, admin}]}.</p> <p>%% Admins of this server are also admins of MUC service:<br />{access, muc_admin, [{allow, admin}]}.</p> <p>%% All users are allowed to use MUC service:<br />{access, muc, [{allow, all}]}.</p> <p>%% Every username can be registered via in-band registration:<br />%% To disable in-band registration, replace &#039;allow&#039; with &#039;deny&#039;.<br />{access, register, [{allow, all}]}.</p> <p>%% Everybody can create pubsub nodes<br />{access, pubsub_createnode, [{allow, all}]}.</p> <p>%%%&nbsp;&nbsp; ================<br />%%%&nbsp;&nbsp; DEFAULT LANGUAGE</p> <p>%%<br />%% language: Default language used for server messages.<br />%%<br />{language, &quot;en&quot;}.</p> <p>%%%&nbsp;&nbsp; =======<br />%%%&nbsp;&nbsp; MODULES</p> <p>%%<br />%% Modules enabled in all ejabberd virtual hosts.<br />%%<br />{modules,<br /> [<br />&nbsp; {mod_adhoc,&nbsp;&nbsp;&nbsp; []},<br />&nbsp; {mod_announce, [{access, announce}]}, % requires mod_adhoc<br />&nbsp; {mod_caps,&nbsp;&nbsp;&nbsp;&nbsp; []}, <br />&nbsp; {mod_configure,[]}, % requires mod_adhoc<br />&nbsp; {mod_disco,&nbsp;&nbsp;&nbsp; []},<br />&nbsp; %%{mod_echo,&nbsp;&nbsp; [{host, &quot;echo.grupoqualitex.com&quot;}]},<br />&nbsp; {mod_http_bind,[]},<br />&nbsp; %%{mod_http_fileserver, [{docroot, &quot;D:\\ejabberd\\www&quot;}]},<br />&nbsp; {mod_irc,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; []},<br />&nbsp; {mod_last,&nbsp;&nbsp;&nbsp;&nbsp; []},<br />&nbsp; {mod_muc,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br /> &nbsp; %%{host, &quot;conference.@HOST@&quot;},<br /> &nbsp; {access, muc},<br /> &nbsp; {access_create, muc},<br /> &nbsp; {access_persistent, muc},<br /> &nbsp; {access_admin, muc_admin}<br /> ]},<br />&nbsp; %%{mod_muc_log,[]},<br />&nbsp; {mod_offline,&nbsp; []},<br />&nbsp; {mod_privacy,&nbsp; []},<br />&nbsp; {mod_private,&nbsp; []},<br />&nbsp; %%{mod_proxy65,[]},<br />&nbsp; {mod_pubsub,&nbsp;&nbsp; [ % requires mod_caps<br /> &nbsp; {access_createnode, pubsub_createnode},<br /> &nbsp; {plugins, [&quot;default&quot;, &quot;pep&quot;]}<br /> ]},<br />&nbsp; {mod_register, [<br /> &nbsp; %%<br /> &nbsp; %% After successful registration, the user receives <br /> &nbsp; %% a message with this subject and body.<br /> &nbsp; %%<br /> &nbsp; {welcome_message, {&quot;Welcome!&quot;, <br /> &nbsp;&nbsp;&nbsp;&nbsp; &quot;Welcome to this Jabber server.&quot;}},</p> <p> &nbsp; %%<br /> &nbsp; %% When a user registers, send a notification to <br /> &nbsp; %% these Jabber accounts.<br /> &nbsp; %%<br /> &nbsp; %%{registration_watchers, [&quot;admin1@example.org&quot;]},</p> <p> &nbsp; {access, register}<br /> ]},<br />&nbsp; {mod_roster,&nbsp;&nbsp; []},<br />&nbsp; %%{mod_service_log,[]},<br />&nbsp; {mod_shared_roster,[]},<br />&nbsp; %%{mod_stats,&nbsp;&nbsp;&nbsp; []},<br />&nbsp; {mod_time,&nbsp;&nbsp;&nbsp;&nbsp; []},<br />&nbsp; {mod_vcard,&nbsp;&nbsp;&nbsp; []},<br />&nbsp; {mod_version,&nbsp; []}<br /> ]}.</p> <p>%%% $Id: ejabberd.cfg.example 1073 2007-12-17 11:03:22Z badlop $</p> <p>%%% Local Variables:<br />%%% mode: erlang<br />%%% End:<br />%%% vim: set filetype=erlang tabstop=8:</p></code></div> Mon, 13 Jul 2009 13:46:03 +0000 warbandit69 comment 54457 at https://www.ejabberd.im Let's imagine you want https://www.ejabberd.im/node/3570#comment-54454 <p>Let's imagine you want this:</p> <ul> <li>domain1.com using internal auth </li><li>domain2.com using odbc auth, on Mysql database "domain2" on localhost </li><li>domain3.com using odbc auth, on Mysql database "domain3" on localhost </li></ul> <p>Put something like this:</p> <div class="codeblock"><code>{hosts, [&quot;domain1.com&quot;, &quot;domain2.com&quot;, &quot;domain3.com&quot;]}.<br />{host_config, &quot;domain1.com&quot;, [{auth_method, internal}]}.<br />{host_config, &quot;domain2.com&quot;, [{auth_method, odbc},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {odbc_server, {mysql, &quot;localhost&quot;, &quot;domain2&quot;, &quot;username&quot;, &quot;password&quot;}} ]}.<br />{host_config, &quot;domain3.com&quot;, [{auth_method, odbc},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {odbc_server, {mysql, &quot;localhost&quot;, &quot;domain3&quot;, &quot;username&quot;, &quot;password&quot;}} ]}.</code></div> Sun, 12 Jul 2009 14:36:06 +0000 mfoss comment 54454 at https://www.ejabberd.im