CentOS 6 LAMP phpmyadmin Freeradius daloradius
1. 2. 3. 4. 5. #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 phpgd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc \ 6. freeradius freeradius-mysql freeradius-utils 7. 8. #setenforce 0 9. chkconfig httpd on 10. chkconfig mysqld on 11. /etc/init.d/httpd start 12. /etc/init.d/mysqld start 13. #mysql_secure_installation mysqlpwd 14. #####Disallow root login remotely? [Y/n]n#####press 'n' 15. # iptables -F 16. # vi /var/www/html/test.php 17. <?php 18. phpinfo(); 19. ?> 20. 21. PHPmyadmin 22. cd /var/www/html/ 23. wget your-phpMyadmin.tar.gz 24. tar -zxvf your-phpMyadmin.tar.gz 25. mv your-phpMyadmin phpmyadmin 26. cd phpmyadmin 27. cp config.sample.inc.php config.inc.php 28. vi config.inc.php 29. $cfg['Servers'][$i]['auth_type'] = http; 30. #/etc/init.d/httpd restart 31. 32. 33. #vi /etc/raddb/users 34. testuser Cleartext-Password := "testpassword" 35. 36. #radiusd -X 37. #radtest testuser testpassword localhost 1812 testing123 38. 39. ####FR with MySQL 40. cp /etc/raddb/clients.conf /etc/raddb/clients.conf.bak 41. grep -v \# /etc/raddb/clients.conf.bak > /etc/raddb/clients.conf 42. vi /etc/raddb/clients.conf 43. client 192.168.1.0/24 { 44. secret = radiussecret 45. shortname = testfreeradius 46. } 47. 48. vim /etc/raddb/users 49. #testuser Cleartext-Password := "testpassword" 50. ####commment out this line 51. 52. cp /etc/raddb/sql/mysql/admin.sql /etc/raddb/sql/mysql/admin.sql.bak 53. grep -v \# /etc/raddb/sql/mysql/admin.sql.bak > /etc/raddb/sql/mysql/a dmin.sql
Page 1 of 4
CentOS 6 LAMP phpmyadmin Freeradius daloradius
CentOS 6 LAMP phpmyadmin Freeradius daloradius
54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 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;
Page 2 of 4
CentOS 6 LAMP phpmyadmin Freeradius daloradius
CentOS 6 LAMP phpmyadmin Freeradius daloradius
109. 110. INSERT INTO radcheck (UserName, Attribute, Value) VALUES ('user1', 'Pa ssword','password1'); 111. 112. mysql> exit 113. 114. radiusd -X 115. radtest user1 password1 localhost 1812 testing123 116. 117. wget http://download.pear.php.net/package/DB-1.7.14RC2.tgz 118. pear install DB-1.7.14RC2.tgz 119. 120. ###Notes daloradius 0.9-9 also works 121. wget http://nchc.dl.sourceforge.net/project/daloradius/daloradius/dalo radius-0.9-8/daloradius-0.9-8.tar.gz 122. tar -zxvf daloradius-0.9-8.tar.gz 123. mv daloradius-0.9-8 daloradius 124. cp -rf daloradius /var/www/html/ 125. chown apache:apache /var/www/html/daloradius/ -R 126. chmod 644 /var/www/html/daloradius/library/daloradius.conf.php 127. cd /var/www/html/daloradius/contrib/db/ 128. mysql -u root -p radius < mysql-daloradius.sql 129. vi /var/www/html/daloradius/library/daloradius.conf.php 130. 131. ########### 132. 133. $configValues['DALORADIUS_VERSION'] = '0.9-8'; 134. $configValues['FREERADIUS_VERSION'] = '2'; 135. $configValues['CONFIG_DB_ENGINE'] = 'mysql'; 136. $configValues['CONFIG_DB_HOST'] = 'localhost'; 137. $configValues['CONFIG_DB_USER'] = 'radius'; 138. $configValues['CONFIG_DB_PASS'] = 'radpass'; 139. $configValues['CONFIG_DB_NAME'] = 'radius'; 140. $configValues['CONFIG_DB_TBL_RADCHECK'] = 'radcheck'; 141. $configValues['CONFIG_DB_TBL_RADREPLY'] = 'radreply'; 142. $configValues['CONFIG_DB_TBL_RADGROUPREPLY'] = 'radgroupreply'; 143. $configValues['CONFIG_DB_TBL_RADGROUPCHECK'] = 'radgroupcheck'; 144. $configValues['CONFIG_DB_TBL_RADUSERGROUP'] = 'radusergroup'; 145. $configValues['CONFIG_DB_TBL_RADNAS'] = 'nas'; 146. $configValues['CONFIG_DB_TBL_RADPOSTAUTH'] = 'radpostauth'; 147. $configValues['CONFIG_DB_TBL_RADACCT'] = 'radacct'; 148. ........... 149. ############# 150. 151. Optionals: 152. touch /tmp/daloradius.log 153. chown apache.apache /tmp/daloradius.log 154. http://ip/daloradius 155. username: administrator 156. password: radius 157. 158. 159. GRANT ALL PRIVILEGES ON *.* TO 'radius'@'192.168.1.115' IDENTIFIED BY 'radpass' WITH GRANT OPTION; 160. FLUSH PRIVILEGES;
Page 3 of 4
CentOS 6 LAMP phpmyadmin Freeradius daloradius
CentOS 6 LAMP phpmyadmin Freeradius daloradius
Page 4 of 4
CentOS 6 LAMP phpmyadmin Freeradius daloradius