February 8th, 2012, 02:00 PM
Apache directives via database
Wondering if there is a way to house the configuration of an apache directive (i.e. directory, location, or virtualhost) in a mysql database?
We are trying to build a webdav server that can be dynamically updated from a mysql database, where each user we define gets a webdav directory like this:
Require user username1
Allow from all
I know you can do authentication via a database using mod_auth_mysql, but we want to do the entire webdav configuration from a database. Is this even close to possible?
March 11th, 2012, 11:19 AM
I don't believe so, no.
But what you can do is create a file per user in a directory that has only these configuration files and then use the Include directive to get them all in to Apache's configuration when it's restarted.
Explain your problem instead of asking how to do what you decided was the solution.
April 23rd, 2012, 11:09 AM
In the same boat
Hi, I'm looking at the same situation myself. A bit of googling hasn't turned up anything that will just plugin and do it all for me but it looks as if I can accomplish it with a wee bit of perl.
See perl.apache.org/docs/2.0/user/handlers/http.html, in particular PerlAuthenHandler.
April 23rd, 2012, 09:07 PM
ispconfig3 does what you want. The ispconfig3 code is all php and open-source, you could get their package and see how they handle dynamic per-vhost apache directives.
The man who doesn't read good books has no advantage over the man who can't read them.