Take the 2-minute tour ×

I'm trying to move away from nasty daemons that write config files and need root access to operate.

I want to store vhosts/domains in an MySQL database, ideally with restricted access. I'm looking for some modules that will be able to dynamically generate vhost config retrieving them using queries.

Some of what I found, and why I can't use it:

  • mod_sqltemplate - Exactly what I was looking for, until I realized it needs httpd reload when new vhosts are inserted to the database (meaning an external script/passwordless sudo/nasty daemons/etc)
  • mod_sqlinclude - Looks the same as the above, but it's apache1.3 only. I also don't know if it requires httpd reload when new entries are inserted. I tried porting this myself and ended up one function behind.
  • mod_vdbh - I can't find any info on that one, but it has some references that shows that is might what I'm looking for
  • mod_shapvh - apache1.x only, failed to port it.

It would also be nice if there's a way to read/write bandwidth limit counters into MySQL.

Running on Debian GNU/Linux.

share|improve this question
What OS are you running this on? From a google search of mod_vdbh, I see that it is in portage for Gentoo currently. –  David Rickman Aug 12 '09 at 9:25

3 Answers 3

AFAIK there is no way to add virtual hosts to Apache without restarting it.

share|improve this answer
This blog post begs to differ - revjim.net/2003/08/14/mod_vdbh-for-apache –  LiraNuna Aug 12 '09 at 8:56
Yes. And it also links directly to a 404. –  innaM Aug 13 '09 at 10:01

You might be interested in mod_vhost_alias.

share|improve this answer
I don't understand how the module connects to a MySQL server? I want configurations stored completely in a database and not in configuration files. –  LiraNuna Aug 12 '09 at 9:08
It doesn't. What I was hinting at was that there might be a more efficient solution than storing and sourcing the vhost details from MySQL. Databases are great for some things, but others not so. –  Dan Carley Aug 12 '09 at 10:45

FreeBSD hosts the patch for the mod_vdbh module: link

I don't know if apache really handles this well, without restarting the server. When I hosted my vhosts with lighttpd it required reboots to refresh the vhosts.

share|improve this answer

Your Answer


