Build Samba 4.9 from source on Debian 9 or Ubuntu 18.04

/, VapourApps Directory/Build Samba 4.9 from source on Debian 9 or Ubuntu 18.04

Build Samba 4.9 from source on Debian 9 or Ubuntu 18.04

Samba is a great piece of software that provides Microsoft compatible active directory and filesharing.
It is included as a package in virtually all linux distros, however it is usually outdated and lacking in some critical features.
In this guide we will show you how to build Samba 4.9, mostly following the samba wiki at https://wiki.samba.org/index.php/Build_Samba_from_Source

Install needed dependencies:

For debian 9 stretch:

apt-get install acl attr autoconf bind9utils bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb libjansson-dev krb5-user libacl1-dev libaio-dev libarchive-dev libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls28-dev libgpgme11-dev libjson-perl libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev nettle-dev perl perl-modules pkg-config python-all-dev python-crypto python-dbg python-dev python-dnspython python3-dnspython python-gpgme python3-gpgme python-markdown python3-markdown python3-dev xsltproc zlib1g-dev liblmdb-dev lmdb-utils checkinstall wget

For ubuntu 18.04 bionic:

apt-get install acl attr autoconf bind9utils bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb libjansson-dev krb5-user libacl1-dev libaio-dev libarchive-dev libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls28-dev libgpgme11-dev libjson-perl libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev nettle-dev perl perl-modules pkg-config python-all-dev python-crypto python-dbg python-dev python-dnspython python3-dnspython python-gpg python3-gpg python-markdown python3-markdown python3-dev xsltproc zlib1g-dev liblmdb-dev lmdb-utils checkinstall wget

Download the tarball, unpack it and enter the folder:

wget https://download.samba.org/pub/samba/stable/samba-4.9.1.tar.gz
tar xf samba-4.9.1.tar.gz
cd samba-4.9.1

Modify the systemd service:

sed -E “/Type=notify|NotifyAccess=all/d” ./bin/default/packaging/systemd/samba.service

Run ./configure, since we will run checkinstall to create a deb package we set the directories to point at system paths instead of the default /usr/local.

./configure \
–prefix=/usr \
–enable-fhs \
–sysconfdir=/etc \
–localstatedir=/var \
–with-privatedir=/var/lib/samba/private \
–with-smbpasswd-file=/etc/samba/smbpasswd \
–with-piddir=/var/run/samba \
–with-pammodulesdir=/lib/x86_64-linux-gnu/security \
–libdir=/usr/lib/x86_64-linux-gnu \
–with-modulesdir=/usr/lib/x86_64-linux-gnu/samba \
–datadir=/usr/share \
–with-lockdir=/var/run/samba \
–with-statedir=/var/lib/samba \
–with-cachedir=/var/cache/samba \
–with-socketpath=/var/run/ctdb/ctdbd.socket \
–with-logdir=/var/log/ctdb \
–systemd-install-services

If configure passed without problems run make:
make

Next run checkinstall:

debian 9:

checkinstall –fstrans=no –requires=’acl,attr,bind9utils,bison,debhelper,dnsutils,docbook-xml,docbook-xsl,flex,gdb,krb5-user,libacl1-dev,libattr1-dev,libcups2-dev,libgnutls28-dev,libgpgme11-dev,libjson-perl,libldap2-dev,libncurses5-dev,libpam0g-dev,libparse-yapp-perl,perl,perl-modules,python-crypto,python-dbg,python-dnspython,python3-dnspython,python-gpgme,python3-gpgme,python-markdown,python3-markdown,xsltproc,lmdb-utils’ -y

ubuntu 18.04:

checkinstall –requires=’acl,attr,bind9utils,bison,debhelper,dnsutils,docbook-xml,docbook-xsl,flex,gdb,krb5-user,libacl1-dev,libattr1-dev,libcups2-dev,libgnutls28-dev,libgpgme11-dev,libjson-perl,libldap2-dev,libncurses5-dev,libpam0g-dev,libparse-yapp-perl,perl,perl-modules,python-crypto,python-dbg,python-dnspython,python3-dnspython,python-gpg,python3-gpg,python-markdown,python3-markdown,xsltproc,lmdb-utils’ -y

After you have successfully compiled, built and installed samba as Active Directory service, you can use samba-tool to create users and join the computers to the domain which you provisioned. The samba server is a DNS server as well, so to join a computer to the domain, you must make the samba server his primary DNS server as well.

You can also install and provision samba server with a single click, using the VapourApps dashboard and launching the Directory app. VapourApps is open source and free to download and install.

By |2018-11-07T09:16:49+00:00October 31st, 2018|Private Cloud, VapourApps Directory|Comments Off on Build Samba 4.9 from source on Debian 9 or Ubuntu 18.04

About the Author: