LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache 2.2 and LDAP Based home directories (https://www.linuxquestions.org/questions/linux-server-73/apache-2-2-and-ldap-based-home-directories-737469/)

tpe 07-03-2009 08:22 AM

Apache 2.2 and LDAP Based home directories
 
Dear all,
I have a RHEL 5 Web Server based on Apache 2.2
I need to offer the user's web pages in the web via the classic form http://users.example.com/~username

All users are located in an openLDAP server. The users are not locally installed. I cannot use the classic approach of UserDir=/home/*/public_html, because:
  • User directories are in the form /home_usr/department/1/2/3/username
  • 1,2 are the departments' subdepartments
    [3] is the 1st letter of user's last name.
So, for Sales - Wholesales - East dpt user jim, his homedirectory is:
Code:

/home_usr/sales/wholesales/east/j/jim
and his html pages should be at
Code:

/home_usr/sales/wholesales/j/jim/www
So, the UserDir=/home/*/public_html is not a usable approach by me.

I tries the mod_userdir_ldap from http://www.horde.net/~jwm/software/mod_ldap_userdir/, but it's not working! It does not even go to openLDAP Server.

Some of my the httpd.conf lines, are:
Code:

LoadModule actions_module modules/mod_actions.so
LoadModule include_module modules/mod_include.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule ldap_userdir_module modules/mod_ldap_userdir.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule dir_module modules/mod_dir.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule env_module modules/mod_env.so

<VirtualHost _default_:80>
        DirectoryIndex index.php index.html index.htm
        LogLevel debug
        HostNameLookups Off
        DocumentRoot /nfs/web/
        ServerName users.domain.com
        ErrorLog logs/users_pages-error.log
        CustomLog logs/users_pages-access.log common
        ServerSignature Off

        LDAPUserDir "www"
        LDAPUserDirServer 192.168.10.10
        LDAPUserDirDNInfo cn=www,ou=read,ou=groups,ou=ldap,ou=config,dc=example,dc=com ldapuserpass
        LDAPUserDirBaseDN dc=example,dc=com
        LDAPUserDirSearchScope subtree
        LDAPUserDirUseTLS off
        LDAPUserDirCacheTimeout 300
</VirtualHost>

When I try the http://users.domain.com/~jim I have the following error:
Code:

[Fri Jul 03 15:40:46 2009] [error] [client 192.168.0.211] File does not exist: /nfs/web/~jim
As far as I understand, Apache does not translate the "~" as an attempt to find the user's in LDAP! To support this, when the URL: http://users.example.com/~tpe (my home page, on the local disk not on the LDAP), returned the correct index.html page!
So, my questions are:
1. Can I enable a more detailed log?
2. What do I do wrong?

Thank you in advance,
Peter


All times are GMT -5. The time now is 06:14 AM.