View Full Version : server for virtual hosting
zeller
05-25-2008, 02:10 AM
I've been looking for a server that would be suitable for virtual hosting. I know that many support it (as I already run ejabberd with a few domains), but what I'm looking for is not implemented in ejabberd. I've looked at some other servers, but none of the ones that I could get working to test out fit the bill.
The distinct features I am looking for are:
1) domains can be added or modified without having to disconnect clients on a different domain (meaning the server doesn't have to be restarted to reload the configuration)
2) easily updatable configuration (i.e. in a MySQL database or similar) which could be controlled using PHP or another simple web scripting language.
3) low memory usage (this would probably be hosted on a VPS, so CPU spikes are possible, but memory is set to a maximum of 256-512 MB)
The reason for this is that I would like to provide a service similar to jabber.apinc.org, but with web management features for control of users, federation, shared user lists, etc... So really the most important feature I want is #1. #3 is just a luxury but not necessary.
zeller
05-27-2008, 01:48 PM
Also, I've looked at jabberd14, as it seems like the configuration could be set up with MySQL. Does anyone have any experience with it? I can't seem to get it to compile either in Mac OS X or with Gentoo Linux.
sander
05-27-2008, 03:17 PM
Maybe Tigase?
zeller
05-27-2008, 06:31 PM
Does anyone have any experience with Tigase? I know it's Java based... but I can't find any documentation on it's vhost support and configuration of it.
florian
05-27-2008, 09:36 PM
Hi,
we are deploying Tigase on our XMPP Hosting. It runs very nice. I really can't complain about it.
zeller
05-27-2008, 09:41 PM
we are deploying Tigase on our XMPP Hosting. It runs very nice. I really can't complain about it.
Can you add additional domains without having to restart the server and disconnect everyone?
florian
05-27-2008, 09:42 PM
Ofcourse :D
zeller
05-27-2008, 09:46 PM
Great. Thanks for the help. I'll give it a shot.
zeller
05-29-2008, 03:43 PM
Well, I installed tigase. It wasn't too hard to get configured and running. And I got it set up for multiple virtual hosts, but when I try to add a domain when when it's already running (using config.sh and the -add switch) it doesn't recognise the change until I shut it down and start it back up. How do you get it to refresh the configuration file without restarting the server?
florian
05-29-2008, 04:47 PM
Use ad-hoc commands.
zeller
05-30-2008, 11:20 PM
thanks for the help florian. I didn't know about tigase's ad-hoc commands until you mentioned it.
The only problem now is finding a web framework/library for jabber that supports ad-hoc commands. So far the best I have found is gloox (http://camaya.net/gloox) with the python bindings, but I don't know much about python programming.
Additionally I hope Tigase supports different configurations for different domains soon, as there isn't currently a way to make some domains open for registration and some closed. But that it minor and can be emulated by requiring all registration to be done through a web page.
zeller
06-03-2008, 11:34 PM
Just to follow up, I ended up using the ruby xmpp4r library. I couldn't get the python bindings to compile for gloox (I tried both the stable releases, beta releases, and svn trunks). So even though xmpp4r didn't have an example for using ad-hoc commands I got it figured out, and it is now working to add/modify virtual hosts. Thanks for all the help florian!
In case anyone searches for how to do it, this is a simplified version:
# create the xml iq commands to set the vhosts
def create_iq(hostnames, type)
# create xml field declaration and fill it in with hostnames
field = Jabber::Dataforms::XDataField.new("#{type}/hostnames", :text_single)
field.values = [hostnames]
# create xml data declaration and fill it with the field declaration
form = Jabber::Dataforms::XData.new(:submit)
form.add(field)
# create xml command declaration and fill it with the form declaration
cmd = Jabber::Command::IqCommand.new("config/set/#{type}")
cmd.add(form)
# create xml iq declaration and fill it with the command declaration
iq = Jabber::Iq.new(:set, 'basic-conf.localhost')
iq.add(cmd)
return iq
end
components = ['message-router', 'bosh', 'c2s', 's2s', 'sess-man']
components.each do |component|
cl.send(create_iq(hostnames, component))
sleep 1
end
along with the other normal jabber connect commands. hostnames is a variable containing all the domains that need to be hosted separated with commas that gets passed to the script when it is being run. It also has to sleep 1 or else the server will drop the connection.
vBulletin® v3.8.0 Release Candidate 2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.