| 1 | Samba4  OpenLDAP-Backend Quick-Howto | 
|---|
| 2 | ==================================== | 
|---|
| 3 |  | 
|---|
| 4 | oliver@itc.li  -  August 2009 | 
|---|
| 5 |  | 
|---|
| 6 |  | 
|---|
| 7 | This Mini-Howto describes in a very simplified way | 
|---|
| 8 | how to setup Samba 4 (S4) (pre)Alpha 9 with the | 
|---|
| 9 | OpenLDAP (OL) -Backend. | 
|---|
| 10 | Use of OpenLDAP >= 2.4.17 is strongly recommended. | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 | 1.) Download and compile OpenLDAP. | 
|---|
| 14 |  | 
|---|
| 15 | The use of (older) Versions shipped with Distributions often | 
|---|
| 16 | causes trouble, so dont use them. Configure-Example: | 
|---|
| 17 |  | 
|---|
| 18 | #> ./configure --enable-overlays=yes --with-tls=yes --with-cyrus-sasl=yes | 
|---|
| 19 | #> make depend && make && make install | 
|---|
| 20 |  | 
|---|
| 21 | Note: openssl and cyrus-sasl libs should be installed | 
|---|
| 22 | before compilation. | 
|---|
| 23 |  | 
|---|
| 24 |  | 
|---|
| 25 |  | 
|---|
| 26 |  | 
|---|
| 27 | 2.) Final provision: | 
|---|
| 28 |  | 
|---|
| 29 | (you can add --adminpass=<yourpass> to the parameters, | 
|---|
| 30 | otherwise a random password will be generated for | 
|---|
| 31 | cn=Administrator,cn=users,<Your Base-DN>): | 
|---|
| 32 |  | 
|---|
| 33 | #> setup/provision \ | 
|---|
| 34 | --ldap-backend-type=openldap \ | 
|---|
| 35 | --ol-slapd="/usr/local/libexec/slapd" | 
|---|
| 36 | --username=samba-admin --realm=ldap.local.site \ | 
|---|
| 37 | --domain=LDAP --server-role='domain controller'\ | 
|---|
| 38 | --adminpass=linux | 
|---|
| 39 |  | 
|---|
| 40 | At the End of the final provision you should get | 
|---|
| 41 | the following output (only partial here). Read it carefully: | 
|---|
| 42 |  | 
|---|
| 43 | -------- | 
|---|
| 44 | ... | 
|---|
| 45 | A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf | 
|---|
| 46 |  | 
|---|
| 47 | Use later the following commandline to start slapd, then Samba: | 
|---|
| 48 | /usr/local/libexec/slapd -f /usr/local/samba/private/ldap/slapd.conf -h ldapi://%2Fusr%2Flocal%2Fsamba%2Fprivate%2Fldap%2Fldapi | 
|---|
| 49 |  | 
|---|
| 50 | This slapd-Commandline is also stored under: /usr/local/samba/private/ldap/slapd_command_file.sh | 
|---|
| 51 | Please install the phpLDAPadmin configuration located at /usr/local/samba/private/phpldapadmin-config.php into /etc/phpldapadmin/config.php | 
|---|
| 52 | Once the above files are installed, your Samba4 server will be ready to use | 
|---|
| 53 | Server Role:    domain controller | 
|---|
| 54 | Hostname:       ldapmaster | 
|---|
| 55 | NetBIOS Domain: LDAP | 
|---|
| 56 | DNS Domain:     ldap.local.site | 
|---|
| 57 | DOMAIN SID:     S-1-5-21-429312062-2328781357-2130201529 | 
|---|
| 58 | Admin password: linux | 
|---|
| 59 |  | 
|---|
| 60 | -------- | 
|---|
| 61 |  | 
|---|
| 62 | Our slapd in "provision-mode" wiil be shut down automatically | 
|---|
| 63 | after final provision ends. | 
|---|
| 64 |  | 
|---|
| 65 |  | 
|---|
| 66 | 3.) Run OL and S4: | 
|---|
| 67 |  | 
|---|
| 68 | After you completed the other necessary steps (krb and named-specific), | 
|---|
| 69 | start first OL with the commandline displayed in the output under (3), | 
|---|
| 70 | (remember: the slapd-Commandline is also stored in the file ../slapd_command_file.sh) | 
|---|
| 71 | then S4. | 
|---|
| 72 |  | 
|---|
| 73 |  | 
|---|
| 74 |  | 
|---|
| 75 | 4.) Special Setup-Types: | 
|---|
| 76 |  | 
|---|
| 77 | OpenLDAP-Online Configuration is now in use by default (olc): | 
|---|
| 78 |  | 
|---|
| 79 | The olc will be setup automatically | 
|---|
| 80 | under ../private/slapd.d/. | 
|---|
| 81 | olc is accessible via "cn=samba-admin,cn=samba" and Base-DN "cn=config" | 
|---|
| 82 | olc is intended primarily for use in conjunction with MMR | 
|---|
| 83 |  | 
|---|
| 84 | Attention: You have to start OL with the commandline | 
|---|
| 85 | displayed in the output under (3), but you have to set a | 
|---|
| 86 | listening port of slapd manually: | 
|---|
| 87 |  | 
|---|
| 88 | (e.g. -h ldap://ldapmaster.ldap.local.site:9000) | 
|---|
| 89 |  | 
|---|
| 90 | Attention: You _should_not_ edit the olc-Sections | 
|---|
| 91 | "config" and "ldif", as these are vital to the olc itself. | 
|---|
| 92 |  | 
|---|
| 93 |  | 
|---|
| 94 | b) MultiMaster-Configuration (MMR): | 
|---|
| 95 | At this time (S4 (pre)Alpha9) the only possible Replication setup. | 
|---|
| 96 | Use the provision Parameter: | 
|---|
| 97 |  | 
|---|
| 98 | --ol-mmr-urls=<list of whitespace separated ldap-urls (and Ports <> 389!). | 
|---|
| 99 |  | 
|---|
| 100 | e.g.: | 
|---|
| 101 | --ol-mmr-urls="ldap://ldapmaster1.ldap.local.site:9000 \ | 
|---|
| 102 | ldap://ldapmaster2.ldap.local.site:9000" | 
|---|
| 103 |  | 
|---|
| 104 | Attention: You have to start OL with the commandline | 
|---|
| 105 | displayed in the output under (3), but you have to set a | 
|---|
| 106 | listening port of slapd manually | 
|---|
| 107 | (e.g. -h ldap://ldapmaster1.ldap.local.site:9000) | 
|---|
| 108 |  | 
|---|
| 109 | The Ports must be different from 389, as these are occupied by S4. | 
|---|
| 110 |  | 
|---|
| 111 |  | 
|---|
| 112 |  | 
|---|
| 113 |  | 
|---|
| 114 |  | 
|---|
| 115 |  | 
|---|
| 116 |  | 
|---|
| 117 |  | 
|---|
| 118 |  | 
|---|
| 119 |  | 
|---|
| 120 |  | 
|---|
| 121 |  | 
|---|
| 122 |  | 
|---|
| 123 |  | 
|---|
| 124 |  | 
|---|
| 125 |  | 
|---|
| 126 |  | 
|---|
| 127 |  | 
|---|
| 128 |  | 
|---|
| 129 |  | 
|---|