1---2title: 'mod_pam/winbind apache authentication'3date: '2010-07-02'4published_at: '2010-07-02T14:42:00.008+10:00'5tags: ['linux', 'pam', 'samba', 'sysadmin', 'winbind']6author: 'Gavin Jackson'7excerpt: 'Introduction/Pre-requisites The Winbind NTLM Authentication configuration for squid and apache approach to AD authentication is good and all, but it does not work in IE8 over https. An alternate metho...'8updated_at: '2010-07-02T15:00:54.170+10:00'9legacy_url: 'http://www.gavinj.net/2010/07/modpamwinbind-apache-authentication.html'10---1112[](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrI_6aOLBayBl1rgikS2hjRovq1iL9IhnWe_z1oI1c5plZ5ArpPoKnOGe-N1UwUL0tdqiMt_f3Mlg40xT8A9Hw5U8KNwFVb7LZHUlsCs7XNidjsyxyFiChgQs-aUhgP8c0gqU0UezVpSw/s1600/escher-ascending-and-descending-medium.jpg)1314Introduction/Pre-requisites1516The [Winbind NTLM Authentication configuration for squid and apache](http://gavinjnet.blogspot.com/2010/07/winbind-ntlm-authentication.html) approach to AD authentication is good and all, but it does not work in IE8 over https.1718An alternate method is to use apache mod_pam to authenticate against pam (which has been configured to authenticate against the AD controller using winbind).1920On SLES 11 it is not installed by default, so you are going to have to build from source.2122Ensure that samba and winbind have been installed and configured (see this [guide](http://gavinjnet.blogspot.com/2010/07/winbind-ntlm-authentication.html)).2324Building mod_pam from source2526Download the source code from: [http://pam.sourceforge.net/mod_auth_pam/](http://pam.sourceforge.net/mod_auth_pam/)2728```29zypper install apache2-devel30tar -zxvf mod_auth_pam-2.0-1.1.1.tar.gz31cd mod_auth_pam32make33make install34```3536Now, on 64 bit SLES you need to modify the **/etc/pam.d/httpd** file (which was created during the install process)3738```39#%PAM-1.040auth required /lib64/security/pam_winbind.so try_first_pass debug41account required /lib64/security/pam_permit.so42```4344Configuring Apache The build process should have added the mod_pam module to your apache installation (you can verifiy this by checking /etc/sysconfig/apache2).4546You can now add the following entry to your site root configuration:4748```49 authType Basic50AuthPAM_Enabled on51AuthBasicAuthoritative Off52AuthName "secure area"53require valid-user54AuthUserFile /dev/null55```5657Restart apache /etc/init.d/apache2 restart5859Now when trying to view the **http://webserver/pam** directory, it will prompt for a username and password that is authenticated using winbind (via pam). Pretty cool eh606162