Tutorial Konfigurasi Freeradius dan Daloradius di Debian 12
- Langkah 1 : Pengecekkan Source HDD atau SSD Debian
- Langkah 2 : Update System Package Debian
- Langkah 3 : Install Database Server
- Langkah 4 : Install Apache, Web Server dan PHP
- Langkah 5: Menginstal FreeRADIUS di Debian
- Langkah 6 : Konfigurasi FreeRadius
- Langkah 7 : Langkah 6: Instal dan Konfigurasi Daloradius
- Langkah 8 : Akses dolaradius di Web Interface
Pada kali ini Mas Ulin akan membuat cara install FreeRadius dan Daloradius di Debian linux. FreeRadius adalah sebuah protokol jaringan yang digunakan untuk otentikasi, otorisasi dan akuntasi pengguna jarak jauh. FreeRadius adalah server yang OpenSource yang biasanya di install pada Linux, Unix, dan System tertanam.
daloRADIUS adalah alat manajemen RADIUS berbasis web yang ditulis dalam PHP. Itu dibuat untuk memudahkan pengelolaan dan administrasi server RADIUS dan perangkat hotspot (NAS). Muncul dengan pelaporan grafis dan akuntansi, penagihan, dan fitur manajemen pengguna tingkat lanjut yang kuat.
Langkah selanjutnya akan membantu menginstal dan mengkonfigurasi freeRADIUS dan daloRADIUS di Debian Linux.
Langkah 1 : Pengecekkan Source HDD atau SSD Debian
Untuk pengecekkan bisa menggunakan perintah terminal :
sudo df -h
Kenapa perlu pengecekkan? takutnya ketika installasi ternyata muncul error dan menyebabkan gagal saat install dan konfigurasi freeRadius dan daloRadius.
Langkah 2 : Update System Package Debian
Perbarui paket system Debian terbaru dengan menggunakan perintah terminal :
sudo apt update -y
Langkah 3 : Install Database Server
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s --sudo apt install mariadb-server mariadb-client
$ sudo mariadb -u root -pCREATE DATABASE radius;GRANT ALL ON radius.* TO radius@localhost IDENTIFIED BY "StrongradIusPass";FLUSH PRIVILEGES;\q
$ mariadb -u radius -p'StrongradIusPass'Enter password:Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 34
Server version: 11.2.2-MariaDB-1:11.2.2+maria~deb12 mariadb.org binary distributionCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> SHOW DATABASES;+--------------------+| Database |+--------------------+| information_schema || radius |+--------------------+2 rows in set (0.001 sec)MariaDB [(none)]> QUITBye
Langkah 4 : Install Apache, Web Server dan PHP
sudo apt -y install apache2sudo apt -y install php libapache2-mod-php php-{gd,common,mail,mail-mime,mysql,pear,mbstring,xml,curl}
$ php -vPHP 8.2.7 (cli) (built: Jun 9 2023 19:37:27) (NTS)Copyright (c) The PHP GroupZend Engine v4.2.7, Copyright (c) Zend Technologieswith Zend OPcache v8.2.7, Copyright (c), by Zend Technologies
systemctl status apache2
Izinkan port http dan https di firewall jika ufw diaktifkan.
sudo ufw allow httpsudo ufw allow https
Langkah 5: Menginstal FreeRADIUS di Debian
sudo apt -y install vim freeradius freeradius-mysql freeradius-utils
sudo systemctl enable --now freeradius.service
$ systemctl status freeradius● freeradius.service - FreeRADIUS multi-protocol policy serverLoaded: loaded (/lib/systemd/system/freeradius.service; enabled; preset: enabled)Active: active (running) since Tue 2023-11-21 19:06:09 UTC; 15s agoDocs: man:radiusd(8)man:radiusd.conf(5)http://wiki.freeradius.org/http://networkradius.com/doc/Main PID: 15895 (freeradius)Status: "Processing requests"Tasks: 6 (limit: 4531)Memory: 78.3M (limit: 2.0G)CPU: 777msCGroup: /system.slice/freeradius.service└─15895 /usr/sbin/freeradius -fNov 21 19:06:10 deb12 freeradius[15938]: Compiling Autz-Type New-TLS-Connection for attr Autz-TypeNov 21 19:06:10 deb12 freeradius[15938]: Compiling Post-Auth-Type REJECT for attr Post-Auth-TypeNov 21 19:06:10 deb12 freeradius[15938]: Compiling Post-Auth-Type Challenge for attr Post-Auth-TypeNov 21 19:06:10 deb12 freeradius[15938]: Compiling Post-Auth-Type Client-Lost for attr Post-Auth-TypeNov 21 19:06:10 deb12 freeradius[15938]: radiusd: #### Skipping IP addresses and Ports ####Nov 21 19:06:10 deb12 freeradius[15938]: Configuration appears to be OKNov 21 19:06:10 deb12 systemd[1]: Reloaded freeradius.service - FreeRADIUS multi-protocol policy server........
Langkah 6 : Konfigurasi FreeRadius
sudo su -mariadb -u root -p radius < /etc/freeradius/*/mods-config/sql/main/mysql/schema.sq
sudo ln -s /etc/freeradius/*/mods-available/sql /etc/freeradius/*/mods-enabled/
sudo vim /etc/freeradius/*/mods-enabled/sql
sql {driver = "rlm_sql_mysql"dialect = "mysql"# Connection info:server = "localhost"port = 3306login = "radius"password = "StrongradIusPass"# Database table configuration for everything except Oracleradius_db = "radius"}# Set to ‘yes’ to read radius clients from the database (‘nas’ table)# Clients will ONLY be read on server startup.read_clients = yes# Table to keep radius client infoclient_table = "nas"
mysql {# If any of the files below are set, TLS encryption is enabled# tls {# ca_file = "/etc/ssl/certs/my_ca.crt"# ca_path = "/etc/ssl/certs/"# certificate_file = "/etc/ssl/certs/private/client.crt"# private_key_file = "/etc/ssl/certs/private/client.key"# cipher = "DHE-RSA-AES256-SHA:AES128-SHA"## tls_required = no# tls_check_cert = no# tls_check_cert_cn = no# }# If yes, (or auto and libmysqlclient reports warnings are# available), will retrieve and log additional warnings from# the server if an error has occured. Defaults to 'auto'warnings = auto}
sudo chgrp -h freerad /etc/freeradius/*/mods-available/sqlsudo chown -R freerad:freerad /etc/freeradius/*/mods-enabled/sql
sudo systemctl restart freeradius
Langkah 7 : Langkah 6: Instal dan Konfigurasi Daloradius
sudo apt -y install gitgit clone https://github.com/lirantal/daloradius.git
Konfigurasi daloradius
Impor tabel mysql Daloradius dengan perintah berikut dijalankan di terminal.
sudo su -
mariadb -u root -p radius < daloradius/contrib/db/fr2-mysql-daloradius-and-freeradius.sql
mariadb -u root -p radius < daloradius/contrib/db/mysql-daloradius.sql
Konfigurasikan detail koneksi database daloRADIUS:
sudo mv daloradius /var/www/
Buat file konfigurasi dan atur izin direktori yang benar.
cd /var/www/daloradius/app/common/includes/
sudo cp daloradius.conf.php.sample daloradius.conf.php
sudo chown www-data:www-data daloradius.conf.php
Kemudian modifikasi daloradius.conf.php dan sesuaikan informasi database MySQL.
sudo vim daloradius.conf.php
Tetapkan pengguna basis data, nama basis data, dan kata sandi.
$configValues['CONFIG_DB_HOST'] = 'localhost';
$configValues['CONFIG_DB_PORT'] = '3306';
$configValues['CONFIG_DB_USER'] = 'radius';
$configValues['CONFIG_DB_PASS'] = 'Str0ngR@diusPass';
$configValues['CONFIG_DB_NAME'] = 'radius';
Buat direktori var dan subdirektorinya, lalu ubah kepemilikannya:
cd /var/www/daloradius/
sudo mkdir -p var/{log,backup}
sudo chown -R www-data:www-data var
Konfigurasikan server web Apache
Konfigurasikan server web Apache untuk port 80 dan port 443.
sudo tee /etc/apache2/ports.conf<<EOF
Listen 80
Listen 8000
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
EOF
Buat file host Virtual Apache:
sudo tee /etc/apache2/sites-available/operators.conf<<EOF
<VirtualHost *:8000>
ServerAdmin operators@localhost
DocumentRoot /var/www/daloradius/app/operators
<Directory /var/www/daloradius/app/operators>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/daloradius>
Require all denied
</Directory>
ErrorLog \${APACHE_LOG_DIR}/daloradius/operators/error.log
CustomLog \${APACHE_LOG_DIR}/daloradius/operators/access.log combined
</VirtualHost>
EOF
Buat juga satu host virtual untuk pengguna Daloradius:
sudo tee /etc/apache2/sites-available/users.conf<<EOF
<VirtualHost *:80>
ServerAdmin users@localhost
DocumentRoot /var/www/daloradius/app/users
<Directory /var/www/daloradius/app/users>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/daloradius>
Require all denied
</Directory>
ErrorLog \${APACHE_LOG_DIR}/daloradius/users/error.log
CustomLog \${APACHE_LOG_DIR}/daloradius/users/access.log combined
</VirtualHost>
EOF
Aktifkan host virtual yang dibuat menggunakan baris perintah a2ensite.
sudo a2ensite users.conf operators.conf
Buat direktori untuk menyimpan log.
sudo mkdir -p /var/log/apache2/daloradius/{operators,users}
sudo a2dissite 000-default.conf
sudo systemctl restart apache2 freeradius
$ systemctl status apache2 freeradius● apache2.service - The Apache HTTP ServerLoaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)Active: active (running) since Tue 2023-11-21 19:38:27 UTC; 18s agoDocs: https://httpd.apache.org/docs/2.4/Process: 17080 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)Main PID: 17085 (apache2)Tasks: 6 (limit: 4531)Memory: 16.1MCPU: 137msCGroup: /system.slice/apache2.service├─17085 /usr/sbin/apache2 -k start├─17086 /usr/sbin/apache2 -k start├─17087 /usr/sbin/apache2 -k start├─17088 /usr/sbin/apache2 -k start├─17089 /usr/sbin/apache2 -k start└─17090 /usr/sbin/apache2 -k startNov 21 19:38:27 deb12 systemd[1]: Starting apache2.service - The Apache HTTP Server...Nov 21 19:38:27 deb12 systemd[1]: Started apache2.service - The Apache HTTP Server.● freeradius.service - FreeRADIUS multi-protocol policy serverLoaded: loaded (/lib/systemd/system/freeradius.service; enabled; preset: enabled)Active: active (running) since Tue 2023-11-21 19:38:27 UTC; 17s agoDocs: man:radiusd(8)man:radiusd.conf(5)http://wiki.freeradius.org/http://networkradius.com/doc/Process: 17076 ExecStartPre=/usr/sbin/freeradius $FREERADIUS_OPTIONS -Cx -lstdout (code=exited, status=0/SUCCESS)Main PID: 17091 (freeradius)Status: "Processing requests"Tasks: 6 (limit: 4531)Memory: 78.5M (limit: 2.0G)CPU: 438msCGroup: /system.slice/freeradius.service└─17091 /usr/sbin/freeradius -fNov 21 19:38:27 deb12 freeradius[17076]: Compiling Auth-Type PAP for attr Auth-TypeNov 21 19:38:27 deb12 freeradius[17076]: Compiling Auth-Type CHAP for attr Auth-TypeNov 21 19:38:27 deb12 freeradius[17076]: Compiling Auth-Type MS-CHAP for attr Auth-TypeNov 21 19:38:27 deb12 freeradius[17076]: Compiling Autz-Type New-TLS-Connection for attr Autz-TypeNov 21 19:38:27 deb12 freeradius[17076]: Compiling Post-Auth-Type REJECT for attr Post-Auth-TypeNov 21 19:38:27 deb12 freeradius[17076]: Compiling Post-Auth-Type Challenge for attr Post-Auth-TypeNov 21 19:38:27 deb12 freeradius[17076]: Compiling Post-Auth-Type Client-Lost for attr Post-Auth-TypeNov 21 19:38:27 deb12 freeradius[17076]: radiusd: #### Skipping IP addresses and Ports ####Nov 21 19:38:27 deb12 freeradius[17076]: Configuration appears to be OKNov 21 19:38:27 deb12 systemd[1]: Started freeradius.service - FreeRADIUS multi-protocol policy server.
Langkah 8 : Akses dolaradius di Web Interface
sudo pear install DBsudo pear install MDB2
- RADIUS management application: http://<ip>:8000/
- RADIUS user portal application: http://<ip>
Username: administratorPassword: radius
Posting Komentar