DRLM Installation

The pourpose of this manual is explain, step by step, the installation and configuration of DRLM. At the end of this guide you should have a fully functional DRLM server.

Debian 8

Note

On the following steps, is assumed you have a minimal installation of Debian 8.

Install requirements

$ apt-get install openssh-client openssl netcat-traditional wget gzip tar gawk sed grep coreutils util-linux nfs-kernel-server rpcbind isc-dhcp-server tftpd-hpa syslinux apache2 qemu-utils sqlite3

Get DRLM

You can obtain the DRLM package building it from the source code or downloading from www.drlm.org website

Build DEB package from Source

$ aptitude install git build-essential debhelper
$ git clone https://github.com/brainupdaters/drlm
$ cd drlm
$ make deb

Download DEB package From DRLM Web

$ wget http://www.drlm.org/downloads/drlm_2.0.0_all.deb

Install DRLM package

The DEB package can be installed as follows (on Debian, Ubuntu)

Execute the next command:

$ dpkg -i drlm_2.0.0_all.deb

DRLM Components Configuration

This section covers configuration of:

  • GRUB
  • TFTP Service
  • NFS Service
  • DHCP Service
  • HTTP Service

Configuring loop limits

The default configuration allows up to eight active loop devices. If more than eight file-based guests or loop devices are needed the number of loop devices configured can be adjusted adding the parameter max_loop=1024 in the /etc/default/grub file as follows:

...

GRUB_CMDLINE_LINUX="quiet max_loop=1024" ##UPDATE THIS LINE

...
$ grub-mkconfig -o /boot/grub/grub.cfg

TFTP

You have to update the destination folder in the /etc/default/tftpd-hpa cofiguration file as follows

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/drlm/store"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

NFS

We don’t have to configure the /etc/exports file, the file is automatically maintained by DRLM.

DHCP

Same as /etc/exports file, configuration of /etc/dhcp/dhcpd.conf file is not required, the file is automatically maintained by DRLM.

HTTP

$ a2enmod ssl
$ a2enmod rewrite
$ a2enmod cgi

Edit /etc/apache2/apache2.conf file

