First of all thanks for reading this.
Second, I searched the forums here and via Google but didn't come up with anything very helpful.
Here is my current setup:
Code:
<VirtualHost *:80>
UseCanonicalName off
ServerName yourfiles.examplesite.org
ServerAdmin webmaster@_nospam_examplesite.org
DocumentRoot /var/www/examplesite.org/yourfiles
CustomLog /var/www/examplesite.org/logs/yourfiles.access.log combined
ErrorLog /var/www/examplesite.org/logs/yourfiles.error.log
<Directory /var/www/examplesite.org/yourfiles>
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
<Directory /var/www/examplesite.org/yourfiles/john>
Options Indexes
IndexOptions +IgnoreCase +FoldersFirst +FancyIndexing +XHTML
AllowOverride None
# Enable DAV support for this directory
DAV On
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
AuthName "NAS"
AuthType Basic
AuthLDAPAuthoritative on
AuthLDAPEnabled on
AuthLDAPUrl ldap://localhost:389/cn=web,ou=users,ou=examplesite.org,ou=domains,o=examplesite?uid
# DO NOT remove "GET" from the line below, as general web access requires that. The others are used by WebDAV.
<Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Require user john
</Limit>
</Directory>
<Directory /var/www/examplesite.org/yourfiles/sally>
Options Indexes
IndexOptions +IgnoreCase +FoldersFirst +FancyIndexing +XHTML
AllowOverride None
# Enable DAV support for this directory
DAV On
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
AuthName "NAS"
AuthType Basic
AuthLDAPAuthoritative on
AuthLDAPEnabled on
AuthLDAPUrl ldap://localhost:389/cn=web,ou=users,ou=examplesite.org,ou=domains,o=examplesite?uid
# DO NOT remove "GET" from the line below, as general web access requires that. The others are used by WebDAV.
<Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Require user sally
</Limit>
</Directory>
</VirtualHost>
That vhost setup works without issues.
The "issue" is when I have say 100 users: I don't want to repeat the directory "block" 100 times.
Instead of this:
Code:
<Directory /var/www/examplesite.org/yourfiles/sally>
Options Indexes
IndexOptions +IgnoreCase +FoldersFirst +FancyIndexing +XHTML
AllowOverride None
# Enable DAV support for this directory
DAV On
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
AuthName "NAS"
AuthType Basic
AuthLDAPAuthoritative on
AuthLDAPEnabled on
AuthLDAPUrl ldap://localhost:389/cn=web,ou=users,ou=examplesite.org,ou=domains,o=examplesite?uid
# DO NOT remove "GET" from the line below, as general web access requires that. The others are used by WebDAV.
<Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Require user sally
</Limit>
</Directory>
I would like to have something like this once in the config file:
Code:
<Directory /var/www/examplesite.org/yourfiles/$uid>
Options Indexes
IndexOptions +IgnoreCase +FoldersFirst +FancyIndexing +XHTML
AllowOverride None
# Enable DAV support for this directory
DAV On
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
AuthName "NAS"
AuthType Basic
AuthLDAPAuthoritative on
AuthLDAPEnabled on
AuthLDAPUrl ldap://localhost:389/cn=web,ou=users,ou=examplesite.org,ou=domains,o=examplesite?uid
# DO NOT remove "GET" from the line below, as general web access requires that. The others are used by WebDAV.
<Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Require user sally
</Limit>
</Directory>
Where
$uid is the username they enter when prompted for a user/pass.
Is there a way to do that with mod_userdir?
Thanks.