Quantcast
Channel: Syed Jahanzaib – Personal Blog to Share Knowledge !
Viewing all articles
Browse latest Browse all 409

DMASOFTLAB Radius Manager: Install + Backup + Restore [Short Reference Guide]

$
0
0

Ubuntu

dmalogo

Following is a short reference guide for DMASOFTLAB Radius Manager

Part-  1)         Installation Of RM with some TIPS,
Part- 2)         Complete Backup for RM and RM DB,
Part- 3)         Restore RM Data to new Installation.

.

.

Part-1 # Installation of Radius Manager 4.x on Ubuntu 10.4

DMASOFTLAB Radius Manager 4.0 Short reference manual guide for UBUNTU 10.4

After you have installed Ubuntu, configure IP address and enable internet access on it.

Now open Terminal Window and issue the below command to install required Modules.

apt-get install mc wget rcconf make gcc mysql-server mysql-client libmysqlclient15-dev libperl-dev curl php5 php5-mysql php5-cli php5-curl php5-mcrypt php5-gd php5-snmp

wget http://www.dmasoftlab.com/cont/download/libltdl3_1.5.24-1ubuntu1_i386.deb

wget http://www.dmasoftlab.com/cont/download/libltdl3-dev_1.5.24-1ubuntu1_i386.deb


dpkg -i libltdl3_1.5.24-1ubuntu1_i386.deb


dpkg -i libltdl3-dev_1.5.24-1ubuntu1_i386.deb

IONCUBE Installation:

First Download ioncube library

wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86.tar.gz
Untar it in any temp folder for example /temp/ioncube

tar zxvf ioncube_loaders_lin_x86.tar.gz

Create new folder for ioncube in usr/local

mkdir /usr/local/ioncube

and copy the whole folder in /usr/local

Now Add the appropriate ionCube loader to your php.ini
For example
Add this line on top

zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so

in following files.
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini

Installation procedure of FreeRadius
==============================

wget http://www.dmasoftlab.com/cont/download/freeradius-server-2.1.8-dmamod-3.tar.gz

tar zxvf freeradius-server-2.1.8-dmamod-3.tar.gz


cd freeradius-server-2.1.8-dmamod-3


./configure


make


make install


ldconfig

Now test RADIUS by issuing following command:

radiusd -X

You will see something like below . . .

radius-ready

Set the correct ownership on FreeRadius configuration files
================================================

chown www-data /usr/local/etc/raddb

chown www-data /usr/local/etc/raddb/clients.conf

TIP:

Review and edit (if required) the MySQL credentials in /usr/local/etc/raddb/sql.conf (Just in case you have mentioned different password/id for mysql)

.

Creating MySQL databases with MySQL command line tool
===============================================

mysql -u root -ppassword

CREATE DATABASE radius;
CREATE DATABASE conntrack;
CREATE USER ‘radius’@'localhost’ IDENTIFIED BY ‘yourpass’;
CREATE USER ‘conntrack’@'localhost’ IDENTIFIED BY ‘yourpass’;
GRANT ALL ON radius.* TO radius@localhost;
GRANT ALL ON conntrack.* TO conntrack@localhost;
exit

 Time to Install RADIUS MANAGER 4.0.4
=================================

Copy the radius manager radiusmanager-4.0.4.tgz (or your version) in any temp folder
now extract it using

tar zxvf radiusmanager-4.0.4.tgz

cd radiusmanager-4.0.4.tgz

chmod +x install.sh


Execute the installation Script . . .

./install.sh

Now the install script will ask few questions . . . Select answers as per your local design.
For example:
Select the Operating  System
2
(For Ubuntu)

Select Installation type:
1
(New Installation)

WWW root path:
Press Enter to select the Default , which is /var/www

Radius Database host:
Press Enter to select the Default , which is localhost

Radius Database username:
Press Enter to select the Default , which is radius

Radius Database password:
Press Enter to select the Default , which is radius123

CTS Database host:
Press Enter to select the Default , which is localhost

