Configuring Apache From A Database?
nadachicken asks: "Has anyone found a module/solution to pull Apache configs from a database server? Currently I have a program that writes the flat file configs from the database but this seems like a waste of time if Apache could be rigged to pull the same info directly. I thought I had stumbled upon code to do this a while back, but I can't seem to find it again. If there is not such a package out there, any guess on how easy it would be to pull off?"
Leknor
mod_perl can provide computed configuration files on the fly, directly from any database supported by DBI, for example, or even just computationally derived. There's examples of such in the mod_perl docs.
I too wondered if this was possible. So, I wrote a shared Apache module that I call mod_sql_conf. It accepts commands like SQLConfigHost, SQLConfigUser, SQLConfigPassword, SQLConfigDatabase, SQLConfigTable, SQLConfigFiled, SQLConfigWhere, SQLConfigOrderBy. Then when it finds the command SQLConfigLoad, it loads the text from the database and processes it as commands in the configuration file. It is still a beta version, as I'm the only one who has used it, and just to test it out. It was really just a proof-of-concept experiment for myself. I know it works on a Linux system. And right now it only works with MySQL, although it was created to be ported to other databases in the future with minimal work. I was planning on releasing this as an open source work under the GPL, but I just haven't got around to it.
I am away from my home computer for another week or so, but I'd be happy to make the source available to you when I return after the new year.