Linux Build Freeradius Server

Source: Internet
Author: User
Tags pear freeradius

Related Websites

Freeradius Download Link https://github.com/FreeRADIUS/freeradius-server/tree/v3.0.x

System version: CentOS Linux release 7.3.1611 (Core)

Freeradius: Https://github.com/FreeRADIUS/freeradius-server/archive/v3.0.x.zip

There is nothing on my system installed, here to download some of the required packages, here, I use Yum to install the PHP RPM package will automatically install the Apache service, so here I do not install Apache, if you do not have Apache in PHP rpm package with Yum Install-y httpd installation.

Yum install-y php php-gd wget gcc gcc-c++ unzip Php-mysql Libtalloc-devel Freeradius-mysql

Daloradius Management Interface need to use php-pear-db , but this package is not available in the CentOS default Yum source, so use the go-pear to install the installation.

wget Http://pear.php.net/go-pear.phar

PHP Go-pear.phar

650) this.width=650; "src=" Http://note.youdao.com/yws/res/1010/WEBRESOURCE292ed1ac6f71660140f5ad78272ff5df "/>

Here we choose the path to install, directly enter the installation in the default path on it

Vi/etc/profile Add the following configuration on the last line (use the uppercase GG in the VI view to go directly to the last line)

Export Path=/usr/bin/pear: $PATH

Pear system environment is added, save exit

Source/etc/profile

Reload the system environment

Pear Install db

this php-pear-db the bag is ready to be installed.

Here we ask to modify the/etc/php.ini file, here we select Y, let it modify the PHP configuration file

On the firewall to release the port we need to use, Freeradius need to use 1812 and 1813 ports, 1812 port for authentication, 1813 port for billing

Also need to release 80 port or 443 port

Firewall-cmd--permanent--zone=public--add-service=http

Firewall-cmd--permanent--zone=public--add-service=https

Firewall-cmd--permanent--zone=public--add-port=1812/tcp

Firewall-cmd--permanent--zone=public--add-port=1813/tcp

Firewall-cmd--reload

Firewall-cmd--state

Can be used to see if the firewall is enabled

Install MySQL database below

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

RPM-IVH mysql-community-release-el7-5.noarch.rpm

Yum Install Mysql-community-server Mysql-devel

Service mysqld Start

Start the MySQL database

/usr/bin/mysqladmin-u root Password "123456"

Used to set the MySQL initial password

The packages required for the lamp platform and the Freeradius and Dalofreeradius management platforms are all installed, and the next step is to install Freeradius and Dalofreeradius.

wget Https://github.com/FreeRADIUS/freeradius-server/archive/v3.0.x.zip

Unzip V3.0.x.zip

CD freeradius-server-3.0.x/

./configure--with-openssl=no && make && make install

cd/usr/local/etc/raddb/

Vi/usr/local/etc/raddb/users

650) this.width=650; "src=" Http://note.youdao.com/yws/res/904/WEBRESOURCE34458b23c60f284f7ca6b3ab7f4572c9 "/>

Remove the # at the arrows. Then save the exit.

Run Radiusd-x Debug Freeradius, open a window

650) this.width=650; "src=" Http://note.youdao.com/yws/res/913/WEBRESOURCE1c45ac5a2000a09150e78f86b76641ec "/>

Radtest Steve testing localhost 1812 testing123

Run the above command, if you see a hint in the Freeradius, stating that the build was successful.

This is very complex and difficult to manage with files, so here we use a web graphical management and a MySQL database to store the data.

Because Dalofreeradius graphics management a bit of a problem, so here to modify the next Freeradius database

Vi/usr/local/etc/raddb/mods-config/sql/ippool/mysql/schema.sql

650) this.width=650; "src=" http://note.youdao.com/yws/res/934/WEBRESOURCE8883b479391615d716b682a7d7e7d50c "/>

Add default values for all fields.

Cd/usr/local/etc/raddb/mods-config/sql/main/mysql

Mysql-uroot-p

mysql> cerate database radius;

mysql> use RADIUS;

Mysql> Source/usr/local/etc/raddb/mods-config/sql/main/mysql/schema.sql;

Freeradius database is added, next to set up Freeradius associated MySQL database

Vi/usr/local/etc/raddb/sites-enabled/default

Edit the default file and use VI text Search to comment out all files and radutmp in front Plus #, in search of SQL text, uncomment the SQL text, and cancel the # number.

650) this.width=650; "src=" Http://note.youdao.com/yws/res/953/WEBRESOURCEfa4c41e95ad35f7017b31e84f1096ea4 "/>

Modify Rlm_sql_null to Rlm_sql_mysql

650) this.width=650; "src=" Http://note.youdao.com/yws/res/956/WEBRESOURCE2880d559d49e57a6b41b70e963c526ad "/>

Cancel the Database Settings comment (#) and then add the database information

650) this.width=650; "src=" http://note.youdao.com/yws/res/961/WEBRESOURCEa7b1e8fdfc1825c42320a7409ff5a18e "/>

Cancels the comment (#) and, if the configuration is commented, reads the NAS data from the clients file, cancels the comment, indicating that the NAS data is read from the MySQL database

Ln-s/usr/local/etc/raddb/mods-available/sql/usr/local/etc/raddb/mods-enabled/sql

Since Freeradius needs to read the SQL file in the mods-enabled directory, and Mods-enabled does not have the SQL file, this is a link from mods-available to SQL. You can also copy the SQL file to mods-enabled, but if you need to modify the SQL file, you need to modify the SQL file in two directories, so here I use a link, only need to modify a SQL file to

Cp/usr/local/sbin/rc.radiusd/etc/init.d/radiusd

Copy the Freeradius boot file to the/etc/init.d/directory

By this Freeradius installation is complete, the following to install the Daloradius management interface

Cd/var/www/html

wget https://nchc.dl.sourceforge.net/project/daloradius/daloradius/daloradius0.9-9/daloradius-0.9-9.tar.gz

Tar zxvf daloradius-0.9-9.tar.gz

MV Daloradius-0.9-9 Dalor

vi/var/www/html/daloradius/library/daloradius.conf.php

650) this.width=650; "src=" http://note.youdao.com/yws/res/998/WEBRESOURCE3a23e223024fc7118dcb9adf1ed8c12c "/>

Add Database Information

650) this.width=650; "src=" http://note.youdao.com/yws/res/1027/WEBRESOURCE26f4e414fc2a8e3806d5ade9bacbff08 "/>

The first marked is the proxy.conf file directory, which is located in the root directory of the Freeradius service.

The second place is marked with the Dolaradius installation directory, and I put Dolaradius in the/var/www/html directory

650) this.width=650; "src=" Http://note.youdao.com/yws/res/1043/WEBRESOURCEbe9132bdc1e96c9409ab459ae9fcddaa "/>

See Dolaradius error, but the user still added success, this is because Dolaradius very old, has been a long time no update, MySQL database has some local changes to increase security, so here to make some changes to the MySQL database

Vi/etc/my.cnf

650) this.width=650; "src=" Http://note.youdao.com/yws/res/1054/WEBRESOURCE74165cb50a5e095c901f1f3d0102b5fe "/>

Remove the Strict_trans_tables configuration.

Restart MySQL Database

Service mysqld Restart

Now there's no error in creating a new user.

To this dolaradius also installed completed


This article from the "Technical Exchange" blog, reproduced please contact the author!

Linux Build Freeradius Server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.