Daloradius Installation on CentOS 7
FreeRADIUS, the open source implementation of RADIUS, an IETF protocol for AAA (Authorisation, Authentication, and Accounting).
Disable SELinux
# setenforce 0
Edit file /etc/selinux/config and set:
SELINUX=disabled
Install MariaDB/MySQL
Edit MariaDB.repo file:
# vi /etc/yum.repos.d/MariaDB.repo
[mariadb] name=MariaDB baseurl=http://yum.mariadb.org/10.3.9/centos7-amd64/ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
Install MariaDB and start services:
# yum update # yum install mariadb-server mariadb # yum -y install freeradius freeradius-utils freeradius-mysql httpd httpd-devel # systemctl start httpd # systemctl enable httpd # systemctl enable radiusd.service
Start and enable MySQL service
# systemctl start mariadb # systemctl enable mariadb
Improve the security of your MariaDB and set a password for root account
# mysql_secure_installation # mysql -u root -p CREATE DATABASE radius; GRANT ALL ON radius.* TO radius@localhost IDENTIFIED BY "radiuspassword"; FLUSH PRIVILEGES; \q
Import SQL Database and Create a Soft Link
# mysql -u root -p radius < /etc/raddb/mods-config/sql/main/mysql/schema.sql # ln -s /etc/raddb/mods-available/sql /etc/raddb/mods-enabled/
Install PHP
# yum -y install php mod_php php-cli php-mysqlnd php-devel php-gd php-mcrypt php-mbstring php-xml php-pear # yum -y install php-dba # pear install pear # pear install --force DB # apachectl restart
Configure Database Connection
# vi /etc/raddb/mods-available/sql
Set:
sql {
driver = “rlm_sql_mysql”
dialect = “mysql”
server = “localhost”
port = 3306
login = “radius”
password = “radiuspassword”
radius_db = “radius”
read_clients = yes
client_table = “nas”
# ln -sf /etc/raddb/mods-available/sql /etc/raddb/mods-enabled/ # chgrp -h radiusd /etc/raddb/mods-enabled/sql
Installing Daloradius GUI
# cd # wget https://github.com/lirantal/daloradius/archive/master.zip # unzip master.zip # rm master.zip # mv daloradius-master/ daloradius # cd daloradius
Import Daloradius MySQL
# mysql -u root -p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sql # mysql -u root -p radius < contrib/db/mysql-daloradius.sql # cd .. # mv daloradius /var/www/html # chown -R apache:apache /var/www/html/daloradius/ # chmod 664 /var/www/html/daloradius/library/daloradius.conf.php
Change MySQL Configuration
# vi /var/www/html/daloradius/library/daloradius.conf.php
CONFIG_DB_USER
CONFIG_DB_PASS
CONFIG_DB_NAME
Open FirewallD Ports
# firewall-cmd --zone=public --add-service=radius --permanent # firewall-cmd --permanent --zone=public --add-rich-rule=' rule family="ipv4" source address="Your_IP" port protocol="tcp" port="80" accept' # firewall-cmd --reload
Restart services
# systemctl restart radiusd.service # systemctl restart mariadb.service # systemctl restart httpd
Access the web interface
http://FQDN_OF_SERVER/daloradius/login.php
User: administrator
Pass: radius