Compile and optimize

Securing and Optimizing Linux: RedHat Edition -A Hands on Guide
Prev | Chapter 31. Software -Server/File Sharing-Network | Next

# 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

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/
            [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
            [root@deep ] /source# chmod 1777 /var/spool/samba/

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

- The install command will install the script `mksmbpasswd.sh` under `/usr/bin/` directory. This script is needed to setup Samba users allowed to connect on our server via the `smbpasswd` file. See later in this documentation for how to setup and use Samba password.

- The rm command will remove the `/usr/share/swat` directory and all the files under it, and it will also remove the swat binary program under `/usr/sbin/`. The SWAT program is a web-based configuration utility that permits you to configure the `smb.conf` file of Samba via a web browser interface. Of course, in order to use the SWAT utility you will need to have a web server running, such as Apache. The SWAT utility can open a security breach on your server and for this reason I recommend that you remove and not use it.

- The mkdir command will create a `/var/spool/samba/` directory on your system for all print sharing jobs you may have. Of course this directory is only necessary if you intend to use Samba print sharing over your LAN. Since we have not configured our Samba server to use print sharing, we do not need to create this directory, `/var/spool/samba/` on our server, and we do not need to use the command chmod to change the `sticky` bit in `/var/spool/samba` so only the file's owner can delete a given file in this directory.

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.

Prev | Home | Next
Configure Samba | Up | Configurations