平台:Centos 6.5 x86_64
1,安装源并更新
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum update -y
2,安装相关库
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 python mysql-devel
3,安装Mysql和Apache
yum --enablerepo=remi -y install mysql mysql-server mysql-devel httpd httpd-devel
chkconfig httpd on
chkconfig mysqld on
service mysqld start
mysql_secure_installation
mysql -u root -p 输入密码
创建你需要的数据库
4,安装php
yum --enablerepo=remi 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
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.4.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.10.tar.gz
tar zxvf freeradius-server-3.0.10.tar.gz
cd freeradius-server-3.0.10
./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"
将前面的#去掉
radtest steve testing localhost 0 testing123
获得结果:
Sent Access-Request Id 41 from 0.0.0.0:35117 to 127.0.0.1:1812 length 75
User-Name = "steve"
User-Password = "testing"
NAS-IP-Address = 106.185.45.18
NAS-Port = 0
Message-Authenticator = 0x00
Cleartext-Password = "testing"
Received Access-Accept Id 41 from 127.0.0.1:1812 to 0.0.0.0:0 length 20
accept!貌似成了,玩去吧 ^_^
还有一种简单的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