This short tutorial will guide you how to Install FreeRadius + mysql support on Centos 6.2 x64. An ideal base to use with HostBill FreeRadius module
For other OS/versions/architectures installation process is very similar
Install packages
Login to your server/vps shell, execute following commands:
Code Block |
---|
|
# yum install mysql-server.x86_64 freeradius.x86_64 freeradius-mysql.x86_64 freeradius-utils.x86_64 -y |
This will install latest stable freeRADIUS server
Create Database
First you need to start mysql server, do so using:
Code Block |
---|
|
# service mysqld start |
Next, login into mysql as root using command:
In mysql console create new database for freeradius
Code Block |
---|
|
mysql> CREATE DATABASE freeradius; |
You need to create new user for freeradius db.
Code Block |
---|
|
mysql> GRANT ALL ON freeradius.* TO radius@localhost IDENTIFIED BY "FreeRadiusPassword"; |
Note: If your HostBill resides on different server you need to add remote access, do so using:
Code Block |
---|
|
mysql> GRANT ALL ON freeradius.* TO radius@'HOSTBILL_IP' IDENTIFIED BY "FreeRadiusPassword"; |
Now its time to create required tables. Exit mysql console, and type in:
Code Block |
---|
|
mysql freeradius < /etc/raddb/sql/mysql/schema.sql |
Enabling sql support in FreeRADIUS
Edit file:
Code Block |
---|
|
# vi /etc/raddb/sql.conf |
Under #Connection info update your db details:
Code Block |
---|
|
server = "localhost"
login = "radius"
password = "FreeRadiusPassword"
radius_db = "freeradius" |
Edit file:
Code Block |
---|
|
# vi /etc/raddb/radiusd.conf |
Uncomment this line:
Code Block |
---|
|
$INCLUDE sql.conf |
Edit file:
Code Block |
---|
|
# vi /etc/raddb/sites-available/default |
Uncomment this line:
under sections:
Code Block |
---|
|
authorize {
accounting { |
Ucomment sql line in /etc/raddb/sites-available/inner-tunnel under authorize {
Edit secret word
Go to file
Code Block |
---|
|
# vi /etc/raddb/clients.conf |
and edit secret to new value