How to install Radius Manager 4 in CentOS 7

Install Radius Manager 4 in CentOS 7 

DMA Radius Manager billing system
Overview
DMA Radius Manager is a easy to use administration system for Mikrotik, Cisco, StarOS, Chillispot, DD-WRT, pfSense NAS devices and DOCSIS CMTS. It provides centralized authentication, accounting and billing functions.
Feature overview:
  • RADIUS and DOCSIS account support
  • Traffic accounting (RADIUS)
  • Prepaid and postpaid billinginvoicing
  • Linux mailbox account synchronization
  • Supporting multiple NASCMTS and AP devices
  • Payment tracking
  • Financial reports
  • Prepaid card system
  • Instant Access Service system (IAS)
  • Online payment gateway support (PayPal etc.)
  • Connection Tracking System (CTS)
  • Wireless and DOCSIS signal monitoring
  • Account self registration option
  • Automatic expired account disconnection (RADIUS, DOCSIS)
Initial Prerequisites:
Update: Some users are facing yum repo issues after installing epel. To solve that:
1. nano /etc/yum.repos.d/epel.repo
2. Replace https with http.
3. Save and exit.
4. yum repolist. Verify installation is successful.
4. Issue yum update

 Steps to install Radius Manager 4 in CentOS 7

  1. After you clean install CentOS 7 with proper NIC MAC Address configured, install nano for editing the configuration files.
yum install update
yum install nano
  1. Disable SELinux by editing the following and changing SELINUX=disabled

nano /etc/sysconfig/selinux
3. Stop and disable CentOS 7 firewall. If you want to use firewall then you need proper configuration for allowing radius requests and reply messages.
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
4. Install EPEL Repo.
5.Install all other dependencies.
yum install mc wget crontabs make gcc libtool-ltdl curl mysql-devel net-snmp net-snmp-utils php php-mysql php-gd php-snmp php-process ntp sendmail sendmail-cf alpine mutt mariadb-server mariadb php-mcrypt cronie wget phpmyadmin net-tools psmisc
6.Install libraries
yum install glibc.i686 libgcc_s.so.1
7.Start and configure MariaDB (replacement from MySQL) services.
systemctl start mariadb.service
 systemctl enable mariadb.service
 mysql_secure_installation
8.Start httpd.
systemctl start httpd.service
 systemctl enable httpd.service
9.Allow phpmyadmin access.
nano /etc/httpd/conf.d/phpMyAdmin.conf




After That
============

Comment out the <Directory “/usr/share/phpmyadmin”> stanza using ‘#’
Then add:
<Directory /usr/share/phpMyAdmin/>
Options none
AllowOverride Limit
Require all granted
</Directory>
Save and exit


10.Change authentication of phpmyadmin.
nano /etc/phpMyAdmin/config.inc.php
After That
change the authentication in phpMyAdmin from cookie to http – $cfg[‘Servers’][$i][‘auth_type’] = ‘http’;
11.Check php version.
php -v
12.Download ioncube loaders.
13.Extract the ioncube package.
tar -xvzf ioncube_loaders_lin_x86-64.tar.gz
14.Move in to the ioncube directory and copy the loader based on your php version to the required php modules folder and assign a permission of 777 to the ioncube file.
cd ioncube
mv ioncube_loader_lin_5.4.so  /usr/lib64/php/modules/
chmod 777 /usr/lib64/php/modules/ioncube_loader_lin_5.4.so
15.Find the location of your php.ini file.
php -i | grep "Loaded Configuration File"
16.Edit and add ioncube loader location in the PHP configuration file.
nano /etc/php.ini
 Add after [PHP]:
 zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.4.so

17.Restart httpd service.
service httpd restart
18.Check and verify ioncube installation.
php -v
19.Download & install Free Radius.
wget http://www.dmasoftlab.com/cont/download/freeradius-server-2.2.0-dma-patch-2.tar.gz
tar -xvzf freeradius-server-2.2.0-dma-patch-2.tar.gz
cd freeradius-server-2.2.0
./configure
make 
make install
20.Verify freeradius installation by issuing:
radiusd -X
It may fail first time. Issue again, then you will get a message Ready to process.
21 .In case you need to kill the above process find the process id and then issue kill command specifying the process id.
ps ax | grep radius --> Note the pid
kill [pid]
22. Move into MariaDB and create the required DB, users etc.
mysql -u root -p
CREATE DATABASE radius;
CREATE DATABASE conntrack;
CREATE USER 'radius'@'localhost' IDENTIFIED BY 'radius123';
CREATE USER 'conntrack'@'localhost' IDENTIFIED BY 'conn123';
GRANT ALL ON radius.* TO radius@localhost;
GRANT ALL ON conntrack.* TO conntrack@localhost;
23. Download and install radius manager 4.1.6 & proceed to install license files. Change the file locations.
wget https://dl.dropboxusercontent.com/u/xxxxx/radiusmanager-4.1.6.tar
tar -xvf radiusmanager-4.1.6.tar
cd radiusmanager-4.1.6
chmod 755 install.sh
./install.sh
cd /var/www/html/radiusmanager
wget https://dl.dropboxusercontent.com/u/xxxxx/mod.txt
wget https://dl.dropboxusercontent.com/u/xxxxx/lic.txt
24 .Open your browser and go to:http://192.168.0.220/radiusmanager/admin.php
25.  Installation is successful and you can now login.
Defaut Username – admin, and Password – 1111 (FOR Administrator Login)
Default User – User, and Password – 1111 (FOR User Login)

26. In case you get blank page, here are the possibilities:
(a) Php memory limit.
(b) Invalid license files.
(c) Permission error for ioncube loaders.
(d) Incompatible ioncube loaders.
27. Apache error log is located @ /etc/httpd/logs/error_log
Apache access log is located @ /etc/httpd/logs/access_log
Check those files for probable errors.

 

 

How to install Radius Manager 4 in Ubuntu Server 13.04 [With Video]

Inspired from Mr. Syed Jahanzaib’s blog, I also tried and installed Radius Manager 4.04 successfully in my Ubuntu Server 13.04. Here I provide you with a step by step working of the installations along with a video tutorial for better understanding and clarity.

For your reference, I have also attached the original Radius Manager Installation Manual and User Manual.

Radius Manager 4.04 Installation Manual & User Manual : Download

First of all you need proper license file for running radius manager. Since this is a commercial software,we’ll be using a trial license for the demonstration./

How to find your MAC address for your Ubuntu Server 13.04?

  1. SSH into your Server
  2. Type : ifconfig
    MAC
  3. The interfaces along with their respective MAC address will be shown. Note them down as you need them in the next stage.

How to get License files – lic.txt and mod.txt for radius manager 4?

  1. Email to support@dmasoftlab.com requesting for Radius Manager Trial
  2. They will reply you asking you to send your personal informations like First Name, Last Name, Business Email, Address etc.
    [Note : You must use your business email only. Gmail, Yahoo etc will not work]
  3. Then they will mail you the Customer ID and an auto generated password.
  4. Then login using your credentials @ https://customers.dmasoftlab.com
  5. Then under my softwares click Radius Manager.
  6. In type of license Click Trial -> Give the MAC address of the PC in which you want to install Radius Manager -> Tick Terms -> Submit.
  7. Then under license keys, you will see the MAC and generated lic.txt and mod.txt files. Download them in your PC.

