2.3 Configuring Samba

   

Samba automatically configures itself prior to compilation. This reduces the likelihood of a machine-specific problem, but you might end up wishing for an option after Samba has been installed.

The source distribution of Samba 2.2 and above doesn't initially have a makefile. Instead, one is generated through a GNU configure script, which is located in the samba-2.2.x /source/ directory. The configure script takes care of the machine-specific issues of building Samba.

Before running the configure script, it is important that you become the root user on the system. Otherwise, you might get a warning such as:

 configure: warning: running as non-root will disable some tests 

You don't want any test to be disabled when the Samba makefile is being created; it would leave the potential for errors down the road when compiling or running Samba on your system.

When the configure script is run, it prints out messages telling what it is doing, and error messages might be mixed in. To make sure you see those very important error messages, we suggest you run configure with its standard output passed through some filter to capture the output and keep it from scrolling out of sight. One method is using the more command:

 #  ./configure  more  

We will show you another in a moment.

Although you can run configure as previously with no options, you might want to add support for extra features by passing options on the command line. For example:

 #  ./configure --with-winbind  

will configure the Samba makefile with support for winbind authentication. If you would like a complete list of options, type the following:

 #  ./configure --help  

Each option enables or disables various features. You typically enable a feature by specifying the -- with- feature option, which will cause the feature to be compiled and installed. Likewise, if you specify a --without- feature option, the feature will be disabled. A full list of configuration options is provided in Appendix E, but for now we want to point out three of them, which are features we cover later in this book:

--with- msdfs

Include support for Microsoft Distributed filesystem (Dfs), which allows dispersed network resources to be clumped together into one easy-to-navigate directory tree. See Chapter 8.

--with-smbwrapper

Include SMB wrapper support, which allows programs running on the Unix host to access SMB shared folders as if they were Unix filesystems. We recommend using this option. See Chapter 5.

--with- smbmount

Include smbmount support, which allows SMB shared folders to be mounted in the Unix filesystem. At the time of this writing, support for this feature exists only for Linux. This is also covered in Chapter 5.

Each option is disabled by default, and none of the features is essential to Samba. However, you may want to include them in your configuration (as we will in our example) at least to be able to try out the options in later chapters.

In addition, Table 2-1 shows some other parameters that you can give the configure script if you wish to store parts of the Samba distribution in different places, perhaps to make use of multiple disks or partitions. Note that the defaults sometimes refer to a prefix specified earlier in the table.

Table 2-1. Additional configure options

Option

Meaning

Default

--prefix = directory

Install architecture-independent files at the base directory specified.

/usr/local/samba

--eprefix = directory

Install architecture-dependent files at the base directory specified.

/usr/local/samba

--bindir = directory

Install user executables in the directory specified.

eprefix /bin

--sbindir = directory

Install administrator executables in the directory specified.

eprefix /bin

--libexecdir = directory

Install program executables in the directory specified.

eprefix /libexec

--datadir = directory

Install read-only architecture-independent data in the directory specified.

prefix /share

--libdir = directory

Install program libraries in the directory specified.

eprefix /lib

--includedir = directory

Install package-include files in the directory specified.

prefix /include

--infodir = directory

Install additional information files in the directory specified.

prefix / info

--mandir = directory

Install manual pages in the directory specified.

prefix /man

Here is a sample execution of the configure script, which creates a Samba 2.2.6 makefile for the Linux platform. Note that you must run the configure script in the source directory and that we are showing you yet another way to capture the output of the script:

 $  cd samba-2.2.6/source/  $  su  Password: #  ./configure --with-smbwrapper --with-smbmount \   --with-msdfs --with-syslog --with-utmp 2>&1  tee config.my.log  loading cache ./config.cache checking for gcc... (cached) gcc checking whether the C compiler (gcc -O ) works... yes checking whether the C compiler (gcc -O ) is a cross-compiler... no checking whether we are using GNU C... (cached) yes checking whether gcc accepts -g... (cached) yes checking for a BSD-compatible install... (cached) /usr/bin/install -c  ...(content omitted)...  checking configure summary configure OK creating ./config.status creating include/stamp-h creating Makefile creating include/config.h 

In general, any message from configure that doesn't begin with the words checking or creating is an error; it often helps to redirect the output of the configure script to a file so that you can quickly search for errors, as we did with the tee command earlier. If there was an error during configuration, more detailed information about it can be found in the config.log file, which is written to the local directory by the configure script, as well as in the config.my.log file, which we created by piping through the tee command. These files are very similar in both name and content, but be careful to check both of them for error messages before continuing!

If the configuration works, you'll see a checking configure summary message followed by a configure OK message and four or five file-creation messages. So far, so good.

   


Using Samba
Using Samba: A File and Print Server for Linux, Unix & Mac OS X, 3rd Edition
ISBN: 0596007698
EAN: 2147483647
Year: 2003
Pages: 475

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net