第三节:Centos7配置daloradius

本节内容:在Centos7 上安装daloradius、并导入daloradius数据库到mysql、daloradius数据库连接配置,登陆daloradius 查看是否正常工作

1、Centos7安装与配置daloradius

cd /var/www/html/
wget https://ncu.dl.sourceforge.net/project/daloradius/daloradius/daloradius0.9-9/daloradius-0.9-9.tar.gz
tar xzvf daloradius-0.9-9.tar.gz
mv daloradius-0.9-9 daloradius
chown -R apache:apache /var/www/html/daloradius/
chmod 664 /var/www/html/daloradius/library/daloradius.conf.php
cd /var/www/html/daloradius/

2、导入daloradius 数据库

mysql -u radius -p radius < contrib/db/fr2-mysql-daloradius-and-freeradius.sql

输入密码:passwd-radius

mysql -u radius -p radius < contrib/db/mysql-daloradius.sql

输入密码:passwd-radius

3、修改daloradis数据库连接文件

vim /var/www/html/daloradius/library/daloradius.conf.php
将
$configValues['FREERADIUS_VERSION'] = '2';
$configValues['CONFIG_DB_USER'] = 'root';
$configValues['CONFIG_DB_PASS'] = '';
修改为:
$configValues['FREERADIUS_VERSION'] = '2';
$configValues['CONFIG_DB_USER'] = 'radius';
$configValues['CONFIG_DB_PASS'] = 'passwd-radius';

注意:如果版本修改为3的话,将不显示连接日志

4、安装php-pear-DB

说明:Centos 7 默认没有php-pear-DB 安装包,否则无法进入daloradius为空白

yum -y install epel-release
yum -y install php-pear-DB

5、重启radiusd、mysql、httpd

systemctl restart mariadb.service 
systemctl restart radiusd.service
systemctl restart httpd

6、配置daloradios 日志查询

chmod 644 /var/log/messages
chmod 755 /var/log/radius/
chmod 644 /var/log/radius/radius.log
touch /tmp/daloradius.log
chmod 644 /tmp/daloradius.log
chown -R apache:apache /tmp/daloradius.log

7、访问daloradius

http://192.168.0.107/daloradius  访问

用户名:administrator

密码:radius