Monday, May 11, 2009

Installation FreeRadius on Linux part 1

I take an Elastix linux distro, with PHP 5.1.6, Apache 2.2.3, MySQL 5.0.22 and FreeRadius 1.1.7.

Step by step installation and testing:
1. Download Freeradius in www.freeradius.org, take the package freeradius-1.1.7.tar.gz.
2. Untar freeradius ==> #tar-xvzf freeradius-1.1.7.tar.gz
3. Log in to freeradius directory ==> #cd freeradius
4. #./configure , if we do not enter any parameters, the results of the installation will be stored in /usr/local, either in the directory bin, sbin, etc, lib and var.
If you want to use the ldap module, we also need to install openldap and openldap-devel package.
Here are some parameters that need to be if we want to install in accordance with the laying of the directory that we want:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
For example:
#./configure --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --sysconfdir=/etc --localstatedir=/var/log --libdir=/usr/lib --includedir=/usr/include
5. #make , compile the program.
If there is an error message as follows:
In file included from rlm_sqlippool.c:37:
/usr/ports/net/freeradius/work/freeradius-1.1.2/src/include/modpriv.h:7:18:
ltdl.h: No such file or directory
In file included from rlm_sqlippool.c:37:
/usr/ports/net/freeradius/work/freeradius-1.1.2/src/include/modpriv.h:16:
error: syntax error before "lt_dlhandle"
In file included from rlm_sqlippool.c:39:
../rlm_sql/rlm_sql.h:15:18: ltdl.h: No such file or directory
In file included from rlm_sqlippool.c:39:
../rlm_sql/rlm_sql.h:68: error: syntax error before "lt_dlhandle"
gmake[6]: *** [rlm_sqlippool.lo] Error 1
Then run make again
6. #make install, all configuration file, executable file, include and library will be installed to the default installation parameters.
7. If you have finished, do the testing. First, create a user. Because I do a default installation, the configuration directory is in /usr/local/etc/raddb, edit file /usr/local/etc/raddb/users, enter the user as follows:
steve Auth-Type := Local, User-Password := "testing"
Service-Type = Framed-User,
Framed-Protocol = PPP,
Framed-Routing = Broadcast-Listen,
Framed-Filter-Id = "std.ppp",
Framed-MTU = 1500,
Framed-Compression = Van-Jacobsen-TCP-IP
8. Test with radtest tool, with format: radtest server port user password secret. Secret password can be found in /usr/local/etc/raddb/clients.conf.
Run #radtest steve testing localhost 1812 testing123
If successful a result is as follows:

If failed, the message is Access-reject, re-check the configuration if there is still a wrong configuration.
9. At this moment, installation, configuration and testing is OK.
10. For integration with MySQL, follow my next posting.

No comments:

Post a Comment