This quick guide assumes you are root or using sudo on a fresh install of Ubuntu Server 20.04.
Install apache2, MariaDB, and PHP
Install Apache
apt install apache2
Install PHP
sudo apt install php libapache2-mod-php php-{gd,common,mail,mailmime,mysql,pear,db,mbstring,xml,curl}
Install MariaDB
apt install mariadb-server mysql_secure_installation
Install FreeRADIUS w/ MariaDB
Install FreeRADIUS
apt install freeradius freeradius-mysql freeradius-utils systemctl enable
–now freeradius
Use MariaDB with FreeRADIUS
Login to MariaDB with the password you just created. Remember to replace password with
your own password.
mysql -u root -p
Create database and database user.
MariaDB [(none)]> CREATE DATABASE radius;
MariaDB [(none)]> GRANT ALL ON radius.* TO radius@localhost IDENTIFIED BY “password”;
MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]> quit
Import FreeRADIUS schema into MariaDB.
mysql -u root -p radius < /etc/freeradius/3.0/modsconfig/sql/main/mysql/schema.sql
Link to the SQL module.
ln -s /etc/freeradius/3.0/mods-available/sql /etc/freeradius/3.0/modsenabled/
Edit the FreeRADIUS config file at /etc/freeradius/3.0/mods-enabled/sql
- Change dialect =
“sqlite”
todialect = “mysql”
. - Comment out
driver = “rlm_sql_null”
and uncomment driver =“rlm_sql_${dialect}”
- Comment out the entire
tls
section. We will not be using TLS here. - Uncomment the Connection
info:
section and fill out the database details using the values you created previously. - Uncomment
read_clients = yes
.
Fix file ownership.
chgrp -h freerad /etc/freeradius/3.0/mods-available/sql chown -R
freerad:freerad /etc/freeradius/3.0/mods-enabled/sql
Restart FreeRADIUS.
systemctl restart freeradius.service
*this is unfinished*