siddou.tk

Install RackTables on Debian 7 Wheezy

RackTables is a nifty and robust solution for datacenter and server room asset management. It helps document hardware assets, network addresses, space in racks, networks configuration and much much more!

Install
apt-get install apache2 mysql-server php5-gd php5-common php5-mysql
wget http://heanet.dl.sourceforge.net/project/racktables/RackTables-0.20.1.tar.gz
tar xvzf RackTables-0.20.1.tar.gz
mv RackTables-0.20.1/wwwroot /var/www/racktables
touch '/var/www/racktables/inc/secret.php'
chmod 600 '/var/www/racktables/inc/secret.php'
Configure Database
mysql -uroot -p
mysql> CREATE DATABASE racktables_db CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> GRANT ALL PRIVILEGES ON racktables_db.* TO [email protected] IDENTIFIED BY 'MY_SECRET_PASSWORD'
mysql> exit

If you change racktables_db and MY_SECRET_PASSWORD values, modify in /var/www/racktables/inc/secret.php

Open Racktables

http://localhost/racktables

Configure OpenLDAP Auth

go to “Main page” -> “Configuration” -> “Permissions” edit
add: allow {$username_toto } where toto is the uid.

nano /var/www/racktables/inc/secret.php

modify those lines

#$user_auth_src = 'database';
#$require_local_account = TRUE;
$user_auth_src = 'ldap';
$require_local_account = FALSE;

$LDAP_options = array
(
        'server' => 'ldap://ip_ldap_server',
        'domain' => '',
        'search_attr' => 'uid',
        'search_dn' => 'ou=People,dc=siddou,dc=com',
 // The following credentials will be used when searching for the user's DN:
        'search_bind_rdn' => 'uid=admin,ou=Special Users,dc=siddou,dc=com',
        'search_bind_password' => 'my_password',
        'displayname_attrs' => 'displayName',
        'options' => array (LDAP_OPT_PROTOCOL_VERSION => 3),
        'use_tls' => 0,         // 0 == don't attempt, 1 == attempt, 2 == require
);
Install ldap module for php and restart apache
apt-get install php5-ldap
service apache2 restart

You can now connect with OpenLDAP user toto

Configure Active Directory Auth
nano /var/www/racktables/inc/secret.php

modify those lines

#$user_auth_src = 'database';
#$require_local_account = TRUE;
$user_auth_src = 'ldap';
$require_local_account = FALSE;

$LDAP_options = array
(
        'server' => 'ad.siddou.com',
        'domain' => 'siddou.com',
        'search_attr' => 'sAMAccountName',
        'search_dn' => 'CN=Users,DC=siddou,DC=com',
 // The following credentials will be used when searching for the user's DN:
        'search_bind_rdn' => 'CN=Administrator,CN=Users,DC=siddou,DC=com',
        'search_bind_password' => 'my_password!',
        'displayname_attrs' => 'givenname sn',
        'options' => array (LDAP_OPT_PROTOCOL_VERSION => 0),
        'use_tls' => 2,         // 0 == don't attempt, 1 == attempt, 2 == require

// LDAP cache, values in seconds. Refresh, retry and expiry values are
// treated exactly as those for DNS SOA record. Example values 300-15-600:
// unconditionally remeber successful auth for 5 minutes, after that still
// permit user access, but try to revalidate username and password on the
// server (not more often, than once in 15 seconds). After 10 minutes of
// unsuccessful retries give up and deny access, so someone goes to fix
// LDAP server.
        'cache_refresh' => 300,
       'cache_retry' => 15,
       'cache_expiry' => 600,
);

Leave a Reply

Your email address will not be published. Required fields are marked *