CentOS 6 LAMP phpmyadmin Freeradius daloradius
不解释,直接看配置
- #yum -y update
- #reboot
- #yum -y install wget vim ntp man
- #ntpdate pool.ntp.org
- #yum -y install httpd mysql mysql-devel mysql-server php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc \
- freeradius freeradius-mysql freeradius-utils
- #setenforce 0
- chkconfig httpd on
- chkconfig mysqld on
- /etc/init.d/httpd start
- /etc/init.d/mysqld start
- #mysql_secure_installation mysqlpwd
- #####Disallow root login remotely? [Y/n]n#####press 'n'
- # iptables -F
- # vi /var/www/html/test.php
- <?php
- phpinfo();
- ?>
- PHPmyadmin
- cd /var/www/html/
- wget your-phpMyadmin.tar.gz
- tar -zxvf your-phpMyadmin.tar.gz
- mv your-phpMyadmin phpmyadmin
- cd phpmyadmin
- cp config.sample.inc.php config.inc.php
- vi config.inc.php
- $cfg['Servers'][$i]['auth_type'] = ‘http‘;
- #/etc/init.d/httpd restart
- #vi /etc/raddb/users
- testuser Cleartext-Password := "testpassword"
- #radiusd -X
- #radtest testuser testpassword localhost 1812 testing123
- ####FR with MySQL
- cp /etc/raddb/clients.conf /etc/raddb/clients.conf.bak
- grep -v \# /etc/raddb/clients.conf.bak > /etc/raddb/clients.conf
- vi /etc/raddb/clients.conf
- client 192.168.1.0/24 {
- secret = radiussecret
- shortname = testfreeradius
- }
- vim /etc/raddb/users
- #testuser Cleartext-Password := "testpassword"
- ####commment out this line
- cp /etc/raddb/sql/mysql/admin.sql /etc/raddb/sql/mysql/admin.sql.bak
- grep -v \# /etc/raddb/sql/mysql/admin.sql.bak > /etc/raddb/sql/mysql/admin.sql
- vim /etc/raddb/sql/mysql/admin.sql
- CREATE USER 'radius'@'localhost';
- SET PASSWORD FOR 'radius'@'localhost' = PASSWORD('radpass');
- GRANT SELECT ON radius.* TO 'radius'@'localhost';
- GRANT ALL on radius.radacct TO 'radius'@'localhost';
- GRANT ALL on radius.radpostauth TO 'radius'@'localhost';
- vim /etc/raddb/sql.conf
- change the password 'radpass' to 'radpass'
- mysql -u root -p
- mysql>create database radius;
- mysql>exit
- mysql -u root -p radius < /etc/raddb/sql/mysql/admin.sql
- mysql -u root -p radius < /etc/raddb/sql/mysql/schema.sql
- mysql -u root -p radius < /etc/raddb/sql/mysql/nas.sql
- mysql -u root -p radius < /etc/raddb/sql/mysql/ippool.sql
- vi /etc/raddb/radiusd.conf
- $INCLUDE sql.conf
- vi /etc/raddb/sql.conf
- server = "localhost"
- port = 3306
- login = "radius"
- password = "radpass"
- radius_db = "radius"
- readclients = yes
- vi /etc/raddb/sites-enabled/default
- authorize {
- preprocess
- chap
- mschap
- suffix
- eap
- sql
- pap
- }
- accounting {
- detail
- sql
- }
- session {
- radutmp
- sql
- }
- mysql -u root -p
- mysql> use radius;
- INSERT INTO radcheck (UserName, Attribute, Value) VALUES ('user1', 'Password','password1');
- mysql> exit
- radiusd -X
- radtest user1 password1 localhost 1812 testing123
- wget http://download.pear.php.net/package/DB-1.7.14RC2.tgz
- pear install DB-1.7.14RC2.tgz
- ###Notes daloradius 0.9-9 also works
- wget http://nchc.dl.sourceforge.net/project/daloradius/daloradius/daloradius-0.9-8/daloradius-0.9-8.tar.gz
- tar -zxvf daloradius-0.9-8.tar.gz
- mv daloradius-0.9-8 daloradius
- cp -rf daloradius /var/www/html/
- chown apache:apache /var/www/html/daloradius/ -R
- chmod 644 /var/www/html/daloradius/library/daloradius.conf.php
- cd /var/www/html/daloradius/contrib/db/
- mysql -u root -p radius < mysql-daloradius.sql
- vi /var/www/html/daloradius/library/daloradius.conf.php
- ###########
- $configValues['DALORADIUS_VERSION'] = '0.9-8';
- $configValues['FREERADIUS_VERSION'] = '2';
- $configValues['CONFIG_DB_ENGINE'] = 'mysql';
- $configValues['CONFIG_DB_HOST'] = 'localhost';
- $configValues['CONFIG_DB_USER'] = 'radius';
- $configValues['CONFIG_DB_PASS'] = 'radpass';
- $configValues['CONFIG_DB_NAME'] = 'radius';
- $configValues['CONFIG_DB_TBL_RADCHECK'] = 'radcheck';
- $configValues['CONFIG_DB_TBL_RADREPLY'] = 'radreply';
- $configValues['CONFIG_DB_TBL_RADGROUPREPLY'] = 'radgroupreply';
- $configValues['CONFIG_DB_TBL_RADGROUPCHECK'] = 'radgroupcheck';
- $configValues['CONFIG_DB_TBL_RADUSERGROUP'] = 'radusergroup';
- $configValues['CONFIG_DB_TBL_RADNAS'] = 'nas';
- $configValues['CONFIG_DB_TBL_RADPOSTAUTH'] = 'radpostauth';
- $configValues['CONFIG_DB_TBL_RADACCT'] = 'radacct';
- ...........
- #############
- Optionals:
- touch /tmp/daloradius.log
- chown apache.apache /tmp/daloradius.log
- http://ip/daloradius
- username: administrator
- password: radius
- GRANT ALL PRIVILEGES ON *.* TO 'radius'@'192.168.1.115' IDENTIFIED BY 'radpass' WITH GRANT OPTION;
- FLUSH PRIVILEGES;