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