CTS database username:
Press Enter to select the Default , which is conntrack

CTS database password:
Press Enter to select the Default , which is conn123

Freeradius UNIX User:
Press Enter to select the Default , which is root

Httpd Unix User:
Press Enter to select the Default , which is www-data

Create rmpoller service:
Press Enter to select the Default , which is y (yes)

create rmconntrack service:
Press Enter to select the Default , which is y (yes)

Backup Radius database:
Press Enter to select the Default , which is y (yes)

Now it will ask if you want to start the installation
Press y and press ENTER to continue the installation.

and at the end you will INSTALLATION COMPLETE!
As showed in the image below . . .

radius-installation-complete

Now copy the two license files (that you receive from DMASOFTLAB) in /var/www/radiusmanager

lic.txt
mode.txt

Now access the admin panel from your browser

http://yourip/radiusmanager/admin.php

.

TIPS:

.

1# :

If you see the following error while accessing admin.php

Could not connect to localhost

Make sure your passwords for radius and conntrack hosts are set correctly in

/etc/radiusmanager.cfg
/var/www/radiusmanager/config/system_cfg.php

2# :

If you see blank page while accessing admin.php , following could be wrong.
a- Your license files are not valid or expired.
b- you have not installed ioncube library correctly.

To test if your license is valid, tail the /var/log/apache2/access.log and error.log , they will show you if your license have issues like expired or invalid dueto mac address restrictions.

To test IONCUBE LIBRARY , Open Terminal and Type
php-v

& you should see something similar to below . . . (Focus on Last line that says with the ioncube php loader . . .)

root@zaib-desktop:~# php -v
PHP 5.3.2-1ubuntu4.18 with Suhosin-Patch (cli) (built: Sep 12 2012 19:33:42)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.

3# :

you are seeing ‘Incorrect user name and password error’ in mikrotik logs for the users created on RM, then make sure you have defined correct password in /etc/raddb/sql.conf (path for this file may be different like /usr/local/etc/raddb/sql.conf

.

Part-2 # Complete Backup

DMA provide its own backup script (bash script) Which creates full and differential backup. I have used it and it works really good. But since its copy righted , therefore I am not sharing it here. Just the traditional method I am posting here :) . To take full backup use the following.

Copy following Folders in any safe location:

boot
/etc
/home/root
/usr/local
/var/www
/var/lib/mysql
/var/spool/mail

Create mysql dump of database RADIUS: (which have RM User and other Data)

mysqldump -u radius -pradiuspass radius > /backup/db_full_type_current_date.sql
gzip -f /backup/db_full_type_current_date.sql

# To unzip the .gz file, use gzip -d filename.gz

.

Part-3 # Restore Backup

If somehow your server crashes, and you got to re-built it from scratch , you can restore the database using below procedure. (To simplify things, use the same OS)

1) Install OS (Same as previous one, in this example Ubuntu)
2) Install RM with the same same config you used for previous installation, e.g: radius db passwords and folders locations
3) Restore all the folders from the backup to there original locations.(backup that taken in part-2 backup part)
4) Now its time to restore mysql radius DB, use the below command to restore DB in mysql.

mysql -u root -prootpasswd radius < db_full_type_current_date.sql

Change the db_full_type_current_date.sql to match your mysql backup file.

Now restart your box once time.

If you receive ‘cannot connect to localhost’ check the passwords in

/etc/radiusmanager.cfg
/var/www/radiusmanager/config/system_cfg.ph

Also check the DB password in mysql , You can change the DB password via using this command

mysql -u root -prootpassword
use mysql;
UPDATE user SET Password=PASSWORD(“your_new_password”) WHERE User=’radius’;
UPDATE user SET Password=PASSWORD(“your_new_password”) WHERE User=’conntrack’;

Now restart your box or mysql service :)

To be continued . . .

Allah Hafiz

:)

Regard’s
Syed Jahanzaib
aacable [at] hotmail.com


Filed under: Linux Related, Radius Manager

Viewing all articles
Browse latest Browse all 409

Trending Articles