Centos 6.5上編譯安裝freeradius3.0.12

平臺:Centos 6.5 x86_64php

 

1,安裝源並更新python

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmmysql

yum update -yc++

 

2,安裝相關庫redis

yum -y install wget expat-devel gcc make gmp-devel gmp pkgconfig perl libpcap gcc-c++ logrotate tar cpio gawk flex bison bison-devel lsof libpcap-devel patch openssl openssl-devel libgcrypt* crypt* autoconf automake libtasn1-devel zlib zlib-devel trousers trousers-devel texinfo libnl-devel libnl dbus dbus-devel ncurses-devel readline-devel libtool-ltdl libtalloc* hiredis* redhat-lsb pythonsql

 

3,安裝Mysqlshell

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm數據庫

yum install -y mysql-community-server mysql-develapache

chkconfig mysqld oncentos

service mysqld start

mysql_secure_installation

mysql -u root -p 輸入密碼

建立你須要的數據庫

 

4,安裝apache和php

yum install -y php php-mysql php-common php-devel php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash php-snmp php-process libmcrypt libmcrypt-devel httpd httpd-devel

 

wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86-64.tar.gz

tar zxvf ioncube_loaders_lin_x86-64.tar.gz

cp -rf  ioncube /usr/local/

 

sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php.ini

sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php.ini

sed -i 's/;date.timezone =/date.timezone = PRC/g' /etc/php.ini

sed -i 's/; cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php.ini

sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php.ini

sed -i 's/disable_functions =.*/disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g' /etc/php.ini

echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so" >> /etc/php.ini

 

wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz 

tar -zxvf xcache-3.2.0.tar.gz  

cd xcache-3.2.0

phpize --clean

phpize

./configure --enable-xcache

make && make install

cat xcache.ini >> /etc/php.ini

 

service httpd restart

 

5,編譯安裝freeradius

wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.12.tar.gz

tar zxvf freeradius-server-3.0.12.tar.gz 

cd freeradius-server-3.0.12

./configure --with-modules=rlm_sql_mysql  (各類WARNING,沒有ERROR)

make && make install

 

6,測試

調試模式命令:

radiusd -X

提示Refusing to start with libssl version OpenSSL 1.0.1e

vi /usr/local/etc/raddb/radiusd.conf

找到allow_vulnerable_openssl = no,修改爲allow_vulnerable_openssl = yes

再次啓動radiusd -X

 

新打開一個終端

vi /usr/local/etc/raddb/users

找到這一行

#steve Cleartext-Password:="testing" 

將前面的#去掉
steve   Cleartext-Password := "testing"
        Service-Type = Framed-User,
        Framed-Protocol = PPP,
        Framed-IP-Address = 172.16.3.33,
        Framed-IP-Netmask = 255.255.255.0,
        Framed-Routing = Broadcast-Listen,
        Framed-Filter-Id = "std.ppp",
        Framed-MTU = 1500,
        Framed-Compression = Van-Jacobsen-TCP-IP
 

終端輸入命令:radtest steve testing localhost 0 testing123

得到結果:

Sent Access-Request Id 50 from 0.0.0.0:34461 to 127.0.0.1:1812 length 75
        User-Name = "steve"
        User-Password = "testing"
        NAS-IP-Address = 106.186.116.69
        NAS-Port = 0
        Message-Authenticator = 0x00
        Cleartext-Password = "testing"
Received Access-Accept Id 50 from 127.0.0.1:1812 to 0.0.0.0:0 length 71
        Service-Type = Framed-User
        Framed-Protocol = PPP
        Framed-IP-Address = 172.16.3.33
        Framed-IP-Netmask = 255.255.255.0
        Framed-Routing = Broadcast-Listen
        Filter-Id = "std.ppp"
        Framed-MTU = 1500
        Framed-Compression = Van-Jacobson-TCP-IP

accept!貌似成了,玩去吧 ^_^

剩下的就是mysql和freeradius融合配置。。具體看https://my.oschina.net/u/2404183/blog/547330

 

還有一種簡單的yum安裝

添加源:

cd /etc/yum.repos.d/

wget http://download.opensuse.org/repositories/home:freeradius:3.0.x:centos/CentOS_CentOS-6/home:freeradius:3.0.x:centos.repo

 

yum install -y freeradius freeradius-utils freeradius-mysql

安裝的版本是freeradius 3.0.3

相關文章
相關標籤/搜索