Radius Server: Difference between revisions

Line 207:
username: administrator
password: radius
 
=== Troubleshooting ===
 
*If you get permission denied error when importing schema:
<pre>
aman@ubuntu:~$ mysql -u root -ppwd@123 radius < /etc/freeradius/sql/mysql/schema.sql
-bash: /etc/freeradius/sql/mysql/schema.sql: Permission denied
</pre>
 
Copy the files to home dir & change the file owner:
sudo cp /etc/freeradius/sql/mysql/schema.sql ~
sudo cp /etc/freeradius/sql/mysql/nas.sql ~
sudo chown aman:aman ~/*.sql
 
*
 
INSERT INTO radcheck (UserName, Attribute, Value) VALUES ('sqltest', 'Password', ‘testpwd');
 
 
 
* If the page stops loading after login, and you get similar errors in apache error logs:
<pre>
[Sat Aug 05 20:10:51.734692 2017] [:error] [pid 22226] [client 10.101.255.53:59948] PHP Warning: include_once(DB.php): failed to open stream: No such file or directory in /var/www/daloradius/library/opendb.php on line 84, referer: http://10.107.88.93/daloradius/login.php
[Sat Aug 05 20:10:51.734877 2017] [:error] [pid 22226] [client 10.101.255.53:59948] PHP Warning: include_once(): Failed opening 'DB.php' for inclusion (include_path='.:/usr/share/php') in /var/www/daloradius/library/opendb.php on line 84, referer: http://10.107.88.93/daloradius/login.php
[Sat Aug 05 20:10:51.734988 2017] [:error] [pid 22226] [client 10.101.255.53:59948] PHP Fatal error: Uncaught Error: Class 'DB' not found in /var/www/daloradius/library/opendb.php:86\nStack trace:\n#0 /var/www/daloradius/dologin.php(49): include()\n#1 {main}\n thrown in /var/www/daloradius/library/opendb.php on line 86, referer: http://10.107.88.93/daloradius/login.php
</pre>
 
Check if all the dependancies are installed or not:
php -m
 
If DB is missing, install it:
 
sudo pear install DB
 
*If above issue still persists, then the Problem is, i had PHP7.0 installed, but daloradius is only supported until 5.0
So we have to change the rules for syntax reading:
 
Make Sure you got all necessary packages
 
sudo apt-get install php-common php-gd php-curl php-mail php-mail-mime php-pear php-db
pear install DB
 
Change Syntax:
cd /var/www/html/daloradius/library/
vim daloradius.conf.php -> CONFIG_DB_ENGINE auf "mysqli" # from mysql to mysqli
vim opendb.php -> $dbSocket->query("SET GLOBAL sql_mode = '';"); #append this line at the end of the file
 
Now we have to give the db-user freeradius super rights with:
mysql -u root -p
mysql> GRANT SUPER ON *.* TO 'freeradius'@'localhost' IDENTIFIED BY 'password';
mysql> flush privileges;
 
You might have to import a mysql schema with:
cd /var/www/html/daloradius/contrib/db/
mysql -u root -p radius <mysql-daloradius.sql
 
* If you get DB connection failed error:
sudo nano /var/www/daloradius/library/daloradius.conf.php
 
$configValues['CONFIG_DB_USER'] = 'root';
$configValues['CONFIG_DB_PASS'] = 'ppwd@123';
 
Saving the file will allow you in the Landing page.