31.3. Compile and optimize

Type the following commands on your terminal:

        CC="egcs" \
        ./configure \
        --prefix=/usr \
        --libdir=/etc \
        --with-lockdir=/var/lock/samba \
        --with-privatedir=/etc \
        --with-swatdir=/usr/share/swat \
        --with-pam \
        --with-mmap \
        --without-sambabook
      

Caution

The option --with-mmap can give a large performance boost on some machines, while on others it makes no difference at all, and on some it may reduce performance.

This tells Samba to set itself up for this particular hardware setup with:

  1. Include PAM password database support for better security.

  2. Include experimental MMAP support to improve Samba performance.

  3. Don't install the book help that come with Samba distribution.

Now, we must install Samba in the Linux server:

        [root@deep ] /source# make all
        [root@deep ] /source# make install
        [root@deep ] /source# install -m 755 script/mksmbpasswd.sh  /usr/bin/
        [root@deep ] /source# rm -rf /usr/share/swat/      (1)
        [root@deep ] /source# rm -f  /usr/sbin/swat
        [root@deep ] /source# rm -f  /usr/man/man8/swat.8
        [root@deep ] /source# mkdir -p /var/lock/samba
        [root@deep ] /source# mkdir -p /var/spool/samba    (2)
        [root@deep ] /source# chmod 1777 /var/spool/samba/ (3)
      

(1)
If like me, you don't like to configure Samba in HTML.
(2)
Only require if you are the intention to use printer sharing.
(3)
Only require if you are the intention to use printer sharing.

Please do cleanup later:

        [root@deep ] /# cd /var/tmp
        [root@deep ]/tmp# rm -rf samba-version/ samba-version.tar.gz
      
The rm command will remove all the source files we have used to compile and install Samba. It will also remove the Samba compressed archive from the /var/tmp directory.