Virtual Hosting with Openfire

hi,

i’ve successfully installed openfire rpms on Centos 5.0 and integrated auth/user database with existing database (mysql). this was easy

now - given that user table format is: user/domain/email/realname, the question is if it’s possible to virtalhost my communication server, so that:

  • i can point A records for, say, domain1.com and domain2.com to my new openfire server

  • user can enter connection information, say, in Psi as login@domain1.com and will be authorized with query like “select password from users where username=? and domain=?”

i’ve been trying to setup username as user@domain.name (just like i do for virtual hosting emails) but openfire complains that JID cannot contain @-sign

Hi asq, welcome to IngniteRealtime community B-).

Virtually all Jabber clients will log you in as you@the_XMPP_domain_you_specified, i.e your Jabber ID (JID). That said, if you specified you@domain1.com or you@domain2.com to login into domain.com, the server won’t let you in. It doesn’t matter even if you force/trick the IP address, the server won’t let you in. The domain name you specified is part of the JID, not really where the server is.

    • user can enter connection information, say, in Psi as login@domain1.com and will be authorized with query like “select password from users where username=? and domain=?”

That is not possible in Openfire.

i’ve been trying to setup username as user@domain.name (just like i do for virtual hosting emails) but openfire complains that JID cannot contain @-sign

user as in user@domain.name cannot contain @ character. It’s not Openfire, but it’s an XMPP specification.

In a nut shell, virtual hosting is not supported in Openfire yet. I believe it’s in Jive’s roadmap.

thank you for disambiguation. i’ll probably need to check if XMPP sends domain name in authorization messages (if virtual hosting is possible at all) and if yes to move to some other server (written in interpreted language, so it could be added easily) to support virtual hosting for me.

Hi,

“i’ve been trying to setup username as user@domain.name (just like i do for virtual hosting emails) but openfire complains that JID cannot contain @-sign” is not true. A JID can contain an @ sign but it must be encoded as described in http://www.xmpp.org/extensions/xep-0106.html#escaping

So your users would be stored as “foo\40example.com”. Not sure if all clients display this properly.

So the full JID would look like “foo\40example.com@domain.com/work”.

LG

yes, if i setup…

SELECT password FROM users WHERE concat(username,’<backslash><backslash>40’,domain)=?

(yes, double backslash) and configure account in Psi as…

username40virtual-domain@jabber-domain

it works. it’s weird, counterintuitive and not really user friendly but at least it works

i’ll probably need to check if XMPP sends domain name in authorization messages (if virtual hosting is possible at all)

Yes it does, and virtual hosting depends on this feature. It’s just that Openfire doesn’t support it at the moment.

and if yes to move to some other server (written in interpreted language, so it could be added easily) to support virtual hosting for me.

There are a number of servers out there that support virtual hosting. I had a requirement for virtual hosting, but I simply couldn’t give up the extensibility feature provided by Openfire through plugins just to suit the need for virtual hosting. I’d rather wait… but it’s your call

Hi,

iam running my openfire install under a virtual host.

i got several domain names connected to one ip adress - but if you surf through the domain names they all have different content - virtual hosting.

i tried also to let openfire or the user decide wich domain name they will use for there jid, so i entered the ip adress of my virtual server into the openfire install process and not an specific domain name, but it does not work out…

so i had to connect openfire to one specific domain name, but i do not understand why it does not work the way above?

thx

Hi,

it does not work because it’s not implemented.

It’s a little tricky to compare HTTP based virtual hosts with XMPP based ones. Does you virtual host allow you to configure virtual hosts also for https://-hosts or only for http://-hosts?

LG

it’s not a good analogy - ssl certificate can bear multiple domain names (via v3 extensions).