bc3978964e3e28ba94bc2fe02fa771b42b940e50
[samba.git] / howto.txt
1 Samba4 developer howto
2 ----------------------
3
4 tridge@samba.org, December 2004
5
6
7 This is a very basic document on how to setup a simple Samba4
8 server. This is aimed at developers who are already familiar with
9 Samba3 and wish to participate in Samba4 development. This is not
10 aimed at production use of Samba4.
11
12
13 Step 1: download Samba4
14 -----------------------
15
16 There are 2 methods of doing this:
17
18   method 1:  "rsync -avz samba.org::ftp/unpacked/samba4 ."
19
20   method 2:  "svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0 samba4"
21
22 both methods will create a directory called "samba4" in the current
23 directory. If you don't have rsync or svn then install one of them. 
24
25 Note that the above rsync command will give you a checked out svn
26 repository. So if you also have svn you can update it to the latest
27 version at some future date using:
28
29   cd samba4
30   svn up
31
32
33 Step 2: compile Samba4
34 ----------------------
35
36 Run this:
37
38   cd samba4/source
39   ./autogen.sh
40   ./configure.developer -C
41   make
42
43 If you have gcc 3.4 or newer, then run "make pch" before "make" to
44 greatly speed up the compile process (about 5x faster).
45
46
47 Step 3: install Samba4
48 ----------------------
49
50 Run this as a user who have permission to write to the install
51 directory (defaults to /usr/local/samba). Use --prefix option to
52 configure above to change this.
53  
54   make install
55
56
57 Step 4: provision Samba4
58 ------------------------
59
60 The "provision" step sets up a basic user database. 
61
62   cd source
63   ./script/provision.pl --realm=YOUR.REALM --domain=YOURDOM --adminpass=SOMEPASSWORD
64
65 This will create a file called newsam.ldb. You need to copy this to
66 sam.ldb in the "private" subdirectory of your install. For example:
67
68   cp newsam.ldb /usr/local/samba/private/sam.ldb
69
70
71 Step 5: Create a simple smb.conf
72 --------------------------------
73
74 You need to create a smb.conf file in the lib/ directory of your
75 install. The default is /usr/local/samba/lib/smb.conf. A minimal
76 smb.conf would be:
77
78   workgroup = YOURDOM
79
80   [test]
81         path = /data/test
82         read only = no
83
84 The workgroup must exactly match the --domain argument you gave to provision.pl
85
86
87 Step 6: starting Samba4
88 -----------------------
89
90 The simplest is to just run "smbd", but as a developer you may find
91 the following more useful:
92
93    smbd -i -M single -d3
94
95 that means "start smbd without messages in stdout, and running a
96 single process, with level 3 debugging". That mode of operation makes
97 debugging smbd with gdb particularly easy.
98
99 Make sure you put the bin and sbin directories from your new install
100 in your $PATH. Make sure you run the right version!
101
102
103 Step 7: testing Samba4
104 ----------------------
105
106 try these commands:
107
108       smbclient //localhost/test -Uadministrator%SOMEPASSWORD
109     or
110      ./script/tests/test_posix.sh //localhost/test administrator
111     SOMEPASSWORD
112
113 Note that to pass all the tests you would need to be using a
114 filesystem with user_xattr support. On many Linux systems with an ext3
115 filesystem this means mounting with the "-o user_xattr"
116 option. Consult your filesystem and kernel docs for more details.
117
118