If you are using php4 with apache-1.3.x, it is necessary only to add some lines in the apache configuration file "httpd.conf" and setup the .htaccess.
In the httpd.conf look at this lines, and setup it like it.
This should be changed to whatever you set DocumentRoot to.
#
<Directory "/home/httpd/test">
#
This may also be "None", "All", or any combination of "Indexes",
"Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
Note that "MultiViews" must be named explicitly --- "Options All"
doesn't give it to you.
#
Options Indexes FollowSymLinks
#
This controls which options the .htaccess files in directories can
override. Can also be "All", or any combination of "Options", "FileInfo",
"AuthConfig", and "Limit"
#
AllowOverride AuthConfig
#
Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
In the .htaccess setup like it:
Authname "PASSWORD REQUIRED"
AuthType Basic
O arquivo de senhas esta no dir. abaixo do principal
AuthUserFile /home/httpd/passwd
<LIMIT GET POST>
require valid-user
</LIMIT>
The passwd file contain the password to access the dir. /home/httpd/test.
Try to use the htpasswd to encrypt the password. The htpasswd comes with apache and is installed in the /bin apache directory.
Good luck!!