设为首页 收藏本站
查看: 845|回复: 0

[经验分享] CentOS7源码编译安装FreeRadius3.17

[复制链接]

尚未签到

发表于 2019-2-16 08:25:45 | 显示全部楼层 |阅读模式
  (一)环境简介
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安装所需的依赖包

[root@localhost raddb]#yum install  openssl openssl-devel libtalloc-devel libtalloc*  -y
[root@localhost raddb]#yum install openldap-devel python-devel  -y
  2.解压和编译安装。由于编译安装默认的路径是/usr/local/etc/raddb/下

[root@localhost opt]#wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.17.tar.gz
[root@localhost opt]# tar xf freeradius-server-3.0.17.tar.gz
[root@localhost opt]#cd freeradius-server-3.0.17
[root@localhost freeradius-server-3.0.17]#./configure
[root@localhost freeradius-server-3.0.17]#make && make install
[root@localhost freeradius-server-3.0.17]# cd /usr/local/etc/raddb/
[root@localhost 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启动服务文件

[root@localhost ~]# groupadd radiusd
[root@localhost ~]# useradd -g radiusd radiusd -s /sbin/nologin
[root@localhost ~]# 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.创建启动服务

[root@localhost opt]# systemctl enable radiusd
[root@localhost opt]# systemctl start radiusd
[root@localhost 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..
[root@localhost opt]# systemctl restart radiusd
[root@localhost 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以下的版本,具体配置如下

[root@FreeRadius2 raddb]# cp /usr/local/sbin/rc.radiusd /etc/init.d/radiused
[root@FreeRadius2 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

造成服务起不来是由于编译的时候出现warning时编译rlm_ldap失败造成的。需要libldap2-dev 库文件

=== configuring in src/modules/rlm_ldap (/opt/freeradius-server-3.0.17/src/modules/rlm_ldap)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=../../../config.cache --srcdir=.
configure: loading cache ../../../config.cache
checking for gcc... (cached) gcc
checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking for pthread_create in -lpthread... yes
> checking for ldap_init in -lldap_r... no
> checking for ldap.h... no
> configure: WARNING: silently not building rlm_ldap.
> configure: WARNING: FAILURE: rlm_ldap requires:  libldap_r ldap.h.
> configure: creating ./config.status
> config.status: creating Makefile
  解决办法是
[root@localhost mods-available]# yum install openldap-devel python-devel  -y
既可以解决。





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-672910-1-1.html 上篇帖子: VMware虚拟机安装 CentOS 6.9 下篇帖子: 安装centos7系统
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表