(一)环境简介
1.OS:Centos7.4
2.软件:Freeradiusd3.17(ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.17.tar.gz)
3.网站:https://freeradius.org/
(二)安装
1.yum安装所需的依赖包[[email protected] raddb]#yum install openssl openssl-devel libtalloc-devel libtalloc* -y
2.解压和编译安装。由于编译安装默认的路径是/usr/local/etc/raddb/下
[[email protected] opt]#wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.17.tar.gz
[[email protected] opt]# tar xf freeradius-server-3.0.17.tar.gz
[[email protected] opt]#cd freeradius-server-3.0.17
[[email protected] freeradius-server-3.0.17]#./configure
[[email protected] freeradius-server-3.0.17]#make && make install
[[email protected] freeradius-server-3.0.17]# cd /usr/local/etc/raddb/
[[email protected] raddb]# ls
certs experimental.conf mods-available panic.gdb radiusd.conf sites-enabled users
clients.conf hints mods-config policy.d README.rst templates.conf
dictionary huntgroups mods-enabled proxy.conf sites-available trigger.conf
3.配置radiusd启动服务文件
[[email protected] ~]# groupadd radiusd
[[email protected] ~]# useradd -g radiusd radiusd -s /sbin/nologin
[[email protected] ~]# vim /usr/lib/systemd/system/radiusd.service
[Unit]
Description=FreeRADIUS high performance RADIUS server.
After=syslog.target network.target ipa.service dirsrv.target krb5kdc.service
[Service]
Type=forking
PIDFile=/usr/local/var/run/radiusd/radiusd.pid
ExecStartPre=-/bin/chown -R radiusd.radiusd /usr/local/var/run/radiusd
ExecStartPre=/usr/local/sbin/radiusd -C
ExecStart=/usr/local/sbin/radiusd -d /usr/local/etc/raddb
ExecReload=/usr/local/sbin/radiusd -C
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
4.创建启动服务
[[email protected] opt]# systemctl enable radiusd
[[email protected] opt]# systemctl start radiusd
[[email protected] opt]# systemctl status radiusd
● radiusd.service - FreeRADIUS high performance RADIUS server.
Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2018-08-14 14:11:51 CST; 13min ago
Main PID: 26259 (radiusd)
CGroup: /system.slice/radiusd.service
└─26259 /usr/local/sbin/radiusd -d /usr/local/etc/raddb
Aug 14 14:11:51 localhost.localdomain systemd[1]: Starting FreeRADIUS high performance RADIUS server....
Aug 14 14:11:51 localhost.localdomain systemd[1]: Started FreeRADIUS high performance RADIUS server..
[[email protected] opt]# systemctl restart radiusd
[[email protected] opt]# systemctl status radiusd
● radiusd.service - FreeRADIUS high performance RADIUS server.
Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2018-08-14 14:25:31 CST; 1s ago
Process: 29267 ExecStart=/usr/local/sbin/radiusd -d /usr/local/etc/raddb (code=exited, status=0/SUCCESS)
Process: 29263 ExecStartPre=/usr/local/sbin/radiusd -C (code=exited, status=0/SUCCESS)
Process: 29261 ExecStartPre=/bin/chown -R radiusd.radiusd /usr/local/var/run/radiusd (code=exited, status=0/SUCCESS)
Main PID: 29270 (radiusd)
CGroup: /system.slice/radiusd.service
└─29270 /usr/local/sbin/radiusd -d /usr/local/etc/raddb
Aug 14 14:25:31 localhost.localdomain systemd[1]: Starting FreeRADIUS high performance RADIUS server....
Aug 14 14:25:31 localhost.localdomain systemd[1]: Started FreeRADIUS high performance RADIUS server..
备注:如果系统是centos6.x以下的版本,具体配置如下
[[email protected] raddb]# cp /usr/local/sbin/rc.radiusd /etc/init.d/radiused
[[email protected] raddb]# /etc/init.d/radiused start
当出现报错的时候“/usr/local/etc/raddb/mods-enabled/ldap[1]: Failed to link to module ‘rlm_ldap‘: /usr/local/lib/rlm_ldap.so: cannot open shared object file: No such file or directory
”
造成服务起不来
[[email protected] mods-available]# yum install freeradius-ldap -y
既可以解决。
原文地址:http://blog.51cto.com/liqingbiao/2159741
时间: 2024-09-30 03:13:35