# Include the DRLM Configuration:
Include /usr/share/drlm/conf/HTTP/https.conf
$ rm /etc/apache2/sites-enabled/*

Edit /etc/apache2/ports.conf file

#Listen 80

Restart & check services

$ systemctl restart tftpd-hpa.service
$ systemctl status tftpd-hpa.service

$ systemctl restart rpcbind.service
$ systemctl status rpcbind.service

$ systemctl restart apache2.service
$ systemctl status apache2.service

Note

DHCP and NFS servers are not running because there is no config yet! no worries they will be reloaded automatically after first DRLM client will be added.

Debian 7

Note

On the following steps, is assumed you have a minimal installation of Debian 7.

Install requirements

$ apt-get install openssh-client openssl netcat-traditional wget gzip tar gawk sed grep coreutils util-linux nfs-kernel-server rpcbind isc-dhcp-server tftpd-hpa syslinux apache2 qemu-utils sqlite3

Get DRLM

You can obtain the DRLM package building it from the source code or downloading from www.drlm.org website

Build DEB package from Source

$ aptitude install git build-essential debhelper
$ git clone https://github.com/brainupdaters/drlm
$ cd drlm
$ make deb

Download DEB package From DRLM Web

$ wget http://www.drlm.org/downloads/drlm_2.0.0_all.deb

Install DRLM package

The DEB package can be installed as follows (on Debian, Ubuntu)

Execute the next command:

$ dpkg -i drlm_2.0.0_all.deb

DRLM Components Configuration

This section covers configuration of:

  • GRUB
  • TFTP Service
  • NFS Service
  • DHCP Service
  • HTTP Service

Configuring loop limits

The default configuration allows up to eight active loop devices. If more than eight file-based guests or loop devices are needed the number of loop devices configured can be adjusted adding the parameter max_loop=1024 in the /etc/default/grub file as follows:

...

GRUB_CMDLINE_LINUX="quiet max_loop=1024" ##UPDATE THIS LINE

...
$ grub-mkconfig -o /boot/grub/grub.cfg

TFTP

You have to update the destination folder in the /etc/default/tftpd-hpa cofiguration file as follows

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/drlm/store"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

NFS

We don’t have to configure the /etc/exports file, the file is automatically maintained by DRLM.

DHCP

Same as /etc/exports file, configuration of /etc/dhcp/dhcpd.conf file is not required, the file is automatically maintained by DRLM.

HTTP

$ a2enmod ssl
$ a2enmod rewrite
$ a2enmod cgi

Edit /etc/apache2/apache2.conf file

# Include the DRLM Configuration:
Include /usr/share/drlm/conf/HTTP/https.conf
$ rm /etc/apache2/sites-enabled/*

Edit /etc/apache2/ports.conf file

#NameVirtualHost *:80
#Listen 80

Restart & check services

$ service tfrpd-hpa restart
$ service tftpd-hpa status
in.tftpd is running.
$ service rpcbind restart
$ service rpcbind status
rpcbind is running.
$ service apache2 restart
$ service apache2 status
Apache2 is running (pid 2023).

Note

DHCP and NFS servers are not running because there is no config yet! no worries they will be reloaded automatically after first DRLM client will be added.

CentOS 7, Red Hat 7

Note

On the following steps, is assumed you have a minimal installation of CentOS 7.

Warning

selinux has been disabled

$ cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
$ setenforce 0

Note

It is not a requirement to disable SELinux, but to work with DRLM Server must be properly configured. We have disabled this feature for easier installation.

Install requirements

$  yum -y install openssh-clients openssl nc wget gzip tar gawk sed grep coreutils util-linux rpcbind dhcp tftp-server syslinux httpd xinetd nfs-utils nfs4-acl-tools mod_ssl qemu-img sqlite

Get DRLM

Build RPM package from Source

$ yum install git rpm-build
$ git clone https://github.com/brainupdaters/drlm
$ cd drlm
$ make rpm

Download RPM package From DRLM Web

$ wget http://www.drlm.org/downloads/drlm-2.0.0-1git.el6.noarch.rpm

Install DRLM package

The RPM package can be installed as follows (on Redhat, CentOS)

Execute the next command:

$ rpm -ivh drlm-2.0.0-1git.el7.centos.noarch.rpm

DRLM Components Configuration

This section covers configuration of:

  • GRUB
  • TFTP Service
  • NFS Service
  • DHCP Service
  • HTTP Service

Configuring loop limits

The default configuration allows up to eight active loop devices. If more than eight file-based guests or loop devices are needed the number of loop devices configured can be adjusted adding the parameter max_loop=1024 in the /etc/default/grub file as follows:

...

GRUB_CMDLINE_LINUX="......... max_loop=1024" ##UPDATE THIS LINE ADDING MAX_LOOP=1024 PARAMETER

...
$ grub2-mkconfig -o /boot/grub2/grub.cfg

TFTP

You have to update the /etc/xinetd.d/tftp cofiguration file as follows:

service tftp
{
        socket_type = dgram
        protocol = udp
        wait = yes
        user = root
        server = /usr/sbin/in.tftpd
        server_args = -s /var/lib/drlm/store
        disable = no
        per_source = 11
        cps = 100 2
        flags = IPv4
}

NFS

We don’t have to configure the /etc/exports file, the file is automatically maintained by DRLM.

DHCP

Same as /etc/exports file, configuration of /etc/dhcp/dhcpd.conf file is not required, the file is automatically maintained by DRLM.

HTTP

Disable the default Virtual Host and configure the server to work with SSL.

We have to edit de /etc/httpd/conf.d/ssl.conf, comment or delete the Virtual host and include the DRLM http default configuration at the end of it.

Coment from here --->
##
## SSL Virtual Host Context
##


     At the end of the file and insert:
# Include the DRLM Configuration:
Include /usr/share/drlm/conf/HTTP/https.conf

Then we have to coment the 80 port service commenting or deleting the next lines in /etc/httpd/conf/httpd.conf file.

#Listen 80

#ServerAdmin root@localhost

#DocumentRoot "/var/www/html"

#<Directory />
#    Options FollowSymLinks
#    AllowOverride None
#</Directory>

#<Directory "/var/www/html">
#    Options Indexes FollowSymLinks
#    AllowOverride None
#    Order allow,deny
#    Allow from all
#</Directory>

#ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#<Directory "/var/www/cgi-bin">
#    AllowOverride None
#    Options None
#    Order allow,deny
#    Allow from all
#</Directory>

To finish we have to comment the ErrorLog and CustomLog lines in /usr/share/drlm/conf/HTTP/https.conf file.

#       ErrorLog ${APACHE_LOG_DIR}/error.log

#       CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

Restart & check services

$ systemctl enable xinetd.service
$ systemctl restart xinetd.service

$ systemctl enable rpcbind.service
$ systemctl restart rpcbind.service

$ systemctl enable httpd.service
$ systemctl restart httpd.service

Note

DHCP and NFS servers are not running because there is no config yet! no worries they will be reloaded automatically after first DRLM client will be added.

CentOS 6, Red Hat 6

Note

On the following steps, is assumed you have a minimal installation of CentOS 6 or Red Hat 6.

Warning

iptables and selinux has been disabled

$ cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
$ setenforce 0

Note

It is not a requirement to disable SELinux and IPTABLES, but to work with DRLM Server must be properly configured. We have disabled these features for easier installation.

IPTABLES

$ chkconfig iptables off
$ service iptables stop

Install requirements

$  yum -y install openssh-clients openssl nc wget gzip tar gawk sed grep coreutils util-linux rpcbind dhcp tftp-server syslinux httpd xinetd nfs-utils nfs4-acl-tools mod_ssl qemu-img sqlite

Get DRLM

Build RPM package from Source

$ yum install git rpm-build
$ git clone https://github.com/brainupdaters/drlm
$ cd drlm
$ make rpm

Download RPM package From DRLM Web

$ wget http://www.drlm.org/downloads/drlm-2.0.0-1git.el6.noarch.rpm

Install DRLM package

The RPM package can be installed as follows (on Redhat, CentOS)

Execute the next command:

$ rpm -ivh drlm-1.1.3-1git.el6.noarch.rpm

DRLM Components Configuration

This section covers configuration of:

  • GRUB
  • TFTP Service
  • NFS Service
  • DHCP Service
  • HTTP Service

Configuring loop limits

The default configuration allows up to eight active loop devices. If more than eight clients are needed, the number of loop devices configured can be adjusted adding the parameter max_loop=1024 in the /etc/grub.conf file as follows:

title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/vgroot-lvroot rd_NO_LUKS LANG=en_US.UTF-8  KEYBOARDTYPE=pc KEYTABLE=es rd_NO_MD rd_LVM_LV=vgroot/lvswap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vgroot/lvroot rd_NO_DM rhgb quiet max_loop=1024
initrd /initramfs-2.6.32-358.el6.x86_64.img

TFTP

You have to update the /etc/xinetd.d/tftp cofiguration file as follows:

service tftp
{
        socket_type = dgram
        protocol = udp
        wait = yes
        user = root
        server = /usr/sbin/in.tftpd
        server_args = -s /var/lib/drlm/store
        disable = no
        per_source = 11
        cps = 100 2
        flags = IPv4
}

NFS

We don’t have to configure the /etc/exports file, the file is automatically maintained by DRLM.

DHCP

Same as /etc/exports file, configuration of /etc/dhcp/dhcpd.conf file is not required, the file is automatically maintained by DRLM.

HTTP

Disable the default Virtual Host and configure the server to work with SSL.

We have to edit de /etc/httpd/conf.d/ssl.conf, comment or delete the Virtual host and include the DRLM http default configuration at the end of it.

Coment from here --->
##
## SSL Virtual Host Context
##


     At the end of the file and insert:
# Include the DRLM Configuration:
Include /usr/share/drlm/conf/HTTP/https.conf

Then we have to coment the 80 port service commenting or deleting the next lines in /etc/httpd/conf/httpd.conf file.

#Listen 80

#ServerAdmin root@localhost

#DocumentRoot "/var/www/html"

#<Directory />
#    Options FollowSymLinks
#    AllowOverride None
#</Directory>

#<Directory "/var/www/html">
#    Options Indexes FollowSymLinks
#    AllowOverride None
#    Order allow,deny
#    Allow from all
#</Directory>

#ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#<Directory "/var/www/cgi-bin">
#    AllowOverride None
#    Options None
#    Order allow,deny
#    Allow from all
#</Directory>

To finish we have to comment the ErrorLog and CustomLog lines in /usr/share/drlm/conf/HTTP/https.conf file.

#       ErrorLog ${APACHE_LOG_DIR}/error.log

#       CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

Restart & check services

$ service xinetd restart
$ service xinetd status
xinetd (pid  5307) is running...
$ service rpcbind restart
$ service rpcbind status
rpcbind (pid  5097) is running...
$ service httpd restart
$ service httpd status
httpd (pid  5413) is running...

Note

DHCP and NFS servers are not running because there is no config yet! no worries they will be reloaded automatically after first DRLM client will be added.