How to install Radius Manager 4 in Ubuntu Server 13.04 – 32 bit Edition?

  1. Install the required package and dependencies
    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 freeradius-mysql apache2 apache2.2-common php5-cli
  2. Download and install libtool 1.x from http://www.dmasoftlab.com/downloads
    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
  3. Lets now proceed with ioncube installation.Find your php version using php -v and download respective ioncube loader from http://www.dmasoftlab.com/downloads. Then proceed with the installation.
    wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86.tar.gz
    tar -zxvf ioncube_loaders_lin_x86.tar.gz
    mkdir /usr/local/ioncube/
    mv ioncube/* /usr/local/ioncube/
  4. Edit php.ini in two locations and add the ioncube extension location
    nano /etc/php5/cli/php.ini
    zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so
    /etc/php5/apache2/php.ini
    zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so
  5. Install Free Radius
    wget http://www.dmasoftlab.com/cont/download/freeradius-server-2.1.8-dmamod-3.tar.gz
    gzip -d freeradius-server-2.1.8-dmamod-3.tar.gz
    tar xvf freeradius-server-2.1.8-dmamod-3.tar
    cd freeradius-server-2.1.8
    ./configure
    make
    make install

    If you get error then perform the following steps:

    nano src/modules/rlm_eap/Makefile

    add the follwing -lfreeradius-radius-2.1.8

    $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -lfreeradius-radius-2.1.8 -o radeapclient radeapclient.lo $(CLIENTLIBS) $(LIBS) $(OPENSSL_LIBS)
    make
    make install
  6. Check installation using
    radiusd -X

    If you get error then perform the following steps. Change the version number in the file appropriately and execute these commands:

    ln -s /usr/local/lib/libfreeradius-radius-2.1.8.so /usr/lib/libfreeradius-radius-2.1.8.so
    ln -s /usr/local/lib/libltdl.so.3.1.4 /usr/lib/libltdl.so.3
    ln -s /usr/local/lib/libfreeradius-eap-2.1.8.so /usr/lib/libfreeradius-eap-2.1.8.so
  7. Apply correct permissions :
    chown www-data /usr/local/etc/raddb
    chown www-data /usr/local/etc/raddb/clients.conf
  8. Create database and users
    mysql -u root -p password

    Where password is your password.

    CREATE DATABASE radius;
    CREATE DATABASE conntrack;
    CREATE USER ‘radius’@’localhost’ IDENTIFIED BY ‘radius123’;
    CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123’;
    GRANT ALL ON radius.* TO radius@localhost;
    GRANT ALL ON conntrack.* TO conntrack@localhost;
    exit
  9. Now lets proceed with the installation of radius manager. Download radius manager tarball package.
    wget https://copy.com/syaQTbkcAWL9gdWv
    tar -zxvf syaQTbkcAWL9gdWv
    cd radiusmanager-4.0.4
    chmod 755 install.sh
    ./install.sh
  10. Follow the onscreen instructions and after installation make sure the database is populated.
  11. Trasfer the lic.txt file and mod.txt file received from DMA Soft Labs to radiusmanager root directory
  12. Login to radius manager @ http://YourIP/radiusmanager. Default user:pass = admin:1111
  13. Now here if you get blank page or server error, double check your php.ini file and check ioncube path. Correct if wrong but if you still get error, then edit nano /etc/php5/cli/php.ini and change php memory to 16 Mb from 8 mb (memory_limit = 16M)
For queries post a comment 😉

Video Tutorial

Enjoyed this post? Share it!

 

 

 

Installation DMASoftlab Radiusmanager Script for Ubuntu (32 Bit)

#!/bin/bash

clear
getconf LONG_BIT

sqlpass=”radius”
wwwpath=”/var/www”
radhost=”localhost”
raduser=”radius”
myusr_rad=”radius”
mypsw_radius=”radius123″
myusr_cts=”conntrack”
mypsw_cts=”conn123″
httpuser=”www-data”
rmver40=”radiusmanager-4.0.4.tgz”
rmver41=”radiusmanager-4.1.0.tgz”

osver=cat /etc/issue |awk ‘{print $1}’

rmurl=”http://talhaali.byethost13.com/files/rm_related/”

if [[ $osver == Ubuntu ]]; then
echo
lsb_release -a
sleep 3
else
exit 1
fi
echo
FILE=”/tmp/out.$$”
GREP=”/bin/grep”
if [ “$(id -u)” != “0” ]; then
echo
exit 1
fi

temp=”temp”
{
if [ ! -d “/temp” ]; then
echo
mkdir /temp
else
echo
echo
fi
}

cd /$temp
rm -fr /temp/radiusmanager.
rm -fr /temp/freeradius.
rm -fr /temp/libltd.
rm -fr /temp/ioncube.
sleep 5
echo
cd /temp
wget -q $rmurl/rm4.txt
{
if [ ! -f /temp/rm4.txt ]; then
echo
exit 0
fi
}
rm -fr /temp/rm4.txt
sleep 6

clear

echo
echo “1. Radius Manager 4.1.5”
echo “2. Radius Manager 4.1.6”
echo
echo -n “Choose an option: [1]”
if [ -z “$rmver” ]; then
rmver=”1″
fi
case $rmver in

1) echo “Selected RM version is: 4.0.4″
echo .
defver=”radiusmanager-4.0.4.tgz”
defverdir=”radiusmanager-4.0.4″
sleep 5
wget $rmurl/$defver
;;

2) echo “Selected RM version is: 4.1.0″
defver=”radiusmanager-4.1.0.tgz”
defverdir=”radiusmanager-4.1.0″
echo .
sleep 5
wget $rmurl/$defver
;;

*) echo “Invalid selection. Installation aborted”
echo
exit
;;
esac
{
if [ ! -f /$temp/$defver ]; then
echo .
exit 0
fi
}

echo
sleep 5
apt-get update

echo .
sleep 5

apt-get -y 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 apache2

sleep 5
cd /$temp
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

echo .
sleep 5
wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86.tar.gz
{
if [ ! -f /$temp/ioncube_loaders_lin_x86.tar.gz ]; then
echo .
exit 0
fi
}
tar zxvf ioncube_loaders_lin_x86.tar.gz
mkdir /usr/local/ioncube
cd /$temp/ioncube
cp -fr * /usr/local/ioncube/

echo .
sleep 5
echo “zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so” >> /etc/php5/apache2/php.ini
echo “zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so” >> /etc/php5/cli/php.ini

cd /$temp
echo .
sleep 5
wget http://www.dmasoftlab.com/cont/download/freeradius-server-2.2.0-dma-patch-2.tar.gz
Checking if FREERADIUS is downloaded
{
if [ ! -f /$temp/freeradius-server-2.2.0-dma-patch-2.tar.gz ]; then
echo .
exit 0
fi
}
echo .
sleep 5
tar zxvf freeradius-server-2.2.0-dma-patch-2.tar.gz
cd freeradius-server-2.2.0/
./configure
make
make install
radiusd -X
ldconfig

chown $httpuser /usr/local/etc/raddb
chown $httpuser /usr/local/etc/raddb/clients.conf

echo .
sleep 1
mysql -u root -p$sqlpass -e “create database radius”;
mysql -u root -p$sqlpass -e “create database conntrack”;
mysql -u root -p$sqlpass -e “CREATE USER ‘$myusr_rad’@’$radhost’ IDENTIFIED BY ‘$mypsw_radius’;”
mysql -u root -p$sqlpass -e “CREATE USER ‘$myusr_cts’@’$radhost’ IDENTIFIED BY ‘$mypsw_cts’;”
mysql -u root -p$sqlpass -e “GRANT ALL ON radius.* TO radius@$radhost;”
mysql -u root -p$sqlpass -e “GRANT ALL ON conntrack.* TO conntrack@$radhost;”

cd /$temp
tar zxvf $defver
cd /$temp/$defverdir
echo .
sleep 5

echo Copying Radius Manager WEB content to $wwwpath/radiusmanager
cp -fr www/radiusmanager $wwwpath
cp $wwwpath/radiusmanager/config/paypal_cfg.php.dist$wwwpath/radiusmanager/config/paypal_cfg.php
mv $wwwpath/radiusmanager/config/paypal_cfg.php.dist$wwwpath/radiusmanager/config/paypal_cfg.php
mv $wwwpath/radiusmanager/config/netcash_cfg.php.dist$wwwpath/radiusmanager/config/netcash_cfg.php
mv $wwwpath/radiusmanager/config/authorizenet_cfg.php.dist$wwwpath/radiusmanager/config/authorizenet_cfg.php
mv $wwwpath/radiusmanager/config/dps_cfg.php.dist$wwwpath/radiusmanager/config/dps_cfg.php
mv $wwwpath/radiusmanager/config/2co_cfg.php.dist$wwwpath/radiusmanager/config/2co_cfg.php

chown $httpuser $wwwpath/radiusmanager/config
chown $httpuser $wwwpath/radiusmanager/config/system_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/paypal_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/netcash_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/authorizenet_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/dps_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/2co_cfg.php
chown $httpuser $wwwpath/radiusmanager/tftpboot
chmod 600 $wwwpath/radiusmanager/config/system_cfg.php
chmod 600 $wwwpath/radiusmanager/config/paypal_cfg.php
chmod 600 $wwwpath/radiusmanager/config/netcash_cfg.php
chmod 600 $wwwpath/radiusmanager/config/authorizenet_cfg.php
chmod 600 $wwwpath/radiusmanager/config/dps_cfg.php
chmod 600 $wwwpath/radiusmanager/config/2co_cfg.php
chmod 644 $wwwpath/radiusmanager/config/docsis_keyfile
chmod 644 $wwwpath/radiusmanager/config/docsis_template

mkdir /var/www/radiusmanager/tmpimages
chown $httpuser $wwwpath/radiusmanager/tmpimages
chmod 755 bin/rm*
cp -fr bin/rm* /usr/local/bin
cp -fr bin/rootexec /usr/local/sbin
chmod 4755 /usr/local/sbin/rootexec
cp -fr etc/radiusmanager.cfg /etc
chown root /etc/radiusmanager.cfg
chmod 600 /etc/radiusmanager.cfg
cp -fr rc.d/rmpoller /etc/init.d
chown root.root /etc/init.d/rmpoller
chmod 755 /etc/init.d/rmpoller
update-rc.d rmpoller defaults 99
cp -fr rc.d/rmconntrack /etc/init.d
chown root.root /etc/init.d/rmconntrack
chmod 755 /etc/init.d/rmconntrack
update-rc.d rmconntrack defaults 99
chmod 755 rc.d/debian/radiusd
cp -fr rc.d/debian/radiusd /etc/init.d
update-rc.d radiusd defaults 99
cp -fr etc/logrotate.d/radiusd /etc/logrotate.d/radiusd
cp -fr etc/cron/radiusmanager /etc/cron.d/radiusmanager
chmod 644 /etc/cron.d/radiusmanager

echo .
sed -i ‘s/var\/lib\/mysql\/mysql.sock/var\/run\/mysqld\/mysqld.sock/g’ /etc/radiusmanager.cfg
sed -i ‘s/var\/www\/html/var\/www/g’ /etc/radiusmanager.cfg
sed -i ‘s/var\/www\/html/var\/www/g’ /etc/cron.d/radiusmanager
sed -i ‘s/var\/www\/html/var\/www/g’ /var/www/radiusmanager/config/system_cfg.php

chown $httpuser /usr/local/etc/raddb
chown $httpuser /usr/local/etc/raddb/clients.conf

service radiusd start
service apache2 restart
service mysql restart

 

 

Radius Manager Manual Installation For Ubuntu (32 & 64 Bit)

Checking Linux Version
lsb_release  -a

Checking 32 Bit (or) 64 Bit Operating System
getconf LONG_BIT

Updating System Packages
sudo apt-get update

Installation of Packages & Dependencies
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 freeradius-mysql apache2 apache2.2-common php5-cli

Download & Install Liberary Files
32 Bit Files
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

64 Bit Files
wget http://dmasoftlab.com/cont/download/libltdl3_1.5.26-1ubuntu1_amd64.deb
wget http://dmasoftlab.com/cont/download/libltdl3-dev_1.5.26-1ubuntu1_amd64.deb
dpkg -i libltdl3_1.5.26-1ubuntu1_amd64.deb
dpkg -i libltdl3-dev_1.5.26-1ubuntu1_amd64.deb

Download & Install Ioncube
32 Bit Files
cd /usr/local
wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86.tar.gz
tar -xvf ioncube_loaders_lin_x86.tar.gz
cd /ioncube
sudo cp loader-wizard.php /var/www

64 Bit Files
cd /usr/local
wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86-64.tar.gz
tar -xvf ioncube_loaders_lin_x86-64.tar.gz
cd /ioncube
sudo cp loader-wizard.php /var/www

Check PHP Version
php -v

Edit php.ini Configure File & Add Ioncube File extension location
vim  /etc/php5/cli/php.ini
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so
vim /etc/php5/apache2/php.ini
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so

Re-Start Apache2 Service
service apache2 restart
/etc/init.d/apache2 restart

Now Check Ioncube Loader file in Web Interface
http://IP-Address/loader-wizard.php
Click on Local Install1

Loader Installed (PHP is Working)2

Download & Installation Free-Radius
wget http://dmasoftlab.com/cont/download/freeradius-server-2.2.0-dma-patch-2.tar.gz
tar -xvf freeradius-server-2.2.0-dma-patch-2.tar.gz
cd freeradius-server-2.2.0

Configuring Freeradius
./configure
make
make install

Copy File -lfreeradius-radius-2.2.0 in MakeFile
cd  src/modules/rlm_eap
vim MakeFile

(LIBTOOL) –mode=link $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -lfreeradius-radius-2.2.0 -o radeapclient radeapclient.lo $(CLIENTLIBS) $(LIBS) $(OPENSSL_LIBS)

freerad

Configure Free Radius after Copying File to MakeFile
make
make install

radiusd -Xradiusx

ldconfig

Testing Free Radius in Terminal
radiusd -X
13

Testing Free Radius in Terminal
radtest user 1111 localhost 1812 testing123
14

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

Creating Mysql Database
mysql -u root -p password
CREATE DATABASE radius;
CREATE DATABASE conntrack;
CREATE USER ‘radius’@’localhost’ IDENTIFIED BY ‘radius123’;
CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123’;
GRANT ALL ON radius.* TO radius@localhost;
GRANT ALL ON conntrack.* TO conntrack@localhost;

Downloading & Installation Radius Manager 4
Radius Manager 4.0.4
wget http://talhaali.byethost13.com/files/rm_related/radiusmanager-4.0.4.tgz

Radius Manager 4.1.0
wget http://talhaali.byethost13.com/files/rm_related/radiusmanager-4.1.0.tgz

tar -xvf radiusmanager-4.0.4.tgz
tar -xvf radiusmanager-4.1.0.tgz
cd radiusmanager-4.0.4
cd radiusmanager-4.1.0

Setting Permissions
chmod 775 ./install
./install

Select Operating System 2 (Ubuntu & Debian)
1.png

Choose Option Type
2

Choose Option 1 (New Installation) & Choose Web Root /var/www (Root Path)
3

Press Enter
4

Press Enter
5.png

Press Enter
6.png

Press Enter
7

Press Enter
8

Press Enter
9

Press ‘y’ to Continue
10.png

Installation Process is Started
Should be –> Copying Web Content to /var/www/radiusmanager
11

Installation is Completed
12

Setting Permissions for Binaries
chmod 775 /usr/local/bin/rmauth
chmod 775 /usr/local/bin/rmacant
chmod 775 /usr/local/bin/rmpoller
chmod 775 /usr/local/bin/rmconntrack

Change Permissions & Owner for /etc/radiusmanager.cfg
chmod 600 /etc/radiusmanager.cfg
chown root.root /etc/radiusmanager.cfg

Change Permissions for tmpimages
chown www-data /var/www/radiusmanager/tmpimages

Copying Licence Files
Copy Lic.txt & Mod.txt Files to /var/www/radiusmanager

Re-Starting apache2 Service
service apache2 restart

Re-Starting Mysql Service
service mysql restart

Re-Starting Free Radius Service
service radiusd restart

Radius Manager Admin Login Page
http://IP-Address/radiusmanager/admin.php
Default Username & Password
Username – admin
Password  – 1111

rm-logo

Radius Manager User Login Page
http://IP-Address/radiusmanager/user.php
Default Username & Password
Username – user
Password – 1111

1

 

 

 

Radius Manager Manual Installation For CentOS (32 & 64 Bit)

Checking Linux Version
lsb_release  -a

Checking 32 Bit (or) 64 Bit Operating System
getconf LONG_BIT

Updating System Packages
yum install update

Disabled SELinux in /etc/sysconfig/selinux
vim /etc/sysconfig/selinux
SELINUX=disabled

Installation of EPL Repository
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Installation of Packages & Dependencies
yum install mc wget crontabs vixie-cron make gcc libtool-ltdl curl mysql-server mysql-devel net-snmp net-snmp-utils php php-mysql php-mcrypt php-gd php-snmp php-process ntp sendmail sendmail-cf alpine mutt

Server Install 32 bit glibc
yum install glibc.i386 libgcc_s.so.1

Download & Install Liberary Files
32 Bit Files
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

64 Bit Files
wget http://dmasoftlab.com/cont/download/libltdl3_1.5.26-1ubuntu1_amd64.deb
wget http://dmasoftlab.com/cont/download/libltdl3-dev_1.5.26-1ubuntu1_amd64.deb
dpkg -i libltdl3_1.5.26-1ubuntu1_amd64.deb
dpkg -i libltdl3-dev_1.5.26-1ubuntu1_amd64.deb

Download & Install Ioncube
32 Bit Files
cd /usr/local
wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86.tar.gz
tar -xvf ioncube_loaders_lin_x86.tar.gz
cd /ioncube
sudo cp loader-wizard.php /var/www/html

64 Bit Files
cd /usr/local
wget http://www.dmasoftlab.com/cont/download /ioncube_loaders_lin_x86-64.tar.gz
tar -xvf ioncube_loaders_lin_x86-64.tar.gz
cd /ioncube
sudo cp loader-wizard.php /var/www/html

Check PHP Version
php -v

Edit php.ini Configure File & Add Ioncube File extension location
vim  /etc/php.ini
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so

Re-Start httpd Service
service httpd restart
/etc/init.d/httpd restart

Now Check Ioncube Loader file in Web Interface
http://IP-Address/loader-wizard.php
Click on Local Install1

Loader Installed (PHP is Working)2

Download & Installation Free-Radius
wget http://dmasoftlab.com/cont/download/freeradius-server-2.2.0-dma-patch-2.tar.gz
tar -xvf freeradius-server-2.2.0-dma-patch-2.tar.gz
cd freeradius-server-2.2.0

Configure Freeradius
./configure
make
make install

Copy File -lfreeradius-radius-2.2.0 in Makefile
cd   src/modules/rlm_eap
vim MakeFile

(LIBTOOL) –mode=link $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -lfreeradius-radius-2.2.0 -o radeapclient radeapclient.lo $(CLIENTLIBS) $(LIBS) $(OPENSSL_LIBS)

freerad

Configure Free Radius after Copying File to MakeFile
make
make install

radiusd -X
radiusx

ldconfig

Testing Free Radius in Terminal
radiusd -X
13
14

Setting Permissions
chown apache /usr/local/etc/raddb
chown apache /usr/local/etc/raddb/clients.conf

Creating Mysql Database
mysql -u root -p password
CREATE DATABASE radius;
CREATE DATABASE conntrack;
CREATE USER ‘radius’@’localhost’ IDENTIFIED BY ‘radius123’;
CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123’;
GRANT ALL ON radius.* TO radius@localhost;
GRANT ALL ON conntrack.* TO conntrack@localhost;

Downloading & Installation Radius Manager 4
Radius Manager 4.0.4
wget http://talhaali.byethost13.com/files/rm_related/radiusmanager-4.0.4.tgz

Radius Manager 4.1.0
wget http://talhaali.byethost13.com/files/rm_related/radiusmanager-4.1.0.tgz

tar -xvf radiusmanager-4.0.4.tgz
tar -xvf radiusmanager-4.1.0.tgz
cd radiusmanager-4.0.4
cd radiusmanager-4.1.0

Setting Permissions
chmod 775 ./install
./install

Select Operating System 1 (Redhat, CentOS, Fedora)
1.png

Choose Option Type
2

Choose Option 1 (New Installation)
3

Press Enter
4

Press Enter
5.png

Press Enter
6.png

Press Enter
7

Press Enter
8

Press Enter
9

Press ‘y’ to Continue
10.png

Installation Process is Started
11

Installation is Completed
12

Setting Permissions for Binaries
chmod 775 /usr/local/bin/rmauth
chmod 775 /usr/local/bin/rmacant
chmod 775 /usr/local/bin/rmpoller
chmod 775 /usr/local/bin/rmconntrack

Change Permissions & Owner for /etc/radiusmanager.cfg
chmod 600 /etc/radiusmanager.cfg
chown root.root /etc/radiusmanager.cfg

Change Permissions for tmpimages
chown apache /var/www/html/radiusmanager/tmpimages

Copying Licence Files
Copy Lic.txt & Mod.txt Files to /var/www/html/radiusmanager

Re-Starting httpd Service
service httpd restart

Re-Starting Mysql Service
service mysqld restart

Re-Starting Free Radius Service
service radiusd restart

Admin Login Page
http://IP-Address/radiusmanager/admin.php
Username – admin
Password – 1111

rm-logo

User Login Page
http://IP-Address/radiusmanager/user.php
Username – user
Password – 1111

1

Checking Linux Version
lsb_release  -a

Checking 32 Bit (or) 64 Bit Operating System
getconf LONG_BIT

Updating System Packages
yum install update

Disabled SELinux in /etc/sysconfig/selinux
vim /etc/sysconfig/selinux
SELINUX=disabled

Installation of EPL Repository
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Installation of Packages & Dependencies
yum install mc wget crontabs vixie-cron make gcc libtool-ltdl curl mysql-server mysql-devel net-snmp net-snmp-utils php php-mysql php-mcrypt php-gd php-snmp php-process ntp sendmail sendmail-cf alpine mutt

Server Install 32 bit glibc
yum install glibc.i386 libgcc_s.so.1

Download & Install Liberary Files
32 Bit Files
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

64 Bit Files
wget http://dmasoftlab.com/cont/download/libltdl3_1.5.26-1ubuntu1_amd64.deb
wget http://dmasoftlab.com/cont/download/libltdl3-dev_1.5.26-1ubuntu1_amd64.deb
dpkg -i libltdl3_1.5.26-1ubuntu1_amd64.deb
dpkg -i libltdl3-dev_1.5.26-1ubuntu1_amd64.deb

Download & Install Ioncube
32 Bit Files
cd /usr/local
wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86.tar.gz
tar -xvf ioncube_loaders_lin_x86.tar.gz
cd /ioncube
sudo cp loader-wizard.php /var/www/html

64 Bit Files
cd /usr/local
wget http://www.dmasoftlab.com/cont/download /ioncube_loaders_lin_x86-64.tar.gz
tar -xvf ioncube_loaders_lin_x86-64.tar.gz
cd /ioncube
sudo cp loader-wizard.php /var/www/html

Check PHP Version
php -v

Edit php.ini Configure File & Add Ioncube File extension location
vim  /etc/php.ini
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so

Re-Start httpd Service
service httpd restart
/etc/init.d/httpd restart

Now Check Ioncube Loader file in Web Interface
http://IP-Address/loader-wizard.php
Click on Local Install1

Loader Installed (PHP is Working)2

Download & Installation Free-Radius
wget http://dmasoftlab.com/cont/download/freeradius-server-2.2.0-dma-patch-2.tar.gz
tar -xvf freeradius-server-2.2.0-dma-patch-2.tar.gz
cd freeradius-server-2.2.0

Configure Freeradius
./configure
make
make install

Copy File -lfreeradius-radius-2.2.0 in Makefile
cd   src/modules/rlm_eap
vim MakeFile

(LIBTOOL) –mode=link $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -lfreeradius-radius-2.2.0 -o radeapclient radeapclient.lo $(CLIENTLIBS) $(LIBS) $(OPENSSL_LIBS)

freerad

Configure Free Radius after Copying File to MakeFile
make
make install

radiusd -X
radiusx

ldconfig

Testing Free Radius in Terminal
radiusd -X
13
14

Setting Permissions
chown apache /usr/local/etc/raddb
chown apache /usr/local/etc/raddb/clients.conf

Creating Mysql Database
mysql -u root -p password
CREATE DATABASE radius;
CREATE DATABASE conntrack;
CREATE USER ‘radius’@’localhost’ IDENTIFIED BY ‘radius123’;
CREATE USER ‘conntrack’@’localhost’ IDENTIFIED BY ‘conn123’;
GRANT ALL ON radius.* TO radius@localhost;
GRANT ALL ON conntrack.* TO conntrack@localhost;

Downloading & Installation Radius Manager 4
Radius Manager 4.0.4
wget http://talhaali.byethost13.com/files/rm_related/radiusmanager-4.0.4.tgz

Radius Manager 4.1.0
wget http://talhaali.byethost13.com/files/rm_related/radiusmanager-4.1.0.tgz

tar -xvf radiusmanager-4.0.4.tgz
tar -xvf radiusmanager-4.1.0.tgz
cd radiusmanager-4.0.4
cd radiusmanager-4.1.0

Setting Permissions
chmod 775 ./install
./install

Select Operating System 1 (Redhat, CentOS, Fedora)
1.png

Choose Option Type
2

Choose Option 1 (New Installation)
3

Press Enter
4

Press Enter
5.png

Press Enter
6.png

Press Enter
7

Press Enter
8

Press Enter
9

Press ‘y’ to Continue
10.png

Installation Process is Started
11

Installation is Completed
12

Setting Permissions for Binaries
chmod 775 /usr/local/bin/rmauth
chmod 775 /usr/local/bin/rmacant
chmod 775 /usr/local/bin/rmpoller
chmod 775 /usr/local/bin/rmconntrack

Change Permissions & Owner for /etc/radiusmanager.cfg
chmod 600 /etc/radiusmanager.cfg
chown root.root /etc/radiusmanager.cfg

Change Permissions for tmpimages
chown apache /var/www/html/radiusmanager/tmpimages

Copying Licence Files
Copy Lic.txt & Mod.txt Files to /var/www/html/radiusmanager

Re-Starting httpd Service
service httpd restart

Re-Starting Mysql Service
service mysqld restart

Re-Starting Free Radius Service
service radiusd restart

Admin Login Page
http://IP-Address/radiusmanager/admin.php
Username – admin
Password – 1111

rm-logo

User Login Page
http://IP-Address/radiusmanager/user.php
Username – user
Password – 1111

1

 

 

 

 

 

 

 

 

 

 

 

Installation Script For Dmasoftlab Radius Manager v.4 in Ubuntu

dma415

digital


Following is an customized script to install DMASOFTLAB Radius Manager ver 4.0.4 & 4.1.x for Ubuntu 12.4 Server / 32bit Only. Make sure you have same exact version as this script is specifically written and tested on 12.4/32bit.

The aim of writing this script was to save some time and efforts every time I put in new RM installation. Since DMA doesn’t offer any official support forum (except for there email support which is valid for paid customers only) , so I thought it might be helpful for others by sharing this info 🙂

SHARING IS CARING …

I know this is not a perfect script, it can be customized well as per the requirement, but still it does it’s job very nicely.

Suggestions are most welcome at  . . .
aacable AT hotmail  DOT com

Salam Alykum …
Syed Jahanzaib


Script Update Revision History:

1- —– forgot to make revision  from the beginning  😉
[ 7th January 2014 ]    Download URL changed to aacable.rdo.pt /files/rm_related
[ 7th January 2014 ]    MySQL user ‘conntrack’ variable fixed in MySQL section
[ 8th January, 2014]    O.S check for UBUNTU added
[ 8th January, 2014]    root user check added
[ 8th January, 2014]    Function added to remove previously downloaded files in /temp folder to avoid duplication
[ 8th January, 2014]    Internet and $URL availability check
[ 29th January, 2014]  aacable.rdo.pt was down dueto quota limit, now added secondary link URL2 = http://wifismartzone.com/files/linux_related/
[28th July, 2014] Add rmpoller service to run at startup
[19th November, 2014]  Fixed captcha image not showing dueto tmpimages folder missing
[25 January, 2018]   Added new FTP hosting from where files will be download for the installation. Thanks to Mr, Rui / George.


Requirements:

1- Fresh Installation of UBUNTU SERVER / Desktop EDITION 12.4 / 32bit Only

2- Good Internet access, for sure ; )

3- Valid License files provided by DMASOFTLAB , valid with your physical (or virtual) interface MAC address (Should be placed in /temp folder before running the script)


What components does this script add to the system ?

This script will install following in your system. (as per order nos.)

  • Download Radius Manager from an remote location (in temp folder), as per your choice between 4.0 and 4.1(choice menu offered right after execution of the script)
  • Update Ubuntu by apt-get update command
  • Install necessary components like mysql , apache2, php5,
  • Download and install dmasoftlab required components like libltd* , IONCUBE and add its entries in Apache’s php files
  • Download and compile freeradius-server-2.2.0-dma-patch-2 package
  • Add Radius & Conntrack DB in mysql suing CLI (Make sure your root password matched in variables section)
  • Extract Radius Manager Installation file & install it.
  • Restart Services like apache2, mysql, radius

IMPORTANT:


1- Before accessing RM ACP , make sure you upload valid LICENSE files in /var/www/radiusmanager folder

2- Also make sure that when mysql asks you for password (during installation) set it to “zaib1234” , otherwise it will be a mess to change it later 🙂


How-to Execute The Script  !!

There are several ways to do it, one is explained below . . .

Create a new script

touch /rm-ubuntu-32bit.sh
chmod +x /rm-ubuntu-32bit.sh
nano /rm-ubuntu-32bit.sh

the Script !

Now copy paste the following code.

AAAAAAAAAAAAAAAA

#!/bin/bash
# Version 1.3 / 9th November, 2014
# Syed Jahanzaib / aacable@hotmail.com
# DMASOFTLAB Radius Manager 4.0.4 / 4.1.x Automated Installation Script for Ubuntu 10/12 32bit Edition
# Some CORE installation part have been taken from the Original INSTALL.SH with some In-House Heavy modifications : )
# Last Modified - 25-JAN-2018 , added wget retries for weak internet links
# set -x
# Setting Variables . . . [JZ]
clear
# MySQL ROOT Password , Change this variable according to your own setup if required. . . [[ JZ . . . ]]
sqlpass="zaib1234"
SQLUSER="root"
SQLPASS="zaib1234"
# For RM & MYSQL . . . [[ JZ . . . ]]
wwwpath="/var/www"
radhost="localhost"
raduser="radius"
RADIUSDB="radius"
myusr_rad="radius"
mypsw_radius="radius123"
myusr_cts="conntrack"
mypsw_cts="conn123"
httpuser="www-data"
rmver40="radiusmanager-4.0.4.tgz"
rmver41="radiusmanager-4.1.0.tgz"
osver=`cat /etc/issue |awk '{print $1}'`
# RM Installation Package Download URL , Change this variable according to your own setup , if required. . . [[ JZ . . . ]]
# Colors Config . . . [[ JZ . . . ]]
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
# OS checkup for UBUNTU
echo -e "$COL_GREEN Checking OS version, as it must be Ubuntu in order to Continue . Syed Jahanzaib / aacable@hotmail.com. .$COL_RESET"
if [[ $osver == Ubuntu ]]; then
echo
echo -e "$COL_GREEN Ubuntu is installed with following information fetched. $COL_RESET"
lsb_release -a
sleep 3
else
echo -e "$COL_RED Sorry, it seems your Linux Distribution is not UBUNTU . Exiting ...$COL_RESET"
exit 1
fi
# Make sure only root can run our script / Checking if user is root, otherwise exit with error [[Jz]]
echo
echo -e "$COL_GREEN Verifying if you are logged in with root priveleges . . .$COL_RESET" 1>&2
FILE="/tmp/out.$$"
GREP="/bin/grep"
if [ "$(id -u)" != "0" ]; then
echo
echo -e "$COL_RED This script must be run as root, switch to root now . . .$COL_RESET" 1>&2
exit 1
fi
echo -e "$COL_GREEN OK - You are logged in with root ID, Ok to proceed further . . .!! $COL_RESET"
# Temporary Folder where all software will be downloaded . . . [[ JZ . . . ]]
temp="temp"
# Checking if /temp folder is previously present or not . . .
{
if [ ! -d "/temp" ]; then
echo
echo -e "$COL_RED /temp folder not found, Creating it so all downloads will be placed here . . . $COL_RESET"
mkdir /temp
else
echo
echo -e "$COL_GREEN /temp folder is already present , so no need to create it, Proceeding further . . . $COL_RESET"
echo
fi
}
cd /$temp
# Clearing Old downloads in /temp to avoid DUPLICATIONS . . .
echo -e "$COL_RED Clearing Old downloads in /temp to avoid DUPLICATIONS . . . $COL_RESET"
rm -fr /temp/radiusmanager*.*
rm -fr /temp/freeradius*.*
rm -fr /temp/libltd*.*
rm -fr /temp/ioncube*.*
sleep 5
# Checking IF $rmurl is accessible m if YES then continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
echo
echo -e "$COL_GREEN Checking if $rmurl is accessible in order to proceed further. . .!! $COL_RESET"
cd /temp
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 -q $rmurl/rm4.txt
{
if [ ! -f /temp/rm4.txt ]; then
echo
echo -e "$COL_RED ERROR: Unable to contact $rmurl, or possibly internet is not working or your IP is in black list at destination server !! $COL_RESET"
echo -e "$COL_RED ERROR: Please check manual if $rmurl is accessible or not or if it have required files, JZ !! $COL_RESET"
exit 0
fi
}
rm -fr /temp/rm4.txt
sleep 6
######################
clear
# Selection choice menu of RM version 4.0 or 4.1
echo -e "$COL_GREEN ########################################### $COL_RESET"
echo -e "$COL_GREEN Select the type of your operating system: $COLRESET"
echo -e "$COL_GREEN Syed Jahanzaib / aacable@hotmail.com $COLRESET"
echo -e "$COL_GREEN ########################################### $COL_RESET"
echo
echo "1. Radius Manager 4.0.4"
echo "2. Radius Manager 4.1.0"
echo
echo -n "Choose an option: [1] "
read rmver
if [ -z "$rmver" ]; then
rmver="1"
fi
case $rmver in
1 ) echo "Selected RM version is: 4.0.4 [Old]"
# Download radius manager 4.0.4 in $temp folder
echo .
echo -e "$COL_GREEN Downloading RADIUS MANAGER 4.0.4 package from INTERNET . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
defver="radiusmanager-4.0.4.tgz"
defverdir="radiusmanager-4.0.4"
sleep 3
# Updating apt-get , to avoid update/install errors for 12.4 ONLY
# Update UBUNTU FIRST . . . [[ JZ . . . ]]
echo -e "$COL_GREEN Updating UBUNTU . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get dist-upgrade
sudo apt-get update --fix-missing
sudo apt-get update
# Downloading Radius Manager Package
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/$defver
;;
2 ) echo "Selected RM version is: 4.1.0 [Latest]"
echo -e "$COL_GREEN Downloading RADIUS MANAGER 4.1.0 package from INTERNET . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
defver="radiusmanager-4.1.0.tgz"
defverdir="radiusmanager-4.1.0"
echo .
sleep 5
# Download radius manager 4.1.0 in $temp folder
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/$defver
;;
* ) echo "Invalid selection. Installation aborted."
echo
exit
;;
esac
# Checking IF RM installation file have been downloaded. if YEs continue further , otherwise EXIT the script with ERRO ! [[ JZ .. . .]]
{
if [ ! -f /$temp/$defver ]; then
echo .
echo -e "$COL_RED ERROR: RM Installation File could not be download or found in /$temp/$defver ! ZAIB - $COL_RESET"
exit 0
fi
}
# Installing required components for RM . . . [[ JZ . . . ]]
echo .
echo -e "$COL_GREEN Installing components like MYSQL , PHP etc . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
apt-get --force-yes -y 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 apache2
# While installing above components , it may ask for mysql password, use same password as you have used before . . . [[ JZ . . . ]]
echo .
echo -e "$COL_GREEN Installing LIB packages . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
cd /$temp
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/libltdl3_1.5.24-1ubuntu1_i386.deb
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/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:
# Now Download ioncube library and add it to php . . . [[ JZ . . . ]]
echo .
echo -e "$COL_GREEN Installing IONCUBE . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/ioncube_loaders_lin_x86.tar.gz
# Checking if IONCUBE installation file have been downloaded. if YEs continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
{
if [ ! -f /$temp/ioncube_loaders_lin_x86.tar.gz ]; then
echo .
echo -e "$COL_RED ERROR: COULD NOT DOWNLOAD IONCUBE !!! EXITING . . . $COL_RESET"
exit 0
fi
}
tar xvf ioncube_loaders_lin_x86.tar.gz
mkdir /usr/local/ioncube
cd /$temp/ioncube
cp -fr * /usr/local/ioncube/
# Now Add the appropriate ionCube loader to your php.ini . . . [JZ]
echo .
echo -e "$COL_GREEN Adding iONCUBE in PHP . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so" >> /etc/php5/apache2/php.ini
echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so" >> /etc/php5/cli/php.ini
cd /$temp
echo .
echo -e "$COL_GREEN Downloading FREERADiUS 2.2.20-dma-patch-2 package . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/freeradius-server-2.2.0-dma-patch-2.tar.gz
# Checking if FREERADIUS is downloaded, just to make sure internet is working ,IF NOT, EXIT the script with ERROR ! [[ JZ .. . .]]
{
if [ ! -f /$temp/freeradius-server-2.2.0-dma-patch-2.tar.gz ]; then
echo .
echo -e "$COL_RED ERROR: COULD NOT DOWNLOAD FREERADIUS 2.2.20-dma-patch-2, possible INTERNET is not Working !!! EXITING . . . Syed Jahanzaib $COL_RESET"
exit 0
fi
}
echo .
echo -e "$COL_GREEN Compiling FREERADIUS . Sleeping for 3 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
mv freeradius-server-2.2.0-dma-patch-2.tar.gz freeradius-server-2.2.0-dma-patch-2.tar
tar xvf freeradius-server-2.2.0-dma-patch-2.tar
cd freeradius-server-2.2.0/
### Now proceed with the compilation of FREERAIDUS , applicable for all
./configure
make
make install
ldconfig
# Set the correct ownership on FreeRadius configuration files
chown $httpuser /usr/local/etc/raddb
chown $httpuser /usr/local/etc/raddb/clients.conf
# ================================================================
# Creating MySQL databases with MySQL command line tool . . . [JZ]
# ================================================================
# ** FROM CLI ** . . . [JZ]
echo .
echo -e "$COL_GREEN adding RADIUS user & DB in MYSQL . syed jahanzaib. Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 1
mysql -u $SQLUSER -p$SQLPASS -e "create database radius";
mysql -u $SQLUSER -p$SQLPASS -e "create database conntrack";
mysql -u $SQLUSER -p$SQLPASS -e "CREATE USER '$myusr_rad'@'$radhost' IDENTIFIED BY '$mypsw_radius';"
mysql -u $SQLUSER -p$SQLPASS -e "CREATE USER '$myusr_cts'@'$radhost' IDENTIFIED BY '$mypsw_cts';"
mysql -u $SQLUSER -p$SQLPASS -e "GRANT ALL ON radius.* TO radius@$radhost;"
mysql -u $SQLUSER -p$SQLPASS -e "GRANT ALL ON conntrack.* TO conntrack@$radhost;"
# Check if $DB (in this case radius ) is accessible or not, if NOT, then exit the script
RESULT=`mysql -u $SQLUSER -p$SQLPASS --skip-column-names -e "SHOW DATABASES LIKE '$RADIUSDB'"`
if [ "$RESULT" == "$RADIUSDB" ]; then
echo "-$DB database exist OK. Proceeding further ..."
else
echo "-$DB database does not exist! Probably either mysql not accessible or wrong credentials provided. Re run the script (by zaib)"
exit 1
fi
# Time to Install RADIUS MANAGER 4.x.x . . . [JZ]
# ===============================================
cd /$temp
tar zxvf $defver
cd /$temp/$defverdir
echo .
echo -e "$COL_GREEN Starting RADIUS MANAGER install script install.sh . Sleeping for 3 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
echo "Radius Manager installer $defver for Ubuntu ONLY ****" [ JZ ]
echo "Copyright 2004-2012, DMA Softlab LLC"
echo "All right reserved."
echo
echo .
echo -e "$COL_GREEN (Use CTRL+C to abort any time) . Sleeping for 3 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
# copy web content
echo Copying Radius Manager WEB content to $wwwpath/radiusmanager
cp -fr www/radiusmanager $wwwpath
# rename .dist files
# Zaib / copy paypal cfg file so that user.php may not be missed
mv $wwwpath/radiusmanager/config/payfast_cfg.php.dist $wwwpath/radiusmanager/config/payfast_cfg.php
mv $wwwpath/radiusmanager/config/paypal_cfg.php.dist $wwwpath/radiusmanager/config/paypal_cfg.php
mv $wwwpath/radiusmanager/config/netcash_cfg.php.dist $wwwpath/radiusmanager/config/netcash_cfg.php
mv $wwwpath/radiusmanager/config/authorizenet_cfg.php.dist $wwwpath/radiusmanager/config/authorizenet_cfg.php
mv $wwwpath/radiusmanager/config/dps_cfg.php.dist $wwwpath/radiusmanager/config/dps_cfg.php
mv $wwwpath/radiusmanager/config/2co_cfg.php.dist $wwwpath/radiusmanager/config/2co_cfg.php
# set ownership and permissions
chown $httpuser $wwwpath/radiusmanager/config
chown $httpuser $wwwpath/radiusmanager/config/system_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/paypal_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/netcash_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/authorizenet_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/dps_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/2co_cfg.php
#chown $httpuser $wwwpath/radiusmanager/tmpimages
chown $httpuser $wwwpath/radiusmanager/tftpboot
chmod 600 $wwwpath/radiusmanager/config/system_cfg.php
chmod 600 $wwwpath/radiusmanager/config/paypal_cfg.php
chmod 600 $wwwpath/radiusmanager/config/netcash_cfg.php
chmod 600 $wwwpath/radiusmanager/config/authorizenet_cfg.php
chmod 600 $wwwpath/radiusmanager/config/dps_cfg.php
chmod 600 $wwwpath/radiusmanager/config/2co_cfg.php
chmod 644 $wwwpath/radiusmanager/config/docsis_keyfile
chmod 644 $wwwpath/radiusmanager/config/docsis_template
# Adding tmpimage folder for CAPTCHA images (Zaib)
mkdir /var/www/radiusmanager/tmpimages
chown $httpuser $wwwpath/radiusmanager/tmpimages
# chmod and copy binaries
echo "Copying binaries to /usr/local/bin"
chmod 755 bin/rm*
cp -fr bin/rm* /usr/local/bin
echo "Copying rootexec to /usr/local/sbin"
cp -fr bin/rootexec /usr/local/sbin
chmod 4755 /usr/local/sbin/rootexec
# chmod and copy radiusmanager.cfg
echo "Copying radiusmanager.cfg to /etc"
cp -fr etc/radiusmanager.cfg /etc
chown root /etc/radiusmanager.cfg
chmod 600 /etc/radiusmanager.cfg
# create or upgrade tables
echo "Creating MySQL tables ..."
mysql -h $radhost -u $myusr_rad -p$mypsw_radius radius < sql/radius.sql
mysql -h $radhost -u $myusr_cts -p$mypsw_cts conntrack < sql/conntrack.sql
# create rmpoller service
echo "Enabling rmpoller service at boot time ..."
cp -fr rc.d/rmpoller /etc/init.d
chown root.root /etc/init.d/rmpoller
chmod 755 /etc/init.d/rmpoller
update-rc.d rmpoller defaults 99
# create rmconntrack service
echo "Enabling rmconntrack service at boot time"
cp -fr rc.d/rmconntrack /etc/init.d
chown root.root /etc/init.d/rmconntrack
chmod 755 /etc/init.d/rmconntrack
update-rc.d rmconntrack defaults 99
# copy radiusd init script
echo "Enabling radiusd service at boot time"
chmod 755 rc.d/debian/radiusd
cp -fr rc.d/debian/radiusd /etc/init.d
update-rc.d radiusd defaults 99
# copy logrotate script
echo "Copying logrotate script"
cp -fr etc/logrotate.d/radiusd /etc/logrotate.d/radiusd
# copy cron job script
echo "Copying cronjob script"
cp -fr etc/cron/radiusmanager /etc/cron.d/radiusmanager
chmod 644 /etc/cron.d/radiusmanager
# comment out the old style cron job
sed -i 's/02\ 0\ \*\ \*\ \*\ root\ \/usr\/bin\/php/#2\ 0\ \*\ \*\ \*\ root\ \/usr\/bin\/php/g' /etc/crontab
# replace strings in cfg files for Debian
echo .
echo -e "$COL_GREEN Setting Debina base WWW dir in configuration files . . .!$COL_RESET"
sed -i 's/var\/lib\/mysql\/mysql.sock/var\/run\/mysqld\/mysqld.sock/g' /etc/radiusmanager.cfg
sed -i 's/var\/www\/html/var\/www/g' /etc/radiusmanager.cfg
sed -i 's/var\/www\/html/var\/www/g' /etc/cron.d/radiusmanager
sed -i 's/var\/www\/html/var\/www/g' /var/www/radiusmanager/config/system_cfg.php
# set permission on raddb files
echo "Setting permission on raddb files"
chown $httpuser /usr/local/etc/raddb
chown $httpuser /usr/local/etc/raddb/clients.conf
echo
echo .
echo -e "$COL_GREEN Radius manager Installation complete! copying license files ... $COL_RESET"
echo
# Now copy the two license files (that you receive from DMASOFTLAB) in /var/www/radiusmanager . . . [JZ]
#cp -fr lic.txt /var/www/radiusmanager/
#cp -fr mod.txt /var/www/radiusmanager/
echo .
echo .
echo -e "$COL_GREEN Re-Starting Apache2, Radius and mySQL Service$COL_RESET"
echo .
service radiusd start
service apache2 restart
service mysql restart
echo .
echo .
echo .
echo .
echo .
echo -e "$COL_GREEN All Done. Please copy the license files in /var/www/radiusmanager folder and then access ADMIN panel via http://yourip/radiusmanager/admin.php $COL_Save & Exit …

Now execute the script by

/rm-ubuntu-32bit.sh


After the script ends, do make sure that you don’t see Error’s  on the installation. That’s why I have added 3-5 Seconds delay in each section so you can view the results.

Now UPLOAD your valid License into /var/www/radiusmanager

Now Try to access RM ACP via browser by

http://yourip/radiusmanager/admin.php

If you get blank page, then use tail command to view Apache error log , example

tail -f /var/log/apache2/error.log

OR more specifically

tail -f /var/log/apache2/error.log |grep lic

If you see any error like showed in the image below . . . (for not valid license), then make sure your license files are valid for right version and with the right mac address interface.

rm-lic-error


To deploy Radius Manager Patch 5 (4.1.5) , Kindly see the following Link

https://aacable.wordpress.com/2014/02/28/radius-manager-4-1-patch5-deployment/

I will add few snapshots and video as soon as I get some time.


TIP#1: Clone MAC Address:

1
2
3
4
5
touch /etc/fw.sh
chmod +x /etc/fw.sh
nano /etc/fw.sh

and paste following, then save & exit.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Very Basic Level of Firewall with Fake MAC address support
# To support x/x/x.x.x.x.xx.x
# Script by Syed Jahanzaib
# 21-FEB-2016
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# Adding FAKE interface for RM
ip link add link eth0 address 00:0C:29:XX:XX:XX eth0.1 type macvlan
ifconfig eth0.1 up
ifconfig eth0.1 1.2.3.4 netmask 255.255.255.255
service apache2 restart

TIP#2: Block access to radiusmanager folder listing [ disable directory browsing]

If you want to Disable Browsing on every folder inside /var/www/ then Edit following file

nano /etc/apache2/sites-available/default

& Change the Options

‘Indexes FollowSymLinks MultiViews’
to
‘Options FollowSymLinks MultiViews’

(means Remove the Indexes word which allows directory listing).
and restart apache2 service by

service apcahe2 restart


Regard’s

Installation Script For Dmasoftlab Radius Manager v.4 in Ubuntu

 

dma415

 

digital


 

Following is an customized script to install DMASOFTLAB Radius Manager ver 4.0.4 & 4.1.x for Ubuntu 12.4 Server / 32bit Only. Make sure you have same exact version as this script is specifically written and tested on 12.4/32bit.

The aim of writing this script was to save some time and efforts every time I put in new RM installation. Since DMA doesn’t offer any official support forum (except for there email support which is valid for paid customers only) , so I thought it might be helpful for others by sharing this info 🙂

SHARING IS CARING …

I know this is not a perfect script, it can be customized well as per the requirement, but still it does it’s job very nicely.

Suggestions are most welcome at  . . .
aacable AT hotmail  DOT com

Salam Alykum …
Syed Jahanzaib


Script Update Revision History:

1- —– forgot to make revision  from the beginning  😉
[ 7th January 2014 ]    Download URL changed to aacable.rdo.pt /files/rm_related
[ 7th January 2014 ]    MySQL user ‘conntrack’ variable fixed in MySQL section
[ 8th January, 2014]    O.S check for UBUNTU added
[ 8th January, 2014]    root user check added
[ 8th January, 2014]    Function added to remove previously downloaded files in /temp folder to avoid duplication
[ 8th January, 2014]    Internet and $URL availability check
[ 29th January, 2014]  aacable.rdo.pt was down dueto quota limit, now added secondary link URL2 = http://wifismartzone.com/files/linux_related/
[28th July, 2014] Add rmpoller service to run at startup
[19th November, 2014]  Fixed captcha image not showing dueto tmpimages folder missing
[25 January, 2018]   Added new FTP hosting from where files will be download for the installation. Thanks to Mr, Rui / George.


Requirements:

1- Fresh Installation of UBUNTU SERVER / Desktop EDITION 12.4 / 32bit Only

2- Good Internet access, for sure ; )

3- Valid License files provided by DMASOFTLAB , valid with your physical (or virtual) interface MAC address (Should be placed in /temp folder before running the script)


What components does this script add to the system ?

This script will install following in your system. (as per order nos.)

  • Download Radius Manager from an remote location (in temp folder), as per your choice between 4.0 and 4.1(choice menu offered right after execution of the script)
  • Update Ubuntu by apt-get update command
  • Install necessary components like mysql , apache2, php5,
  • Download and install dmasoftlab required components like libltd* , IONCUBE and add its entries in Apache’s php files
  • Download and compile freeradius-server-2.2.0-dma-patch-2 package
  • Add Radius & Conntrack DB in mysql suing CLI (Make sure your root password matched in variables section)
  • Extract Radius Manager Installation file & install it.
  • Restart Services like apache2, mysql, radius

IMPORTANT:


1- Before accessing RM ACP , make sure you upload valid LICENSE files in /var/www/radiusmanager folder

2- Also make sure that when mysql asks you for password (during installation) set it to “zaib1234” , otherwise it will be a mess to change it later 🙂


How-to Execute The Script  !!

There are several ways to do it, one is explained below . . .

Create a new script

touch /rm-ubuntu-32bit.sh
chmod +x /rm-ubuntu-32bit.sh
nano /rm-ubuntu-32bit.sh

the Script !

Now copy paste the following code.

—>

#!/bin/bash
# Version 1.3 / 9th November, 2014
# Syed Jahanzaib / aacable@hotmail.com
# DMASOFTLAB Radius Manager 4.0.4 / 4.1.x Automated Installation Script for Ubuntu 10/12 32bit Edition
# Some CORE installation part have been taken from the Original INSTALL.SH with some In-House Heavy modifications : )
# Last Modified - 25-JAN-2018 , added wget retries for weak internet links
# set -x
# Setting Variables . . . [JZ]
clear
# MySQL ROOT Password , Change this variable according to your own setup if required. . . [[ JZ . . . ]]
sqlpass="zaib1234"
SQLUSER="root"
SQLPASS="zaib1234"
# For RM & MYSQL . . . [[ JZ . . . ]]
wwwpath="/var/www"
radhost="localhost"
raduser="radius"
RADIUSDB="radius"
myusr_rad="radius"
mypsw_radius="radius123"
myusr_cts="conntrack"
mypsw_cts="conn123"
httpuser="www-data"
rmver40="radiusmanager-4.0.4.tgz"
rmver41="radiusmanager-4.1.0.tgz"
osver=`cat /etc/issue |awk '{print $1}'`
# RM Installation Package Download URL , Change this variable according to your own setup , if required. . . [[ JZ . . . ]]
# Colors Config . . . [[ JZ . . . ]]
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
# OS checkup for UBUNTU
echo -e "$COL_GREEN Checking OS version, as it must be Ubuntu in order to Continue . Syed Jahanzaib / aacable@hotmail.com. .$COL_RESET"
if [[ $osver == Ubuntu ]]; then
echo
echo -e "$COL_GREEN Ubuntu is installed with following information fetched. $COL_RESET"
lsb_release -a
sleep 3
else
echo -e "$COL_RED Sorry, it seems your Linux Distribution is not UBUNTU . Exiting ...$COL_RESET"
exit 1
fi
# Make sure only root can run our script / Checking if user is root, otherwise exit with error [[Jz]]
echo
echo -e "$COL_GREEN Verifying if you are logged in with root priveleges . . .$COL_RESET" 1>&2
FILE="/tmp/out.$$"
GREP="/bin/grep"
if [ "$(id -u)" != "0" ]; then
echo
echo -e "$COL_RED This script must be run as root, switch to root now . . .$COL_RESET" 1>&2
exit 1
fi
echo -e "$COL_GREEN OK - You are logged in with root ID, Ok to proceed further . . .!! $COL_RESET"
# Temporary Folder where all software will be downloaded . . . [[ JZ . . . ]]
temp="temp"
# Checking if /temp folder is previously present or not . . .
{
if [ ! -d "/temp" ]; then
echo
echo -e "$COL_RED /temp folder not found, Creating it so all downloads will be placed here . . . $COL_RESET"
mkdir /temp
else
echo
echo -e "$COL_GREEN /temp folder is already present , so no need to create it, Proceeding further . . . $COL_RESET"
echo
fi
}
cd /$temp
# Clearing Old downloads in /temp to avoid DUPLICATIONS . . .
echo -e "$COL_RED Clearing Old downloads in /temp to avoid DUPLICATIONS . . . $COL_RESET"
rm -fr /temp/radiusmanager*.*
rm -fr /temp/freeradius*.*
rm -fr /temp/libltd*.*
rm -fr /temp/ioncube*.*
sleep 5
# Checking IF $rmurl is accessible m if YES then continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
echo
echo -e "$COL_GREEN Checking if $rmurl is accessible in order to proceed further. . .!! $COL_RESET"
cd /temp
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 -q $rmurl/rm4.txt
{
if [ ! -f /temp/rm4.txt ]; then
echo
echo -e "$COL_RED ERROR: Unable to contact $rmurl, or possibly internet is not working or your IP is in black list at destination server !! $COL_RESET"
echo -e "$COL_RED ERROR: Please check manual if $rmurl is accessible or not or if it have required files, JZ !! $COL_RESET"
exit 0
fi
}
rm -fr /temp/rm4.txt
sleep 6
######################
clear
# Selection choice menu of RM version 4.0 or 4.1
echo -e "$COL_GREEN ########################################### $COL_RESET"
echo -e "$COL_GREEN Select the type of your operating system: $COLRESET"
echo -e "$COL_GREEN Syed Jahanzaib / aacable@hotmail.com $COLRESET"
echo -e "$COL_GREEN ########################################### $COL_RESET"
echo
echo "1. Radius Manager 4.0.4"
echo "2. Radius Manager 4.1.0"
echo
echo -n "Choose an option: [1] "
read rmver
if [ -z "$rmver" ]; then
rmver="1"
fi
case $rmver in
1 ) echo "Selected RM version is: 4.0.4 [Old]"
# Download radius manager 4.0.4 in $temp folder
echo .
echo -e "$COL_GREEN Downloading RADIUS MANAGER 4.0.4 package from INTERNET . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
defver="radiusmanager-4.0.4.tgz"
defverdir="radiusmanager-4.0.4"
sleep 3
# Updating apt-get , to avoid update/install errors for 12.4 ONLY
# Update UBUNTU FIRST . . . [[ JZ . . . ]]
echo -e "$COL_GREEN Updating UBUNTU . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get dist-upgrade
sudo apt-get update --fix-missing
sudo apt-get update
# Downloading Radius Manager Package
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/$defver
;;
2 ) echo "Selected RM version is: 4.1.0 [Latest]"
echo -e "$COL_GREEN Downloading RADIUS MANAGER 4.1.0 package from INTERNET . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
defver="radiusmanager-4.1.0.tgz"
defverdir="radiusmanager-4.1.0"
echo .
sleep 5
# Download radius manager 4.1.0 in $temp folder
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/$defver
;;
* ) echo "Invalid selection. Installation aborted."
echo
exit
;;
esac
# Checking IF RM installation file have been downloaded. if YEs continue further , otherwise EXIT the script with ERRO ! [[ JZ .. . .]]
{
if [ ! -f /$temp/$defver ]; then
echo .
echo -e "$COL_RED ERROR: RM Installation File could not be download or found in /$temp/$defver ! ZAIB - $COL_RESET"
exit 0
fi
}
# Installing required components for RM . . . [[ JZ . . . ]]
echo .
echo -e "$COL_GREEN Installing components like MYSQL , PHP etc . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
apt-get --force-yes -y 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 apache2
# While installing above components , it may ask for mysql password, use same password as you have used before . . . [[ JZ . . . ]]
echo .
echo -e "$COL_GREEN Installing LIB packages . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
cd /$temp
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/libltdl3_1.5.24-1ubuntu1_i386.deb
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/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:
# Now Download ioncube library and add it to php . . . [[ JZ . . . ]]
echo .
echo -e "$COL_GREEN Installing IONCUBE . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/ioncube_loaders_lin_x86.tar.gz
# Checking if IONCUBE installation file have been downloaded. if YEs continue further , otherwise EXIT the script with ERROR ! [[ JZ .. . .]]
{
if [ ! -f /$temp/ioncube_loaders_lin_x86.tar.gz ]; then
echo .
echo -e "$COL_RED ERROR: COULD NOT DOWNLOAD IONCUBE !!! EXITING . . . $COL_RESET"
exit 0
fi
}
tar xvf ioncube_loaders_lin_x86.tar.gz
mkdir /usr/local/ioncube
cd /$temp/ioncube
cp -fr * /usr/local/ioncube/
# Now Add the appropriate ionCube loader to your php.ini . . . [JZ]
echo .
echo -e "$COL_GREEN Adding iONCUBE in PHP . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so" >> /etc/php5/apache2/php.ini
echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so" >> /etc/php5/cli/php.ini
cd /$temp
echo .
echo -e "$COL_GREEN Downloading FREERADiUS 2.2.20-dma-patch-2 package . Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 5
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 $rmurl/freeradius-server-2.2.0-dma-patch-2.tar.gz
# Checking if FREERADIUS is downloaded, just to make sure internet is working ,IF NOT, EXIT the script with ERROR ! [[ JZ .. . .]]
{
if [ ! -f /$temp/freeradius-server-2.2.0-dma-patch-2.tar.gz ]; then
echo .
echo -e "$COL_RED ERROR: COULD NOT DOWNLOAD FREERADIUS 2.2.20-dma-patch-2, possible INTERNET is not Working !!! EXITING . . . Syed Jahanzaib $COL_RESET"
exit 0
fi
}
echo .
echo -e "$COL_GREEN Compiling FREERADIUS . Sleeping for 3 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
mv freeradius-server-2.2.0-dma-patch-2.tar.gz freeradius-server-2.2.0-dma-patch-2.tar
tar xvf freeradius-server-2.2.0-dma-patch-2.tar
cd freeradius-server-2.2.0/
### Now proceed with the compilation of FREERAIDUS , applicable for all
./configure
make
make install
ldconfig
# Set the correct ownership on FreeRadius configuration files
chown $httpuser /usr/local/etc/raddb
chown $httpuser /usr/local/etc/raddb/clients.conf
# ================================================================
# Creating MySQL databases with MySQL command line tool . . . [JZ]
# ================================================================
# ** FROM CLI ** . . . [JZ]
echo .
echo -e "$COL_GREEN adding RADIUS user & DB in MYSQL . syed jahanzaib. Sleeping for 5 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 1
mysql -u $SQLUSER -p$SQLPASS -e "create database radius";
mysql -u $SQLUSER -p$SQLPASS -e "create database conntrack";
mysql -u $SQLUSER -p$SQLPASS -e "CREATE USER '$myusr_rad'@'$radhost' IDENTIFIED BY '$mypsw_radius';"
mysql -u $SQLUSER -p$SQLPASS -e "CREATE USER '$myusr_cts'@'$radhost' IDENTIFIED BY '$mypsw_cts';"
mysql -u $SQLUSER -p$SQLPASS -e "GRANT ALL ON radius.* TO radius@$radhost;"
mysql -u $SQLUSER -p$SQLPASS -e "GRANT ALL ON conntrack.* TO conntrack@$radhost;"
# Check if $DB (in this case radius ) is accessible or not, if NOT, then exit the script
RESULT=`mysql -u $SQLUSER -p$SQLPASS --skip-column-names -e "SHOW DATABASES LIKE '$RADIUSDB'"`
if [ "$RESULT" == "$RADIUSDB" ]; then
echo "-$DB database exist OK. Proceeding further ..."
else
echo "-$DB database does not exist! Probably either mysql not accessible or wrong credentials provided. Re run the script (by zaib)"
exit 1
fi
# Time to Install RADIUS MANAGER 4.x.x . . . [JZ]
# ===============================================
cd /$temp
tar zxvf $defver
cd /$temp/$defverdir
echo .
echo -e "$COL_GREEN Starting RADIUS MANAGER install script install.sh . Sleeping for 3 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
echo "Radius Manager installer $defver for Ubuntu ONLY ****" [ JZ ]
echo "Copyright 2004-2012, DMA Softlab LLC"
echo "All right reserved."
echo
echo .
echo -e "$COL_GREEN (Use CTRL+C to abort any time) . Sleeping for 3 Seconds . . (Press CTRL+C to stop any time) $COL_RESET"
sleep 3
# copy web content
echo Copying Radius Manager WEB content to $wwwpath/radiusmanager
cp -fr www/radiusmanager $wwwpath
# rename .dist files
# Zaib / copy paypal cfg file so that user.php may not be missed
mv $wwwpath/radiusmanager/config/payfast_cfg.php.dist $wwwpath/radiusmanager/config/payfast_cfg.php
mv $wwwpath/radiusmanager/config/paypal_cfg.php.dist $wwwpath/radiusmanager/config/paypal_cfg.php
mv $wwwpath/radiusmanager/config/netcash_cfg.php.dist $wwwpath/radiusmanager/config/netcash_cfg.php
mv $wwwpath/radiusmanager/config/authorizenet_cfg.php.dist $wwwpath/radiusmanager/config/authorizenet_cfg.php
mv $wwwpath/radiusmanager/config/dps_cfg.php.dist $wwwpath/radiusmanager/config/dps_cfg.php
mv $wwwpath/radiusmanager/config/2co_cfg.php.dist $wwwpath/radiusmanager/config/2co_cfg.php
# set ownership and permissions
chown $httpuser $wwwpath/radiusmanager/config
chown $httpuser $wwwpath/radiusmanager/config/system_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/paypal_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/netcash_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/authorizenet_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/dps_cfg.php
chown $httpuser $wwwpath/radiusmanager/config/2co_cfg.php
#chown $httpuser $wwwpath/radiusmanager/tmpimages
chown $httpuser $wwwpath/radiusmanager/tftpboot
chmod 600 $wwwpath/radiusmanager/config/system_cfg.php
chmod 600 $wwwpath/radiusmanager/config/paypal_cfg.php
chmod 600 $wwwpath/radiusmanager/config/netcash_cfg.php
chmod 600 $wwwpath/radiusmanager/config/authorizenet_cfg.php
chmod 600 $wwwpath/radiusmanager/config/dps_cfg.php
chmod 600 $wwwpath/radiusmanager/config/2co_cfg.php
chmod 644 $wwwpath/radiusmanager/config/docsis_keyfile
chmod 644 $wwwpath/radiusmanager/config/docsis_template
# Adding tmpimage folder for CAPTCHA images (Zaib)
mkdir /var/www/radiusmanager/tmpimages
chown $httpuser $wwwpath/radiusmanager/tmpimages
# chmod and copy binaries
echo "Copying binaries to /usr/local/bin"
chmod 755 bin/rm*
cp -fr bin/rm* /usr/local/bin
echo "Copying rootexec to /usr/local/sbin"
cp -fr bin/rootexec /usr/local/sbin
chmod 4755 /usr/local/sbin/rootexec
# chmod and copy radiusmanager.cfg
echo "Copying radiusmanager.cfg to /etc"
cp -fr etc/radiusmanager.cfg /etc
chown root /etc/radiusmanager.cfg
chmod 600 /etc/radiusmanager.cfg
# create or upgrade tables
echo "Creating MySQL tables ..."
mysql -h $radhost -u $myusr_rad -p$mypsw_radius radius < sql/radius.sql
mysql -h $radhost -u $myusr_cts -p$mypsw_cts conntrack < sql/conntrack.sql
# create rmpoller service
echo "Enabling rmpoller service at boot time ..."
cp -fr rc.d/rmpoller /etc/init.d
chown root.root /etc/init.d/rmpoller
chmod 755 /etc/init.d/rmpoller
update-rc.d rmpoller defaults 99
# create rmconntrack service
echo "Enabling rmconntrack service at boot time"
cp -fr rc.d/rmconntrack /etc/init.d
chown root.root /etc/init.d/rmconntrack
chmod 755 /etc/init.d/rmconntrack
update-rc.d rmconntrack defaults 99
# copy radiusd init script
echo "Enabling radiusd service at boot time"
chmod 755 rc.d/debian/radiusd
cp -fr rc.d/debian/radiusd /etc/init.d
update-rc.d radiusd defaults 99
# copy logrotate script
echo "Copying logrotate script"
cp -fr etc/logrotate.d/radiusd /etc/logrotate.d/radiusd
# copy cron job script
echo "Copying cronjob script"
cp -fr etc/cron/radiusmanager /etc/cron.d/radiusmanager
chmod 644 /etc/cron.d/radiusmanager
# comment out the old style cron job
sed -i 's/02\ 0\ \*\ \*\ \*\ root\ \/usr\/bin\/php/#2\ 0\ \*\ \*\ \*\ root\ \/usr\/bin\/php/g' /etc/crontab
# replace strings in cfg files for Debian
echo .
echo -e "$COL_GREEN Setting Debina base WWW dir in configuration files . . .!$COL_RESET"
sed -i 's/var\/lib\/mysql\/mysql.sock/var\/run\/mysqld\/mysqld.sock/g' /etc/radiusmanager.cfg
sed -i 's/var\/www\/html/var\/www/g' /etc/radiusmanager.cfg
sed -i 's/var\/www\/html/var\/www/g' /etc/cron.d/radiusmanager
sed -i 's/var\/www\/html/var\/www/g' /var/www/radiusmanager/config/system_cfg.php
# set permission on raddb files
echo "Setting permission on raddb files"
chown $httpuser /usr/local/etc/raddb
chown $httpuser /usr/local/etc/raddb/clients.conf
echo
echo .
echo -e "$COL_GREEN Radius manager Installation complete! copying license files ... $COL_RESET"
echo
# Now copy the two license files (that you receive from DMASOFTLAB) in /var/www/radiusmanager . . . [JZ]
#cp -fr lic.txt /var/www/radiusmanager/
#cp -fr mod.txt /var/www/radiusmanager/
echo .
echo .
echo -e "$COL_GREEN Re-Starting Apache2, Radius and mySQL Service$COL_RESET"
echo .
service radiusd start
service apache2 restart
service mysql restart
echo .
echo .
echo .
echo .
echo .
echo -e "$COL_GREEN All Done. Please copy the license files in /var/www/radiusmanager folder and then access ADMIN panel via http://yourip/radiusmanager/admin.php $COL_RESET"
echo -e "$COL_GREEN RM Installation script by SYED JAHANZAIB / aacable@hotmail.com $COL_RESET"

Save & Exit …


Now execute the script by

/rm-ubuntu-32bit.sh


 

After the script ends, do make sure that you don’t see Error’s  on the installation. That’s why I have added 3-5 Seconds delay in each section so you can view the results.

Now UPLOAD your valid License into /var/www/radiusmanager

Now Try to access RM ACP via browser by

http://yourip/radiusmanager/admin.php

 

If you get blank page, then use tail command to view Apache error log , example

tail -f /var/log/apache2/error.log

 

OR more specifically

tail -f /var/log/apache2/error.log |grep lic

 

If you see any error like showed in the image below . . . (for not valid license), then make sure your license files are valid for right version and with the right mac address interface.

 

rm-lic-error


 

To deploy Radius Manager Patch 5 (4.1.5) , Kindly see the following Link

https://aacable.wordpress.com/2014/02/28/radius-manager-4-1-patch5-deployment/

I will add few snapshots and video as soon as I get some time.


TIP#1: Clone MAC Address:

1
2
3
4
5
touch /etc/fw.sh
chmod +x /etc/fw.sh
nano /etc/fw.sh

and paste following, then save & exit.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Very Basic Level of Firewall with Fake MAC address support
# To support x/x/x.x.x.x.xx.x
# Script by Syed Jahanzaib
# 21-FEB-2016
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# Adding FAKE interface for RM
ip link add link eth0 address 00:0C:29:XX:XX:XX eth0.1 type macvlan
ifconfig eth0.1 up
ifconfig eth0.1 1.2.3.4 netmask 255.255.255.255
service apache2 restart

TIP#2: Block access to radiusmanager folder listing [ disable directory browsing]

If you want to Disable Browsing on every folder inside /var/www/ then Edit following file

nano /etc/apache2/sites-available/default

& Change the Options

‘Indexes FollowSymLinks MultiViews’
to
‘Options FollowSymLinks MultiViews’

(means Remove the Indexes word which allows directory listing).
and restart apache2 service by

service apcahe2 restart


 

Regard’s

IT & NETWORK SOLUTION