definition of a virtual host?

Hi, I'm up and running with my domain example.com and would like to configure a number of subdomains (foo.example.com, bar.example.com, etc.). However I'm a little puzzled by the terminology used in the docs... for example, section 3.1.2 says "Options can be defined separately for every virtual host using the host_config option." Does that sentence change meaning if you replace "virtual host" with "host"?

As far as I can tell virtual hosts are just hosts that are configured differently than the default... and this seems consistent with what "virtual host" means in the web world. If a server is serving "foo.com", "bar.com", "baz.com", would you refer to "bar.com" and "baz.com" as virtual hosts, or just hosts?

Am I missing something?

Thanks!

> would you refer to

> would you refer to "bar.com" and "baz.com" as virtual hosts, or just hosts?

Both terms are used as synonims in ejabberd code, and in ejabberd documentation.

If you set in ejabberd.cfg:

{hosts, ["server1.com", "server2.com", "server3.com"]}.

ejabberd considers there are 3 virtual hosts. They are sometimes also called 'hosts' for brevity in the documentation. All three are identical.

hostname = domain name, and other confusions

What confuses me the most about ejabberd (and maybe all jabber server implementations) is the server hostname configuration. I don't understand how a domain name can be a hostname. The only way I've been able to work-around this confusion is by actually using serverhostname.domain instead of just our domain name.

Otherwise, wireshark traces show our Perl scripts getting the stream error 'unknown-host', which essentially means that the to=> attribute isn't something the server understands (because the SERVED HOSTNAME for the server is a domain name I assume).

Using Net-Jabber ... How could this possibly work?

$C->Connect( hostname => company-name.com,
port => 5222 );

- the hostname is a domain name? Huh? All the Net-Jabber examples show a domain name as the hostname value.
- this method didn't work at all of course (there's no server name specified. who is the client trying to talk to?).

The solution was to do something like this:

$C->Connect( hostname => SERVER-HOST-NAME.company-name.com,
port => 5222 );

And change the config file to something other than what all the examples show.

%%%. ================
%%%' SERVED HOSTNAMES
%% Admin user
{acl, admin, {user, "jabberadmin", "jabber-test-server.[company].com"}}.

%%
%% hosts: Domains served by ejabberd.
%% You can define one or several, for example:
%% {hosts, ["example.net", "example.com", "example.org"]}.
%%
{hosts, ["jabber-test-server.[company].com"]}.

Why are Net-Jabber and sendxmpp so confused? After solving this issue with the solution shown above, I am now running into a new issue with both Net-Jabber and sendxmpp which is that neither of them can handle digest-uri authentication (they both send "/" which the server doesn't like).

I guess my question is: why do all Net-Jabber and ejabberd.cfg examples show using just a domain name and port to talk-to/identify the server name? And, are there any modern command line tools or Perl modules that can handle ejabberd's digest-uri SASL authentication?

Thanks,

Jay

The ejabberd Guide says: >

The ejabberd Guide says:

> The option 'hosts' defines a list containing one or more domains that ejabberd will serve.

Let's imagine you control example.org, and you have an HTTP server listening in port 80 for the domain www.example.org. Now you want a Jabber server listening for client connections in port 5222 for the domain jabber.example.org. Just put in ejabberd.cfg

{hosts, ["jabber.example.org"]}.

Many people prefer to server HTTP in the domain example.org, and Jabber on the domain example.org. No problem, just put

{hosts, ["example.org"]}.

but make sure that you setup correctly the DNS or DNS SRV stuff.

In my case i just tested with:

$ telnet localhost 5222
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
testest
<?xml version='1.0'?>
...
Connection closed by foreign host.
Syndicate content