13 nov. 2007

Compiling mod_ntlm for Apache2 in Ubuntu Feisty


  1. Do a checkout
    svn co https://modntlm.svn.sourceforge.net/svnroot/modntlm/trunk/mod_ntlm2

  2. install apache-developer files:
    sudo aptitude install apache2-prefork-devel 

  3. cd into mod_ntlm2 and edit Makefile:
    APXS=apxs2
    APACHECTL=apache2ctl

  4. edit mod_ntlm.c:
    replace
    apr_pool_sub_make(&sp,p,NULL);
    with
    apr_pool_create_ex(&sp,p,NULL,NULL);

    As of this post, apr_pool_sub_make is deprecated and was removed. Use apr_pool_create_ex instead.

  5. make (there's a warning about log function). Do not 'make install' here. (it doesn't find mod_ntlm.so and it adds LoadModule to httpd.conf instead of using new-style module loading mechanism.

  6. copy it to apache2 modules dir:
    sudo cp .libs/mod_ntlm.so /usr/lib/apache2/modules/

  7. create file /etc/apache2/mods-available with sudo:
    LoadModule ntlm_module /usr/lib/apache2/modules/mod_ntlm.so

  8. configure some location or directory which needs authentication:
           #NTLM Auth
    AuthName NTAuth
    AuthType NTLM
    NTLMAuth on
    NTLMAuthoritative on
    NTLMDomain DOMAIN
    NTLMServer your.dc.here # or IP
    NTLMLockfile /tmp/_my.lck
    # NTLMBackup your.dc-backup.here
    require valid-user

  9. reload apache2:
    sudo /etc/init.d/apache2 force-reload

See:

No hay comentarios:

Publicar un comentario