Build
From FreeRADIUS Wiki
Contents |
Building FreeRADIUS
Supported Platforms
FreeRADIUS is known to run on a large number of 32 and 64bit platforms, however building on some of them may require following special procedures here
Building from Source
If your operating system has support for a package manager such as .deb or .rpm file format, we recommend that you follow the instructions in the next section instead.
bash$ tar zxvf freeradius-[version].tar.gz bash$ ./configure bash$ make bash$ su - root bash# make install
Don't forget to read supplied documentation first, including the configuration files. As with many free software projects, FreeRADIUS could use more documentation. Until such documentation is available, the only place that configuration items are documented is in the configuration files themselves.
If you have problems when trying to run FreeRADIUS, and you see error messages like:
rlm_sql: Could not link driver rlm_sql_mysql: file not found
Then the shared libraries on your system are misconfigured.
Building on MAC OSX
Note: These instructions are for FreeRADIUS 1.1.3
# ./configure --enable-developer # make # sudo make install
and freeradius runs and responds to radtest.
another way would be "./configure", then remove the option "-s" in the line "INSTALLSTRIP = -s", then "make", "sudo make install", dont now about additional differences to "--enable-developer" (except from warning flags).
but i should point out that i do not use any sql-module (do not have the libraries installed which were required) or unixodbc, and have no libgdbm, so there is no rlm_counter, rlm_ippool. maybe there is your problem? i am using a recent mac os 10.4.7 on an "ancient" g4 powerbook.
Building on Solaris 10
Method 1
I am quite pleased to report I have, with minimal discomfort, version 1.1.3 running on Solaris 10 (sparc). These instructions should also work on Solaris 10 (x86_64) with minimal changes.
The source actually compiles perfectly once OS dependencies etc. are met. I will share a few tips here for any who may be attempting the same. My main goal was LDAP functionality. Other bells and whistles might require additional steps.
Solaris System Headers
Solaris 10 will likely require you to fix the system headers.
http://sunfreeware.com/indexsparc10.html
Do the following as root:
cd /usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2/install-tools/ vi mkheaders.conf
Then put the line "SHELL=/bin/sh" on the first line of the mkheaders.conf file. It should look something like the following:
SHELL=/bin/sh SYSTEM_HEADER_DIR="/usr/include" OTHER_FIXINCLUDES_DIRS="" FIXPROTO_DEFINES="" STMP_FIXPROTO="stmp-fixproto" STMP_FIXINC="stmp-fixinc"
Then you run the following command as root. It may take several minutes to rebuild the headers.
./mkheaders
Solaris Packages
Solaris 10 has versions of openssl and openLDAP installed I believe with the system however they do not fullfill the compile requirements for freeradius functionality. You should go to http://sunfreeware.com/ and get the packages there, and also resolve any unmet dependencies.
If you have other modules you are concerned with that are not building correctly, don't trust the OS packages. Look for equiv packages and try the build with them installed as well.
download package gunzip packagename.gz sudo pkgadd -d packagename
Installing FreeRadius
Installing actually went off without a hitch. ./configure, make, sudo make install
No problems except I needed the packages so rlm_ldap would compile properly.
Runtime Environment
In order for the ldap queries to work, the following needs to be set as an environmental variable, OR if you're handy with compiler flags you can take care of it during the compile with the `-RLIBDIR' linker flag.
export LD_LIBRARY_PATH="/usr/local/lib/;/usr/local/freeradius-1.1.3/lib"
The two locations in the above path are for access to the libgcc_s.so.1 libraries and the rlm_ldap libraries respectively.
Method 2
Notes for building on Solaris. (SPARC or x86 shouldn't matter)
Specific info for this method.
- I get some packages and libraries from Blastwave which installs everything into the base /opt/csw
- For this I built my own mysql, installed in /usr/local.
- Solaris uses a different runtime link loading method than linux (which uses ldconfig). For this reason, you either set -R (runtime flags) alongside -L flags during compilation and loading OR set LD_LIBRARY_PATH at runtime, which then defines a pathlike structure for loading libs at runtime. NOTE. Setting LD_LIBRARY_PATH negates and runtime paths already encoded in binaries.
- I use -R for the same reason I build most software server from source. I want to know what,which and where stuff goes and which versions of such my stuff is linked to....
Building
From the above the next few lines can be used to build freeradius on solaris. (realistically I use this approach to build any software.)
# export PATH=/usr/sbin:/usr/bin:/opt/csw/bin:/opt/csw/gcc3/bin:/usr/ccs/bin:/opt/SUNWspro/bin # export CFLAGS='-I/usr/local/openldap/include/ -I/usr/local/mysql/include/mysql/ -I/opt/csw/include/' # export LDFLAGS='-L/usr/local/openldap/lib/ -R/usr/local/openldap/lib -L/usr/local/mysql/lib -R/usr/local/mysql/lib -L/opt/csw/lib -R/opt/csw/lib' # export LD_OPTIONS='-L/usr/local/openldap/lib/ -R/usr/local/openldap/lib -L/usr/local/mysql/lib -R/usr/local/mysql/lib -L/opt/csw/lib -R/opt/csw/lib' # ./configure --prefix=/usr/local/freeradius-1.1.2-mysql-ldap --with-ldap --with-mysql-dir=/usr/local/mysql-5.0.21 # gmake # gmake install
Running
- to follow... an SMF manifest to run freeradius in solaris 10.
Building Packages
If your operating system has a packaging system (dpkg, rpm, tgz), its usually better to build and install a new package instead of directly installing from source.
Note: Prebuilt binary packages are available for a number of Operating Systems.
Building Debian packages
If you're using Debian GNU/Linux, it's best to build FreeRADIUS packages using dpkg-buildpackage (Installing directly from source confuses dpkg about the files installed on the system and it's not possible to uninstall the files later)
$ tar zxf freeradius-1.1.7.tar.gz $ cd freeradius-1.1.7 $ fakeroot dpkg-buildpackage -b -uc $ sudo dpkg -i ../freeradius_1.1.7-0_i386.deb
Notes:
- If you don't have dpkg-buildpackage do the following :
# apt-get install dpkg-dev
- If you build the package as root (not recommended) you won't need fakeroot and sudo.
Building RedHat packages
If you're using a RPM-based distribution, you probably want to build a RPM package of FreeRADIUS.
Set up the RPM build environment.
$ cd ~ $ cp -a /usr/src/redhat/ rpmbuild $ echo '%_topdir %(echo $HOME)/rpmbuild' >> .rpmmacros
Copy the files to the source/spec directories.
$ cp freeradius-1.1.0.tar.gz ~/rpmbuild/SOURCES/ $ tar zxf freeradius-1.1.0.tar.gz freeradius-1.1.0/redhat/freeradius.spec $ cp freeradius-1.1.0/redhat/freeradius.spec ~/rpmbuild/SPECS/
Build the RPM.
$ cd ~/rpmbuild/SPECS $ rpmbuild -bb freeradius.spec
If everything goes well, the RPM package is created in the ~/rpmbuild/RPMS/i386 directory. Install the package as root.
$ su - # rpm -Uvh freeradius-1.1.0-1.i386.rpm
Building SUSE packages
On SUSE Linux it should be a simple matter of taking the latest FreeRADIUS release tarball and dropping it in /usr/src/packages/SOURCES along with the other files from the suse/ directory inside the tarball with the exception of freeradius.spec which goes in /usr/src/packages/SPECS
Then simply run:
rpmbuild -ba /usr/src/packages/SPECS/freeradius.spec
rpmbuild will tell you if you are missing any build dependencies. If so, simply install them with yast2 -i packagename-devel then rerun rpmbuild
Building SUSE packages with Oracle Support
If you wish to use Oracle you will need to recompile FreeRADIUS on a machine that has Oracle development libraries installed. FreeRADIUS is known to work both with a full Oracle installation as well as with the Oracle Instant Client SDK. Once built the resulting RPM package can be deployed with just the Oracle Instant Client (No need for the SDK on production machines)
Most rpm packages available do not included oraclesql.conf due to the fact that they also don't contain the Oracle driver module (due to copyright reasons)
On SUSE Linux if you have the Oracle header files in a sane location it should be a simple matter of taking the latest FreeRADIUS release tarball and dropping it in /usr/src/packages/SOURCES along with the other files from the suse/ directory inside the tarball with the exception of freeradius.spec which goes in /usr/src/packages/SPECS
Then edit /usr/src/packages/SPECS/freeradius.spec and change
%define _oracle_support 0
to
%define _oracle_support 1
Then simply run:
rpmbuild -ba /usr/src/packages/SPECS/freeradius.spec