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:
<Directory /webdav/username1>
Dav On
Options +Indexes
IndexOptions FancyIndexing
AddDefaultCharset UTF-8
AuthType Digest
AuthName "Private"
AuthUserFile ??
Require user username1
Order allow,deny
Allow from all
require valid-user
</Directory>
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.
# Jeremy
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.
======
Doug G
======
I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton