Forum Moderators: phranque

Message Too Old, No Replies

Apache + WebDAV + LDAP + user directory

         

nuriddin

4:14 am on Aug 26, 2010 (gmt 0)

10+ Year Member



As I am new here, I am sorry if this post is not related topic

I am configuring WebDAV on the Apache server based on LDAP authentication.

In Apache server side there is working directory which contains user directories:

/home/httpd/dav
/home/httpd/dav/user1
/home/httpd/dav/user2

When users connect to the server, each user should go to its user directory based on their authentication.

I found very useful related post here: [webmasterworld.com ]

I did configuration and it is working well in a web browser, but is not working with WebDAV clients (I am using one, called "cadaver") and Linux's "Connect to Server" client.


Here is the codes:

webdavLDAP.conf (Apache server):
-------------------------------


Alias /dav "/home/httpd/dav"
<Directory /home/httpd/dav>
Dav On
Options +Indexes
IndexOptions FancyIndexing
AddDefaultCharset UFT-8
Order deny,allow
Deny from all

AuthType Basic
AuthName "WebDAV Server with LDAP authentication"
AuthBasicProvider ldap
AuthLDAPURL "ldap://127.0.0.1:389/ou=people,dc=myldap,dc=net?uid"

Require ldap-user user1 user2

RewriteEngine On
RewriteCond $1 ^$
RewriteCond %{REMOTE_USER} ^([a-z0-9_]+)$
RewriteRule (.*) /dav/%1 [L]

Satisfy any
</Directory>

<Location /dav/user1>
Order deny,allow
Deny from all
Require ldap-user user1
</Location>

<Location /dav/user2>
Order deny,allow
Deny from all
Require ldap-user user2
</Location>


ldap_auth.ldif (LDAP server):
----------------------------


dn: dc=myldap,dc=net
objectClass: dcObject
objectClass: organizationalUnit
dc: myldap
ou: MyLDAP Dot Net

#dn: cn=admin,dc=myldap,dc=net
#objectClass: simpleSecurityObject
#objectClass: organizationalRole
#cn: admin
#description: LDAP administrator
#userPassword: {SSHA}Bx0yRT1SOp3KhmxuSFbh4iYyn1N082BV

dn: ou=people,dc=myldap,dc=net
objectClass: organizationalUnit
ou: people

dn: uid=user1,ou=people,dc=myldap,dc=net
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
uid: user1
sn: User1
givenName: ID1
cn: User1 ID1
uidNumber: 2001
gidNumber: 20001
userPassword: {SSHA}P8WRI84LDKN6WvByEkZRSumv4yA9wi9d
loginShell: /bin/bash
# This homeDirectory does not work
# as the user directory is specified in
# Apache server side
homeDirectory: /home/httpt/dav/user1

dn: uid=user2,ou=people,dc=myldap,dc=net
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
uid: user2
sn: User2
givenName: ID2
cn: User2 ID2
uidNumber: 2002
gidNumber: 20002
userPassword: {SSHA}LqrJsw397+aRSjIMBJO3ijotXPCUqF5N
loginShell: /bin/bash
# This homeDirectory does not work
# as the user directory is specified in
# Apache server side
homeDirectory: /home/httpt/dav/user2



My main problems are:

1. How to specify user directories (which should actually be contained in Apache) on LDAP server side, rather than in Apache server itself.
2. How can I make the existing code work with other Webdav clients

Please, help me on my this difficulties.
Thank you

Nuriddin