-   Linux - Software (
-   -   trying to simplify webdav user configuration with setenvif (

darren74 11-15-2007 10:09 AM

trying to simplify webdav user configuration with setenvif
Hi All,

I'm trying to simplify my apache webdav config so I don't have to have individual sections for each my users in httpd.conf file.

When someone connects to access webdav they need to use the url<username here>. For instance user 'bob' would go to ''. I want to be able to pull the string 'bob' off the end of the url and use it in a 'Require user ....' statement. My attempt can be seen below:

Alias /wd /var/spool/webdav
<Location /wd>
Order Deny,Allow
Deny from all
Allow from
AuthType Basic
AuthName "WebDAV Restricted"
AuthUserFile /data/web/root/auth/htpasswd
SetEnvIf Request_URI "^/wd/(.*)" myusername=$1
Require user myusername

Unfortunately this doesn't work and I get the error message:

[Wed Nov 14 16:41:35 2007] [error] [client] access to /wd/bob/ failed, reason: user bob not allowed access

If I go back to my old config which just excludes the SetEnvIf line and puts 'bob' in place of the environment variable 'myusername' I log in just fine (I also change the 'Location' statment to look in '/wd/bob') That is to say the problem isn't in my htpasswd file.

Any suggestions on where I'm going wrong?

All times are GMT -5. The time now is 11:53 PM.