CentOS 6 LAMP phpmyadmin Freeradius daloradius


CentOS 6 LAMP phpmyadmin Freeradius daloradius
説明せず、配置を直接見る

  
  
  
  
  1. #yum -y update 
  2. #reboot 
  3. #yum -y install wget vim ntp man 
  4. #ntpdate pool.ntp.org 
  5. #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 \ 
  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/admin.sql 
  54. vim /etc/raddb/sql/mysql/admin.sql 
  55. CREATE USER 'radius'@'localhost'; 
  56. SET PASSWORD FOR 'radius'@'localhost' = PASSWORD('radpass'); 
  57. GRANT SELECT ON radius.* TO 'radius'@'localhost'; 
  58. GRANT ALL on radius.radacct TO 'radius'@'localhost'; 
  59. GRANT ALL on radius.radpostauth TO 'radius'@'localhost'; 
  60.  
  61. vim /etc/raddb/sql.conf 
  62. change the password 'radpass' to 'radpass' 
  63.  
  64. mysql -u root -p 
  65. mysql>create database radius; 
  66. mysql>exit 
  67. mysql -u root -p radius < /etc/raddb/sql/mysql/admin.sql 
  68. mysql -u root -p radius < /etc/raddb/sql/mysql/schema.sql 
  69. mysql -u root -p radius < /etc/raddb/sql/mysql/nas.sql 
  70. mysql -u root -p radius < /etc/raddb/sql/mysql/ippool.sql 
  71.  
  72. vi /etc/raddb/radiusd.conf 
  73. $INCLUDE sql.conf 
  74.  
  75. vi /etc/raddb/sql.conf 
  76.   server = "localhost" 
  77.         port = 3306 
  78.         login = "radius" 
  79.         password = "radpass" 
  80.         radius_db = "radius" 
  81. readclients = yes 
  82.  
  83. vi /etc/raddb/sites-enabled/default 
  84. authorize { 
  85.           preprocess 
  86.           chap 
  87.           mschap 
  88.           suffix 
  89.           eap 
  90.           sql 
  91.           pap 
  92.  
  93.  
  94.  
  95. accounting { 
  96.           detail 
  97.           sql 
  98.  
  99. session { 
  100. radutmp 
  101. sql 
  102.  
  103. mysql -u root -p 
  104.  
  105. mysql> use radius; 
  106.  
  107. INSERT INTO radcheck (UserName, Attribute, Value) VALUES ('user1', 'Password','password1'); 
  108.  
  109. mysql> exit 
  110.  
  111. radiusd -X 
  112. radtest user1 password1 localhost 1812 testing123 
  113.  
  114. wget http://download.pear.php.net/package/DB-1.7.14RC2.tgz 
  115. pear install DB-1.7.14RC2.tgz 
  116.  
  117. ###Notes daloradius 0.9-9 also works 
  118. wget http://nchc.dl.sourceforge.net/project/daloradius/daloradius/daloradius-0.9-8/daloradius-0.9-8.tar.gz 
  119. tar -zxvf daloradius-0.9-8.tar.gz 
  120. mv daloradius-0.9-8 daloradius 
  121. cp -rf daloradius /var/www/html/ 
  122. chown apache:apache /var/www/html/daloradius/ -R 
  123. chmod 644 /var/www/html/daloradius/library/daloradius.conf.php 
  124. cd /var/www/html/daloradius/contrib/db/ 
  125.   mysql -u root -p radius < mysql-daloradius.sql 
  126.  vi /var/www/html/daloradius/library/daloradius.conf.php 
  127.  
  128. ########### 
  129.  
  130. $configValues['DALORADIUS_VERSION'] = '0.9-8'; 
  131. $configValues['FREERADIUS_VERSION'] = '2'; 
  132. $configValues['CONFIG_DB_ENGINE'] = 'mysql'; 
  133. $configValues['CONFIG_DB_HOST'] = 'localhost'; 
  134. $configValues['CONFIG_DB_USER'] = 'radius'; 
  135. $configValues['CONFIG_DB_PASS'] = 'radpass'; 
  136. $configValues['CONFIG_DB_NAME'] = 'radius'; 
  137. $configValues['CONFIG_DB_TBL_RADCHECK'] = 'radcheck'; 
  138. $configValues['CONFIG_DB_TBL_RADREPLY'] = 'radreply'; 
  139. $configValues['CONFIG_DB_TBL_RADGROUPREPLY'] = 'radgroupreply'; 
  140. $configValues['CONFIG_DB_TBL_RADGROUPCHECK'] = 'radgroupcheck'; 
  141. $configValues['CONFIG_DB_TBL_RADUSERGROUP'] = 'radusergroup'; 
  142. $configValues['CONFIG_DB_TBL_RADNAS'] = 'nas'; 
  143. $configValues['CONFIG_DB_TBL_RADPOSTAUTH'] = 'radpostauth'; 
  144. $configValues['CONFIG_DB_TBL_RADACCT'] = 'radacct'; 
  145. ........... 
  146. ############# 
  147.  
  148. Optionals: 
  149. touch /tmp/daloradius.log 
  150. chown apache.apache /tmp/daloradius.log 
  151. http://ip/daloradius 
  152. username: administrator 
  153. password: radius 
  154.     
  155.     
  156. GRANT ALL PRIVILEGES ON *.* TO 'radius'@'192.168.1.115' IDENTIFIED BY 'radpass' WITH GRANT OPTION;    
  157. FLUSH PRIVILEGES;