| 1 |
= Building from Source |
| 2 |
|
| 3 |
We recommend xref:packages.adoc[installing from packages] if |
| 4 |
possible. Full instructions on building and installing from source |
| 5 |
code follow. |
| 6 |
|
| 7 |
The xref:installation:dependencies.adoc[dependencies] |
| 8 |
must be installed before FreeRADIUS can be built. These dependencies |
| 9 |
are `libtalloc` and `libkqueue`, which FreeRADIUS uses for memory |
| 10 |
management, and platform-independent event handling. |
| 11 |
|
| 12 |
Per-module dependencies that enable support for external services |
| 13 |
such as LDAP, SQL, etc, are optional. They must be installed for |
| 14 |
any modules that are to be used. The FreeRADIUS `./configure` step |
| 15 |
will automatically detect if each module has its dependencies met |
| 16 |
and automatically enable support for them. If the features you |
| 17 |
require are not enabled you should inspect the configure script |
| 18 |
output to figure out which additional development libraries need |
| 19 |
to be installed. |
| 20 |
|
| 21 |
include::xref:ROOT/partial$externaldoc.adoc |
| 22 |
|
| 23 |
The FreeRADIUS source may be obtained from a number of locations: |
| 24 |
|
| 25 |
* Download the latest version of the FreeRADIUS source from |
| 26 |
https://www.freeradius.org/releases/[the FreeRADIUS web site]; or |
| 27 |
* download from |
| 28 |
https://github.com/FreeRADIUS/freeradius-server/[GitHub]. |
| 29 |
|
| 30 |
The file wil be name something like: `freeradius-server-3.0.22.tar.gz`. |
| 31 |
Later versions will be `3.0.23`, or `4.0.0`, etc. PGP signatures are |
| 32 |
also provided for official releases from the FTP site; these are |
| 33 |
named e.g. `freeradius-server-3.0.22.tar.gz.sig`. |
| 34 |
|
| 35 |
Un-tar the file, and change to the FreeRADIUS directory (where |
| 36 |
`VERSION` below is the version of the server that you have |
| 37 |
downloaded). |
| 38 |
|
| 39 |
[source,shell] |
| 40 |
---- |
| 41 |
tar -zxf freeradius-server-VERSION.tar.gz |
| 42 |
cd freeradius-server-VERSION |
| 43 |
---- |
| 44 |
|
| 45 |
Take the following steps to build and install the server from source: |
| 46 |
|
| 47 |
[source,shell] |
| 48 |
---- |
| 49 |
./configure |
| 50 |
make |
| 51 |
sudo make install |
| 52 |
---- |
| 53 |
|
| 54 |
== Custom build |
| 55 |
|
| 56 |
FreeRADIUS has GNU autoconf support. This means you have to run |
| 57 |
`./configure`, and then run `make`. To see which configuration |
| 58 |
options are supported, run `./configure --help`, and read its output. |
| 59 |
|
| 60 |
The `make install` stage will install the binaries, the "man" pages, |
| 61 |
and *may* install the configuration files. If you have not installed a |
| 62 |
RADIUS server before, then the configuration files for FreeRADIUS will |
| 63 |
be installed. |
| 64 |
|
| 65 |
If you already have a RADIUS server installed, then *FreeRADIUS |
| 66 |
WILL NOT over-write your current configuration.* |
| 67 |
|
| 68 |
The `make install` process will warn you about the files it could not |
| 69 |
install. |
| 70 |
|
| 71 |
If you see a warning message about files that could not be |
| 72 |
installed, then you *must* ensure that the new server is using the |
| 73 |
new configuration files and not the old configuration files, as |
| 74 |
this may cause undesired behavior and failure to operate correctly. |
| 75 |
|
| 76 |
The initial output from running in debugging mode (`radiusd -X`) |
| 77 |
will tell you which configuration files are being used. See |
| 78 |
xref:installation:upgrade.adoc[Upgrade to v3] for information about |
| 79 |
upgrading from older versions. There _may_ be changes in the |
| 80 |
dictionary files which are required for a new version of the |
| 81 |
software. These files will not be installed over your current |
| 82 |
configuration, so you *must* verify and install any problem files by |
| 83 |
hand, for example using `diff(1)` to check for changes. |
| 84 |
|
| 85 |
When installing from source, it is _extremely_ helpful to read the |
| 86 |
output of `./configure`, `make`, and `make install`. If a |
| 87 |
particular module you expected to be installed was not installed, |
| 88 |
then the output will tell you why that module was not installed. |
| 89 |
The most likely reason is that required libraries (including their |
| 90 |
development header files) are not available. |
| 91 |
|
| 92 |
Please do _not_ post questions to the FreeRADIUS users list |
| 93 |
without first carefully reading the output of this process as it |
| 94 |
often contains the information needed to resolve a problem. |
| 95 |
|
| 96 |
== Upgrade To A New Minor Release |
| 97 |
|
| 98 |
The installation process will not over-write your existing configuration |
| 99 |
files. It will, however, warn you about the files it did not install. |
| 100 |
These will require manual integration with the existing files. |
| 101 |
|
| 102 |
It is not possible to re-use configurations between different major |
| 103 |
versions of the server. |
| 104 |
|
| 105 |
For details on what has changed between the version, see the |
| 106 |
xref:installation:upgrade.adoc[Upgrade to v3] guide. |
| 107 |
|
| 108 |
We *strongly* recommend that new major versions be installed in a |
| 109 |
different location than any existing installations. Any local policies |
| 110 |
can then be migrated gradually to the configuration format of the new |
| 111 |
major version. The number of differences in the new configuration mean |
| 112 |
that is is both simpler and safer to migrate your configurations rather |
| 113 |
than to try and just get the old configuration to work. |
| 114 |
|
| 115 |
== Run the Server |
| 116 |
|
| 117 |
If the server builds and installs, but doesn’t run correctly, then |
| 118 |
you should first use debugging mode (`radiusd -X`) to figure out |
| 119 |
the problem. |
| 120 |
|
| 121 |
This is your best hope for understanding the problem. Read _all_ |
| 122 |
of the messages which are printed to the screen, the answer to |
| 123 |
your problem will often be in a warning or error message. |
| 124 |
|
| 125 |
We really cannot emphasize that last sentence enough. Configuring |
| 126 |
a RADIUS server for complex local authentication isn’t a trivial |
| 127 |
task. Your *best* and *only* method for debugging it is to read |
| 128 |
the debug messages, where the server will tell you exactly what |
| 129 |
it’s doing, and why. You should then compare its behaviour to what |
| 130 |
you intended, and edit the configuration files as appropriate. |
| 131 |
|
| 132 |
If you don’t use debugging mode, and ask questions on the mailing |
| 133 |
list, then the responses will all tell you to use debugging mode. |
| 134 |
The server prints out a lot of information in this mode, including |
| 135 |
suggestions for fixes to common problems. Look especially for |
| 136 |
`WARNING` and `ERROR` messages in the output, and read the related |
| 137 |
messages. |
| 138 |
|
| 139 |
Since the main developers of FreeRADIUS use debugging mode to |
| 140 |
track down their configuration problems with the server, it’s a |
| 141 |
good idea for you to use it, too. If you don’t, there is little |
| 142 |
hope for you to solve any configuration problem related to the |
| 143 |
server. |
| 144 |
|
| 145 |
To start the server in debugging mode, do: |
| 146 |
|
| 147 |
[source,shell] |
| 148 |
---- |
| 149 |
radiusd -X |
| 150 |
---- |
| 151 |
|
| 152 |
You should see a lot of text printed on the screen as it starts up. If |
| 153 |
you don’t, or if you see error messages, please read the https://www.freeradius.org/documentation/freeradius-server/4.0.0/faq.html[FAQ]: |
| 154 |
|
| 155 |
|
| 156 |
If the server says `Ready to process requests.`, then it is running |
| 157 |
properly. From another shell (or another window), type |
| 158 |
|
| 159 |
[source,shell] |
| 160 |
---- |
| 161 |
radtest test test localhost 0 testing123 |
| 162 |
---- |
| 163 |
|
| 164 |
You should see the server print out more messages as it receives the |
| 165 |
request, and responds to it. The `radtest` program should receive the |
| 166 |
response within a few seconds. It doesn’t matter if the authentication |
| 167 |
request is accepted or rejected, what matters is that the server |
| 168 |
received the request, and responded to it. |
| 169 |
|
| 170 |
You can now edit the configuration files for your local system. You will |
| 171 |
usually want to start with `sites-enabled/default` for main |
| 172 |
configurations. To set which NASes (clients) can communicate with this |
| 173 |
server, edit `raddb/clients.conf`. Please read the configuration files |
| 174 |
carefully, as many configuration options are only documented in comments |
| 175 |
in the file. |
| 176 |
|
| 177 |
Note that is is *highly* recommended that you use some sort of version |
| 178 |
control system to manage your configuration, such as git or Subversion. |
| 179 |
You should then make small changes to the configuration, checking in and |
| 180 |
testing as you go. When a config change causes the server to stop |
| 181 |
working, you will be able to easily step back and find out what update |
| 182 |
broke the configuration. |
| 183 |
|
| 184 |
It is also considered a best practice to maintain a staging or |
| 185 |
development environment. This allows you to test and integrate your |
| 186 |
changes without impacting your active production environment. You should |
| 187 |
make the appropirate investment in order to properly support a critical |
| 188 |
resource such as your authentication servers. |
| 189 |
|
| 190 |
Configuring and running the server MAY be complicated. Many modules have |
| 191 |
`man` pages. See `man rlm_pap`, or `man rlm_*` for information. |
| 192 |
Please read the documentation in the doc/ directory. The comments in the |
| 193 |
configuration files also contain a lot of documentation. |
| 194 |
|
| 195 |
If you have any additional issues, the https://www.freeradius.org/documentation/freeradius-server/4.0.0/faq.html[FAQ] or https://www.freeradius.org/documentation/freeradius-server/4.0.0/trouble-shooting/index.html[Troubleshooting] guides are good places to start. |
| 196 |
|
| 197 |
|