I think Kim L's idea is the best, but if you just want to check the username and password in the directory, try this (if Apache2 hosts your site):
Create a .htaccess file in the directory and fill it with something like:
RedirectMatch 404 /passwd$
AuthType Basic
AuthName "Password required"
AuthUserFile /var/www/sitename/folder_name/passwd
Require valid-user
Now add the password file:
htpasswd -c -m /var/www/sitename/folder_name/passwd username
and enter the password when prompted. See Man htpasswd for more details.
Apache2 .htaccess, , , , passwd ; , .