You're on the right track. Try this:
Create a Location within your vhost definition in httpd.conf:
AuthName "restricted stuff"
AuthType Basic
AuthUserFile /var/www/test/.test
require valid-user
Create the password file:
/usr/bin/htpasswd -c /var/www/test/.test
Hint: don't put the auth file in your DocumentRoot path.
--
Phil Mattison
Ohmikron Corp.
480-722-9595
602-820-9452 Mobile