.htaccess
AuthType Basic
AuthName "AREA RESTRINGIDA. Lo siento :("
AuthUserFile /var/www/configuraciones/.htpasswd
require valid-user
.htpasswd
Para generar los usuarios y password para el acceso restringido se debe crear en este enlace.
http://www.e2.u-net.com/htaccess/make.htm
Lo que te bota el aplicativo insertarlo en el .htpasswd
Apache2
Para que el servidor web reconozca el .htaccess y .htpasswd hay que poner el Apache2 de modo en escritura.
1.- Ingresar el comando: a2enmod rewrite
2. Modificar el archivo /etc/apache2/sites-available/default . En vez de none se debe cambiar por All
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
3. Reiniciar el apache2: /etc/init.d/apache2 restart
Probarlo :)

No hay comentarios.:
Publicar un comentario