7/18/11

apache and freeradius

From: http://www.adminsehow.com/2010/03/how-to-authenticate-apache-2-with-radius-on-debian/

Install Apache radius module :
view source
print?
1 apt-get install libapache2-mod-auth-radius

enable radius module for Apache :
view source
print?
1 a2enmod auth_radius

open /etc/apache2/apache2.conf and add the following lines to end of file :
view source
print?
1 AddRadiusAuth ip_address:1812 apache2 5:3
2 AddRadiusCookieValid 60

go to /var/www folder or the folder which you want to protect and create a .htaccess file inside it containing following lines :
view source
print?
1 AuthType Basic
2 AuthName "AdminseHow Radius Authentication"
3 AuthBasicAuthoritative Off
4 AuthBasicProvider radius
5 AuthRadiusAuthoritative on
6 AuthRadiusActive On
7 Require valid-user

restart Apache :
view source
print?
1 /etc/init.d/apache2 restart

for more info regarding the configuration options , you can read the following link :
http://freeradius.org/mod_auth_radius/

radius config
users
test Cleartext-Password := "password"

clients
client ip_address {
nastype = other
secret = apache2
}

0 komentar: