关闭SElinux:
cat /etc/sysconfig/selinux
SELINUX=disabled
reboot #重启生效
安装httpd和mysql:
yum install -y httpd mod_ssl php php-common php-gd php-pear php-pecl-memcache php-mhash php-xml gcc gcc-c++
yum install -y mysql-devel curl php-mysql php-mcrypt compat-libstdc++-33 libtool-ltdl-devel
/etc/init.d/mysqld start
/etc/init.d/httpd start
chkconfig httpd on
chkconfig mysqld on
/usr/bin/mysqladmin -u root password 'newpassowrd' #设置Mysql root密码
#下面脚本用于新建radiusmanger数据库和用户,可自行修改。
cat >> mysql-temp.sql << END
CREATE DATABASE radius;
CREATE DATABASE conntrack;
CREATE USER 'radius'@'localhost' IDENTIFIED BY 'radius123';
CREATE USER 'conntrack'@'localhost' IDENTIFIED BY 'conn123';
GRANT ALL ON radius.* TO radius@localhost;
GRANT ALL ON conntrack.* TO conntrack@localhost;
END
mysql -u root -p < mysql-temp.sql
安装inocube:
wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86.tar.gz
tar zxvf ioncube_loaders_lin_x86.tar.gz
cp -r ioncube /usr/local/
配置PHP加载inocube:
php -v #查看php版本,加载inocube对应版本。
cat >>/etc/php.ini << END
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.1.so
END
/etc/init.d/httpd restart
php -m|grep ioncube #查看是否成功加载ioncube模块
安装freeradius:
wget http://www.dmasoftlab.com/cont/download/freeradius-server-2.1.8-dmamod-1.tar.gz
tar zxvf freeradius-server-2.1.8-dmamod-1.tar.gz
cd freeradius-server-2.1.8
./configure
make
make install
chmod 644 /usr/local/etc/raddb/dictionary
chown apache /usr/local/etc/raddb
chown apache /usr/local/etc/raddb/clients.conf
radiusd -X
修改网卡MAC用于通过验证:
cat >> /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
MACADDR=00:D0:09:B8:B7:34
END
/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 hw ether 00:D0:09:B8:B7:34
/sbin/ifconfig eth0 up
安装radiusmanager:
wget http://deluxsola.googlecode.com/files/radiusmanager-3.9.0.tar.gz
tar zxvf radiusmanager-3.9.0.tar.gz
cd radiusmanager-3.9.0
./install.sh