Linux+FreeRadius+MySql安装搭建过程.doc
文本预览下载声明
Linux+FreeRadius+MySql安装过程
注:所用平台 RedHat linux 5.4
一、 MySQL的安装(我自己是在装linux系统时直接把mysql安装了,后来只安装了个mysql-devel)如果安装系统的时候没有安装则需要安装,可以用虚拟光盘上的RPM包(加载虚拟光驱-进入虚拟光驱目录-用find查找与mysql相关的rpm包并将这些rpm包复制到/目录下)
所涉及到的mysql的rpm包有:mysql-5.0.77-3.el5.rpm
mysql-server-5.0.77-3.el5.rpm
mysql-devel-5.0.77-3.el5.rpm
用rpm -ivh mysql-5.0.77-3.e15.rpm安装(其他两个同理)
需要说明的是mysql-devel这个包是必须得装的,很多由rpm包安装的mysql默认是没有这个包的,如果没有这个包最后Radius是启动不了的。FreeRadius需要openssl支持,安装openssl(如要在光盘里面直接找的话,方法同上mysql)rpm -ivh openssl097a-0.9.7a-9.el5_2.1.rpm二、安装FreeRadius下面安装freeradius(我用的版本是freeradius-1.1.8)下载或者拷贝freeradius-1.1.8.tar.gz软件包到 /root目录cd /roottar zxvf freeradius-1.1.8.tar.gzcd freeradius-1.1.8../configure
make
make install
然后用radiusd -X启动,如果出现
Module: Instantiated radutmp (radutmp)
Listening on authentication *:1812
Listening on accounting *:1813
Ready to process requests.
说明可以成功启动,如果不能正常启动,出现下面出错信息:
HYPERLINK /siling4/article/details/6916208error while loading shared libraries: cannot restore segment prot after reloc: Permission denied;
则需将/etc/selinux下的配置文件config中的SELINUX=enforcing,改为SELINUX=disabled,并重启系统后再运行radiusd -X。
cd /usr/local/etc/raddb
更改radiusd.conf,让其支持sql (如下,主要是将authorize {}和accouting {}里面的sql前面的#号去掉) authorize { preprocess chap mschap suffix sql } accounting { …. sql … } 更改sql.conf server=localhost login=root password=123456 // mysql的root的密码
radius_db=radius
将users中的下面两行注释掉:
DEFAULT Auth-Type = SystemFall-Through = 1
三、下面开始配置freeradius与mysql关联:
创建radius数据库??? #mysql -u root -p? //默认没有密码,直接回车??? mysqlcreate database radius;??? mysqlexit;?(b)将radius中的mysql.sql表导入到mysql的radius数据库中
mysql -u root -p radius /root/freeradius-1.1.8/doc/examples
导入后进入mysql查询是否有添加的表,在mysql后执行use radius; show tables;应该可以看到之前导入的几个表。
(c)授权? mysql grant select on radius.* to radius@localhost identified by radpass;?? mysql grant all on radius.radacct to radius@localhost; mysql grant all on radius.radpostauth to radius@localhost;
(d)加入一些组信息: mys
显示全部