Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 3

Status
Not open for further replies.

VBMan

Programmer
Jul 1, 2000
49
US
I wish to secure a directory on my webserver. I can't figure out how to do this with .htaccess and .htpasswd, not at all. My system is on OpenBSD and I have PHP support if that makes a difference.

Thanks,
~Ben
 
u could try setting up an alais for it and deny all access...change this to meet ur requirement????

Alias /icons/ "C:/Program Files/Apache Group/Apache/icons/"

<Directory &quot;C:/Program Files/Apache Group/Apache/icons&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Deny from all
</Directory>
 
no i don't want to block all access... i mearly wish to allow only root access to a folder via .htaccess so i get a login prompt.

Thanks again,
~Ben
 
Ok...

What you need it the following :
Use htpasswd to create a user file

htpasswd -c passwordfile username
the -c creates a new file
passwordfile is the path to your new password file
username is the name of the user you want to have access

you will be prompted to provide a password

A word of caution... do NOT use root as teh name... these names do not have to match the operating system, and should NOT as all http passwords travel the net in clear text UNLESS you use SSL :)


Once you have the passwordfile created...
in the directory that you want protected, place the following in an .htaccess file


AuthUserFile <Path To &quot;passwordfile&quot;>
AuthName <username u created above>
AuthType Basic

<Limit GET>
require user &quot;username&quot;
</Limit>


That should be it :)

Have fun...

-john
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top