Docbook XML conversion: projdoc
[sfrench/samba-autobuild/.git] / docs / docbook / projdoc / UNIX_INSTALL.xml
1 <chapter id="install">
2 <chapterinfo>
3         &author.tridge;
4         &author.jelmer;
5         <author><firstname>Karl</firstname><surname>Auer</surname></author>
6         <!-- Isn't some of this written by others as well? -->
7
8 </chapterinfo>
9
10 <title>How to Install and Test SAMBA</title>
11
12 <sect1>
13         <title>Obtaining and installing samba</title>
14
15         <para>Binary packages of samba are included in almost any Linux or 
16         Unix distribution. There are also some packages available at 
17         <ulink url="http://samba.org/">the samba homepage</ulink>.
18         </para>
19
20         <para>If you need to compile samba from source, check the 
21         <link linkend="compiling">appropriate appendix chapter</link>.</para>
22 </sect1>
23
24 <sect1>
25         <title>Configuring samba</title>
26
27         <para>Samba's configuration is stored in the smb.conf file, 
28         that usually resides in <filename>/etc/samba/smb.conf</filename> 
29         or <filename>/usr/local/samba/lib/smb.conf</filename>. You can either 
30         edit this file yourself or do it using one of the many graphical 
31         tools that are available, such as the web-based interface swat, that 
32         is included with samba.</para>
33         
34 <sect2>
35         <title>Editing the <filename>smb.conf</filename> file</title>
36         
37         <para>There are sample configuration files in the examples 
38         subdirectory in the distribution. I suggest you read them 
39         carefully so you can see how the options go together in 
40         practice. See the man page for all the options.</para>
41
42         <para>The simplest useful configuration file would be 
43         something like this:</para>
44
45         <para><programlisting>
46 [global]
47         workgroup = MYGROUP
48
49 [homes]
50         guest ok = no
51         read only = no
52         </programlisting></para>
53         
54         <para>which would allow connections by anyone with an 
55         account on the server, using either their login name or 
56         "<command>homes</command>" as the service name. (Note that I also set the 
57         workgroup that Samba is part of. See BROWSING.txt for details)</para>
58         
59         <para>Make sure you put the <filename>smb.conf</filename> file in the same place 
60         you specified in the<filename>Makefile</filename> (the default is to 
61         look for it in <filename>/usr/local/samba/lib/</filename>).</para>
62
63         <para>For more information about security settings for the 
64         <command>[homes]</command> share please refer to the chapter 
65         <link linkend="securing-samba">Securing Samba</link>.</para>
66
67 <sect3>
68         <title>Test your config file with 
69         <command>testparm</command></title>
70
71         <para>It's important that you test the validity of your
72         <filename>smb.conf</filename> file using the <application>testparm</application> program. 
73         If testparm runs OK then it will list the loaded services. If 
74         not it will give an error message.</para>
75
76         <para>Make sure it runs OK and that the services look 
77         reasonable before proceeding. </para>
78
79         <para>Always run testparm again when you change 
80         <filename>smb.conf</filename>!</para>
81
82 </sect3>
83 </sect2>
84
85         <sect2>
86         <title>SWAT</title>
87
88         <para>
89         SWAT is a web-based interface that helps you configure samba. 
90         SWAT might not be available in the samba package on your platform, 
91         but in a separate package. Please read the swat manpage 
92         on compiling, installing and configuring swat from source.
93         </para>
94
95         <para>To launch SWAT just run your favorite web browser and 
96         point it at "http://localhost:901/". Replace <replaceable>localhost</replaceable> with the name of the computer you are running samba on if you 
97         are running samba on a different computer than your browser.</para>
98
99         <para>Note that you can attach to SWAT from any IP connected 
100         machine but connecting from a remote machine leaves your 
101         connection open to password sniffing as passwords will be sent 
102         in the clear over the wire. </para>
103         </sect2>
104 </sect1>
105
106 <sect1>
107         <title>Try listing the shares available on your 
108         server</title>
109
110         <para><prompt>$ </prompt><userinput>smbclient -L 
111         <replaceable>yourhostname</replaceable></userinput></para>
112
113         <para>You should get back a list of shares available on 
114         your server. If you don't then something is incorrectly setup. 
115         Note that this method can also be used to see what shares 
116         are available on other LanManager clients (such as WfWg).</para>
117
118         <para>If you choose user level security then you may find 
119         that Samba requests a password before it will list the shares. 
120         See the <command>smbclient</command> man page for details. (you 
121         can force it to list the shares without a password by
122         adding the option -U% to the command line. This will not work 
123         with non-Samba servers)</para>
124 </sect1>
125
126 <sect1>
127         <title>Try connecting with the unix client</title>
128         
129         <para><prompt>$ </prompt><userinput>smbclient <replaceable>
130         //yourhostname/aservice</replaceable></userinput></para>
131         
132         <para>Typically the <replaceable>yourhostname</replaceable> 
133         would be the name of the host where you installed &smbd;. 
134         The <replaceable>aservice</replaceable> is 
135         any service you have defined in the &smb.conf;
136         file. Try your user name if you just have a <command>[homes]</command>
137         section
138         in &smb.conf;.</para>
139
140         <para>For example if your unix host is <replaceable>bambi</replaceable>
141         and your login name is <replaceable>fred</replaceable> you would type:</para>
142
143         <para><prompt>$ </prompt><userinput>smbclient //<replaceable>bambi</replaceable>/<replaceable>fred</replaceable>
144         </userinput></para>
145 </sect1>
146
147 <sect1>
148         <title>Try connecting from a DOS, WfWg, Win9x, WinNT, 
149         Win2k, OS/2, etc... client</title>
150         
151         <para>Try mounting disks. eg:</para>
152
153         <para><prompt>C:\WINDOWS\> </prompt><userinput>net use d: \\servername\service
154         </userinput></para>
155
156         <para>Try printing. eg:</para>
157
158         <para><prompt>C:\WINDOWS\> </prompt><userinput>net use lpt1:
159         \\servername\spoolservice</userinput></para>
160
161         <para><prompt>C:\WINDOWS\> </prompt><userinput>print filename
162         </userinput></para>
163 </sect1>
164
165 <sect1>
166         <title>What If Things Don't Work?</title>
167         
168         <para>Then you might read the file chapter 
169         <link linkend="diagnosis">Diagnosis</link> and the 
170         FAQ. If you are still stuck then try to follow 
171         the <link linkend="problems">Analysing and Solving Problems chapter</link>
172         Samba has been successfully installed at thousands of sites worldwide,
173         so maybe someone else has hit your problem and has overcome it. </para>
174
175 </sect1>        
176 </chapter>