4 [Chapter
2] Installing Samba on a Unix System
</title><META NAME=
"DC.title" CONTENT=
""><META NAME=
"DC.creator" CONTENT=
""><META NAME=
"DC.publisher" CONTENT=
"O'Reilly & Associates, Inc."><META NAME=
"DC.date" CONTENT=
"1999-11-05T21:29:03Z"><META NAME=
"DC.type" CONTENT=
"Text.Monograph"><META NAME=
"DC.format" CONTENT=
"text/html" SCHEME=
"MIME"><META NAME=
"DC.source" CONTENT=
"" SCHEME=
"ISBN"><META NAME=
"DC.language" CONTENT=
"en-US"><META NAME=
"generator" CONTENT=
"Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head>
5 <BODY BGCOLOR=
"#FFFFFF" TEXT=
"#000000" link=
"#990000" vlink=
"#0000CC">
6 <table BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"0" width=
"90%">
8 <td width=
"25%" valign=
"TOP">
9 <img hspace=
10 vspace=
10 src=
"gifs/samba.s.gif"
10 alt=
"Using Samba" align=left valign=top border=
0>
12 <td height=
"105" valign=
"TOP">
16 Robert Eckstein, David Collier-Brown, Peter Kelly
17 <br>1st Edition November
1999
18 <br>1-
56592-
449-
5, Order Number:
4495
21 <p> <a href=
"http://www.oreilly.com/catalog/samba/">Buy the hardcopy
</a>
22 <p><a href=
"index.html">Table of Contents
</a>
27 <!--sample chapter begins -->
31 <TABLE WIDTH=
"515" BORDER=
"0" CELLSPACING=
"0" CELLPADDING=
"0">
33 <TD ALIGN=
"LEFT" VALIGN=
"TOP" WIDTH=
"172">
34 <A CLASS=
"sect1" HREF=
"ch01_08.html" TITLE=
"1.8 And That's Not All...">
35 <IMG SRC=
"gifs/txtpreva.gif" ALT=
"Previous: 1.8 And That's Not All..." BORDER=
"0"></a></td><TD ALIGN=
"CENTER" VALIGN=
"TOP" WIDTH=
"171">
37 <FONT FACE=
"ARIEL,HELVETICA,HELV,SANSERIF" SIZE=
"-1">
38 Chapter
2</font></b></td><TD ALIGN=
"RIGHT" VALIGN=
"TOP" WIDTH=
"172">
39 <A CLASS=
"sect1" HREF=
"ch02_02.html" TITLE=
"2.2 Configuring Samba">
40 <IMG SRC=
"gifs/txtnexta.gif" ALT=
"Next: 2.2 Configuring Samba" BORDER=
"0"></a></td></tr></table> <hr noshade size=
1></center>
43 <div class=
"samplechapter">
45 <A CLASS=
"title" NAME=
"ch02-46174">
46 2. Installing Samba on a Unix System
</a></h1><DIV CLASS=
"htmltoc">
50 <A CLASS=
"sect1" HREF=
"#ch02-85028" TITLE=
"2.1 Downloading the Samba Distribution">
51 Downloading the Samba Distribution
</a><br>
52 <A CLASS=
"sect1" HREF=
"ch02_02.html" TITLE=
"2.2 Configuring Samba">
53 Configuring Samba
</a><br>
54 <A CLASS=
"sect1" HREF=
"ch02_03.html" TITLE=
"2.3 Compiling and Installing Samba">
55 Compiling and Installing Samba
</a><br>
56 <A CLASS=
"sect1" HREF=
"ch02_04.html" TITLE=
"2.4 A Basic Samba Configuration File">
57 A Basic Samba Configuration File
</a><br>
58 <A CLASS=
"sect1" HREF=
"ch02_05.html" TITLE=
"2.5 Starting the Samba Daemons">
59 Starting the Samba Daemons
</a><br>
60 <A CLASS=
"sect1" HREF=
"ch02_06.html" TITLE=
"2.6 Testing the Samba Daemons">
61 Testing the Samba Daemons
</a></p><P>
62 </p></div><P CLASS=
"para">Now that you know what Samba can do for you and your users, it's time to get your own network set up. Let's start with the installation of Samba itself on a Unix system. When dancing the samba, one learns by taking small steps. It's just the same when installing Samba; we need to teach it step by step. This chapter will help you to start off on the right foot.
</p><P CLASS=
"para">
63 For illustrative purposes, we will be installing the
2.0.4 version of the Samba server on a Linux[
<A CLASS=
"footnote" HREF=
"#ch02-pgfId-939741">1</a>] system running version
2.0.31 of the kernel. However, the installation steps are the same for all of the platforms that Samba supports. A typical installation will take about an hour to complete, including downloading the source files and compiling them, setting up the configuration files, and testing the server.
</p><BLOCKQUOTE CLASS=
"footnote">
64 <DIV CLASS=
"footnote">
66 <A CLASS=
"footnote" NAME=
"ch02-pgfId-939741">[
1]
</a> If you haven't heard of Linux yet, then you're in for a treat. Linux is a freely distributed Unix-like operating system that runs on the Intel x86, Motorola PowerPC, and Sun Sparc platforms. The operating system is relatively easy to configure, extremely robust, and is gaining in popularity. You can get more information on the Linux operating system at
<a href=
"http://www.linux.org/"><EM CLASS=
"emphasis">http://www.linux.org/
</a></em>.
</p></div></blockquote><P CLASS=
"para">Here is an overview of the steps:
</p><OL CLASS=
"orderedlist">
69 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938543">
70 </a>Download the source or binary files.
</p></li><LI CLASS=
"listitem">
72 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938544">
73 </a>Read the installation documentation.
</p></li><LI CLASS=
"listitem">
75 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938545">
76 </a>Configure a makefile.
</p></li><LI CLASS=
"listitem">
78 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938546">
79 </a>Compile the server code.
</p></li><LI CLASS=
"listitem">
81 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938547">
82 </a>Install the server files.
</p></li><LI CLASS=
"listitem">
84 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938548">
85 </a>Create a Samba configuration file.
</p></li><LI CLASS=
"listitem">
87 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938549">
88 </a>Test the configuration file.
</p></li><LI CLASS=
"listitem">
90 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938550">
91 </a>Start the Samba daemons.
</p></li><LI CLASS=
"listitem">
93 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938551">
94 </a>Test the Samba daemons.
</p></li></ol><DIV CLASS=
"sect1">
96 <A CLASS=
"title" NAME=
"s1"></a>
97 <A CLASS=
"title" NAME=
"ch02-85028">
98 2.1 Downloading the Samba Distribution
</a></h2><P CLASS=
"para">If you want to get started quickly, the CD-ROM packaged with this book contains both the sources and binaries of Samba that were available as this book went to print. The CD is a mirror image of the files and directories on the Samba download server:
<EM CLASS=
"emphasis">
99 ftp.samba.org
</em>.
</p><P CLASS=
"para">
100 On the other hand, if you want to download the latest version, the primary web site for the Samba software is
<A CLASS=
"systemitem.url" HREF=
"http://www.samba.org">http://www.samba.org
</a>. Once connected to this page, you'll see links to several Samba mirror sites across the world, both for the standard Samba web pages and sites devoted exclusively to downloading Samba. For the best performance, choose a site that is closest to your own geographic location.
</p><P CLASS=
"para">
101 The standard Samba web sites have Samba documentation and tutorials, mailing list archives, and the latest Samba news, as well as source and binary distributions of Samba. The download sites (sometimes called
<EM CLASS=
"emphasis">
102 FTP sites
</em>) have only the source and binary distributions. Unless you specifically want an older version of the Samba server or are going to install a binary distribution, download the latest source distribution from the closest mirror site. This distribution is always named:
</p><PRE CLASS=
"programlisting">samba-latest.tar.gz
</pre><P CLASS=
"para">
103 If you choose to use the version of Samba that is located on the CD-ROM packaged with this book, you should find the latest Samba distribution in the base directory.
</p><DIV CLASS=
"sect2">
105 <A CLASS=
"title" NAME=
"ch02-pgfId-938556">
106 2.1.1 Binary or Source?
</a></h3><P CLASS=
"para">Precompiled packages are also available for a large number of Unix platforms. These packages contain binaries for each of the Samba executables as well as the standard Samba documentation. Note that while installing a binary distribution can save you a fair amount of trouble and time, there are a couple of issues that you should keep in mind when deciding whether to use the binary or compile the source yourself:
</p><UL CLASS=
"itemizedlist">
107 <LI CLASS=
"listitem">
109 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938558">
110 </a>The binary packages can lag behind the latest version of the software by one or two (maybe more) minor releases, especially after a series of small changes and for less popular platforms. Compare the release notes for the source and binary packages to make sure that there aren't any new features that you need on your platform. This is especially true of the sources and binaries on the CD-ROM: at the time this book went to print, they were from the latest production release of Samba. However, development is ongoing, so the beta-test versions on the Internet will be newer.
</p></li><LI CLASS=
"listitem">
112 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938560">
113 </a>If you use a precompiled binary, you will need to ensure that you have the correct libraries required by the executables. On some platforms the executables are statically linked so this isn't an issue, but on modern Unix operating systems (e.g., Linux, SGI Irix, Solaris, HP-UX, etc.), libraries are often dynamically linked. This means that the binary looks for the right version of each library on your system, so you may have to install a new version of a library. The
<I CLASS=
"filename">
114 README
</i> file or
<I CLASS=
"filename">
115 makefile
</i> that accompanies the binary distribution should list any special requirements.[
<A CLASS=
"footnote" HREF=
"#ch02-pgfId-943622">2</a>]
</p><BLOCKQUOTE CLASS=
"footnote">
116 <DIV CLASS=
"footnote">
118 <A CLASS=
"footnote" NAME=
"ch02-pgfId-943622">[
2]
</a> This is especially true with programs that use
<EM CLASS=
"emphasis">
119 glibc-
2.1</em> (which comes standard with Red Hat Linux
6). This library caused quite a consternation in the development community when it was released because it was incompatable with previous versions of
<EM CLASS=
"emphasis">g
</em><I CLASS=
"filename">libc
</i>.
</p></div></blockquote><P CLASS=
"para">Many machines with shared libraries come with a nifty tool called
<EM CLASS=
"emphasis">ldd
</em>. This tool will tell you which libraries a specific binary requires and which libraries on the system satisfy that requirement. For example, checking the
<EM CLASS=
"emphasis">
120 smbd
</em> program on our test machine gave us:
</p></li></ul><PRE CLASS=
"programlisting"><B CLASS=
"emphasis.bold"><CODE CLASS=
"literal">$
</code> ldd smbd
</b>
121 </pre><PRE CLASS=
"programlisting">
122 libreadline.so
.3 =
> /usr/lib/libreadline.so
.3
123 libdl.so
.2 =
> /lib/libdl.so
.2
124 libcrypt.so
.1 =
> /lib/libcrypt.so
.1
125 libc.so
.6 =
> /lib/libc.so
.6
126 libtermcap.so
.2 =
> /lib/libtermcap.so
.2
127 /lib/ld-linux.so
.2 =
> /lib/ld-linux.so
.2</pre><UL CLASS=
"itemizedlist">
128 <LI CLASS=
"listitem">
130 If there are any incompatibilities between Samba and specific libraries on your machine, the distribution-specific documentation should highlight those.
</p></li><LI CLASS=
"listitem">
132 <A CLASS=
"listitem" NAME=
"ch02-pgfId-938567">
133 </a>Keep in mind that each binary distribution carries preset values about the target platform, such as default directories and configuration option values. Again, check the documentation and the makefile included in the source directory to see which directives and variables were used when the binary was compiled. In some cases, these will not be appropriate for your situation.
</p><P CLASS=
"para">
134 A few configuration items can be reset with command-line options at runtime instead of at compile time. For example, if your binary tries to place any log, lock, or status files in the
"wrong" place (for example, in
<I CLASS=
"filename">
135 /usr/local
</i>), you can override this without recompiling.
</p></li></ul><P CLASS=
"para">
136 One point worth mentioning is that the Samba source requires an ANSI C compiler. If you are on a platform with a non-ANSI compiler, such as the
<EM CLASS=
"emphasis">
137 cc
</em> compiler on SunOS version
4, you'll have to install an ANSI-compliant compiler such as
<EM CLASS=
"emphasis">
138 gcc
</em>before you do anything else.[
<A CLASS=
"footnote" HREF=
"#ch02-pgfId-939049">3</a>] If installing a compiler isn't something you want to wrestle with, you can start off with a binary package. However, for the most flexibility and compatibility on your system, we always recommend compiling from the latest source.
</p><BLOCKQUOTE CLASS=
"footnote">
139 <DIV CLASS=
"footnote">
141 <A CLASS=
"footnote" NAME=
"ch02-pgfId-939049">[
3]
</a> <EM CLASS=
"emphasis">
142 gcc
</em> binaries are available for almost every modern machine. See
<A CLASS=
"systemitem.url" HREF=
"http://www.gnu.org/">
143 http://www.gnu.org/
</a> for a list of sites with
<EM CLASS=
"emphasis">
144 gcc
</em> and other GNU software.
</p></div></blockquote></div><DIV CLASS=
"sect2">
146 <A CLASS=
"title" NAME=
"ch02-pgfId-938574">
147 2.1.2 Read the Documentation
</a></h3><P CLASS=
"para">This sounds like an obvious thing to say, but there have probably been times where you have uncompressed a package, blindly typed
<CODE CLASS=
"literal">
148 configure
</code>,
<CODE CLASS=
"literal">
149 make
</code>, and
<CODE CLASS=
"literal">
150 make
</code> <CODE CLASS=
"literal">
151 install
</code>, and walked away to get another cup of coffee. We'll be the first to admit that we do that, many more times than we should. It's a bad idea
- especially when planning a network with Samba.
</p><P CLASS=
"para">
152 Samba
2.0 automatically configures itself prior to compilation. This reduces the likelihood of a machine-specific problem, but there may be an option mentioned in the
<I CLASS=
"filename">
153 README
</i> file that you end up wishing for after Samba's been installed. With both source and binary packages you'll find a large number of documents in the
<I CLASS=
"filename">
154 docs
</i> directory, in a variety of formats. The most important files to look at in the distribution are:
</p><PRE CLASS=
"programlisting">
156 docs/textdocs/UNIX_INSTALL.txt
</pre><P CLASS=
"para">
157 These files tell you what features you can expect in your Samba distribution, and will highlight common installation problems that you're likely to face. Be sure to look over both of them before you start the compilation process.
</p></div></div></div></blockquote>
160 <hr noshade size=
1><TABLE WIDTH=
"515" BORDER=
"0" CELLSPACING=
"0" CELLPADDING=
"0">
162 <TD ALIGN=
"LEFT" VALIGN=
"TOP" WIDTH=
"172">
163 <A CLASS=
"sect1" HREF=
"ch01_08.html" TITLE=
"1.8 And That's Not All...">
164 <IMG SRC=
"gifs/txtpreva.gif" ALT=
"Previous: 1.8 And That's Not All..." BORDER=
"0"></a></td><TD ALIGN=
"CENTER" VALIGN=
"TOP" WIDTH=
"171">
165 <A CLASS=
"book" HREF=
"index.html" TITLE=
"">
166 <IMG SRC=
"gifs/txthome.gif" ALT=
"" BORDER=
"0"></a></td><TD ALIGN=
"RIGHT" VALIGN=
"TOP" WIDTH=
"172">
167 <A CLASS=
"sect1" HREF=
"ch02_02.html" TITLE=
"2.2 Configuring Samba">
168 <IMG SRC=
"gifs/txtnexta.gif" ALT=
"Next: 2.2 Configuring Samba" BORDER=
"0"></a></td></tr><TR>
169 <TD ALIGN=
"LEFT" VALIGN=
"TOP" WIDTH=
"172">
170 1.8 And That's Not All...
</td><TD ALIGN=
"CENTER" VALIGN=
"TOP" WIDTH=
"171">
171 <A CLASS=
"index" HREF=
"inx.html" TITLE=
"Book Index">
172 <IMG SRC=
"gifs/index.gif" ALT=
"Book Index" BORDER=
"0"></a></td><TD ALIGN=
"RIGHT" VALIGN=
"TOP" WIDTH=
"172">
173 2.2 Configuring Samba
</td></tr></table><hr noshade size=
1></center>
176 <!-- End of sample chapter -->
178 <FONT SIZE=
"1" FACE=
"Verdana, Arial, Helvetica">
179 <A HREF=
"http://www.oreilly.com/">
180 <B>O'Reilly Home
</B></A> <B> |
</B>
181 <A HREF=
"http://www.oreilly.com/sales/bookstores">
182 <B>O'Reilly Bookstores
</B></A> <B> |
</B>
183 <A HREF=
"http://www.oreilly.com/order_new/">
184 <B>How to Order
</B></A> <B> |
</B>
185 <A HREF=
"http://www.oreilly.com/oreilly/contact.html">
186 <B>O'Reilly Contacts
<BR></B></A>
187 <A HREF=
"http://www.oreilly.com/international/">
188 <B>International
</B></A> <B> |
</B>
189 <A HREF=
"http://www.oreilly.com/oreilly/about.html">
190 <B>About O'Reilly
</B></A> <B> |
</B>
191 <A HREF=
"http://www.oreilly.com/affiliates.html">
192 <B>Affiliated Companies
</B></A><p>
193 <EM>© 1999, O'Reilly
& Associates, Inc.
</EM>