ejabberd - Comments for "Single port + multiple IPs / Virtual hosts" https://www.ejabberd.im/node/3276 en Quote:Single port + multiple https://www.ejabberd.im/node/3276#comment-53773 <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>Single port + multiple IPs</p></div> <p>Not possible yet: <noindex><a href="https://support.process-one.net/browse/EJAB-389" rel="nofollow" >Impossible to bind the same port to multiple interfaces</a></noindex>. You can configure ejabberd to listen in a port for all IPs, or for a certain IP.</p> <p>It isn't possible to restrict users of a vhost to a certain port.</p> <p>If you are ready to use so many different ports numbers and IP addresses, you can install ejabberd several times in different directories, and configure each one to use different ports (and to have different erlang node names). They will act independently.</p> Sun, 16 Nov 2008 19:18:49 +0000 mfoss comment 53773 at https://www.ejabberd.im Nope! Virtual hosts is only a simulation. What for? https://www.ejabberd.im/node/3276#comment-53760 <p>I've tried the variant with separated Databases:<br /> hosts: vhost1, vhost2<br /> users: user01, user02(names duplicated at both servers)<br /> So, as a result(example) user01@vhost1 list:<br /> <cite>user01@vhost2<br /> user02@vhost1<br /> user02@vhost2</cite><br /> Everybody can freely contact each other. The only difference is that offline messages are stored at recepient's side(database). That's pretty logical.<br /> But I'd like vhosts work like servers(using s2s_* rules). Or that's not so logical?</p> <p>`mod_filter' is not applicable for this aim without appropriate revision, because now it can process only lacedone(last) chain of rules, named <code>mod_filter</code>, so even if we can deny vhost1-to-vhost2 traffic, we can't deny backwards.</p> <p>The single "normal"(superfluous, but working) method, I could discover, is :</p> <blockquote><ol> <li> create separate databases for each "virtual"-host</li> <li>create separate ejabberd-conficurations</li> <li>create separate ejabberdctl-configurations*)</li> <li>run each config on separate --node</li> </ol> </blockquote> <p>________________________<br /> *) This one must contain <code>ERLANG_NODE=s@localhost</code> with node name from p.4. WARNING! Extraspecify host in every parameter to make Erlang engine work correctly, while using <code>ejabberdctl</code>-utility.</p> <p>At the and to simplify use, I propose simple scripts, which can be modified for definite purposes<br /> <code>ctl.sh</code>:</p> <div class="codeblock"><code>#!/bin/sh<br />C=&quot;$1&quot;<br />R=&quot;$2&quot;<br />Rs=&quot;&quot;<br />if [ -n &quot;$R&quot; ]<br />then<br />&nbsp;&nbsp;&nbsp; Rs=&quot;_$R&quot;<br />else<br />&nbsp;&nbsp;&nbsp; R=&quot;ejabberd&quot;<br />fi<br />pw=`pwd`<br />cm=&quot;$pw/ejabberdctl<br />&nbsp;&nbsp;&nbsp; --config /usr/home/jabber/etc/ejabberd/ejabberd${Rs}.cfg<br />&nbsp;&nbsp;&nbsp; --ctl-config /usr/home/jabber/etc/ejabberd/ejabberdctl${Rs}.cfg<br />&nbsp;&nbsp;&nbsp; --node ${R}@localhost<br />&nbsp;&nbsp;&nbsp; --spool /usr/home/jabber/var/lib/ejabberd/${R}<br />&nbsp;&nbsp;&nbsp; ${C}&quot; <p>echo &quot;$cm&quot;<br />$cm</p></code></div> <p>and one of super-script <code>start.sh</code>:</p> <div class="codeblock"><code>#!/bin/sh<br />pw=`pwd`<br />cm=&quot;$pw/ctl.sh start $1&quot;<br />$cm</code></div> <p>Usage:<br /> <code>ctl.sh &lt;action&gt; [node]</code><br /> <code>start.sh [node]</code><br /> <code>node</code> is an optional parameter(when skipped, `ejabberd' is default), which means --node [node]@localhost parameter and(!) usage of specified configuration files and directories:<br /> <code>--config ejabberd_[node].cfg</code><br /> <code>--configctl ejabberdctl_[node].cfg</code><br /> <code>--spool ejabberd/[node].cfg</code><br /> Scripts should be put into the same directory with standard <code>ejabberdctl</code>-script. All directories should be changed to appropriate values, of course.</p> <p>So, this method also decides Single_port-to-Multiple_IPs mapping, because <code>{listen}</code>-tag is specified independently.</p> <p>Thanks. Good Luck.</p> Wed, 12 Nov 2008 16:37:49 +0000 nu3ga comment 53760 at https://www.ejabberd.im