Protection directory web with .htaccess and .htpasswd
Saturday, August 25, 2007
Way of this used for the protection of access the directory web, user will be asked to enter the username and password moment access the web page

First step is cheque of configuration apache, edit the file http.conf and alter some configuration become like following:
……………………………
Allowoverride Authconfig
……………………………
Accessfilename . htaccess

  1. Step the hereinafter is make the file . htpasswd in directory web which wish the protection, for example directory “/ var/www/data”, make the file . htaccess in the directory.
Later, Then type the comand of following to enter the username:
# htpasswd / var/www/data/.htpasswd nama_user
# New Password
# Re-Type New password
# Adding Password for user nama_user

2. Later,Then make the file . htacces in directoy “/ var/www/data” and edit the file .
htaccess become like following
Authname " enter Username & Password"
Authtype Basic
Authuserfile / var/www/data
require valid-user
Keep the configuraton file and restart your apache.

reference from : www.pikko.org

Labels:

 
posted by Nur Cholik Hasyim at 11:03 AM | Permalink |


0 Comments: