Jump to content

[SOLVED] Password protect folder?


phpcode

Recommended Posts

I'm trying to protect a folder but I cannot get it to work.

 

Heres what is in my htaccess file:

 

AuthUserFile C:\Program Files\Apache Software Foundation\Apache.htpasswd

AuthGroupFile /test

AuthName EnterPassword

AuthType Basic

 

require user test

 

And htpasswd:

 

test:4OCLqrtvRV4w2

 

I've restarted the server but that didn't do anything. Does anyone know what I'm doing wrong?

Link to comment
Share on other sites

Since you appear to have access to the whole of the C: drive (Win32) is there a specific reason why you're trying to use .htaccess files? (they're not recommended if you have access to httpd.conf)

 

http://httpd.apache.org/docs/2.0/howto/htaccess.html#when

 

httpd.conf - example password protection

-----------

<Directory c:/wwwroot/private>
Order Allow,Deny
Allow from All
#Disable .htaccess files in this location to help prevent hacking (esp in Win32 Apache)
Allowoverride None
AuthUserFile C:\Program Files\Apache Software Foundation\Apache.htpasswd
AuthGroupFile /test
AuthName EnterPassword
AuthType Basic
Require user test
#Allow from local machine(s)
Allow from 127.0.0.1
Alllow from 192.168.1.
#Use satisfy any or satisfy all - depends on your needs
Satisfy Any
</Directory>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.