+ Post New Thread
Results 1 to 5 of 5
Web Development Thread, Password protected folder in Apache2 in Coding and Web Development; I'm trying to setup a basic password protected folder (for file sharing) on our apache2 web server I've created a ...
  1. #1
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,289
    Thank Post
    112
    Thanked 86 Times in 58 Posts
    Rep Power
    28

    Password protected folder in Apache2

    I'm trying to setup a basic password protected folder (for file sharing) on our apache2 web server

    I've created a password file with htpasswd and then I've edited the \etc\apache2\sites-enabled\000-default file and added the Directory entry:

    <Directory \var\www\foldertoshare>
    AuthUserFile /home/username/apassword
    AuthName "Please login"
    AuthType Basic
    Require user username
    </Directory>

    I've created the \var\www\foldertoshare and given the apache user www-data access to it.

    This sort of works - when I enter the url of the folder I am prompted for the credentials. However when I enter them I always get:

    HTML Code:
    Forbidden
    
    You don't have permission to access /foldertoshare/ on this server.
    Where am I going wrong with this? I'm sure I did this before on a previous server!

  2. #2
    Cache's Avatar
    Join Date
    Apr 2008
    Location
    Cumbria
    Posts
    1,204
    Thank Post
    450
    Thanked 173 Times in 170 Posts
    Blog Entries
    3
    Rep Power
    63

  3. #3
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,289
    Thank Post
    112
    Thanked 86 Times in 58 Posts
    Rep Power
    28
    Yes I've got the password file.

    From further testing it seems to be that directory browsing isn't allowed. If I add a file to the 'protected' folder and type the full URL to the file, it request the user/password and then opens the file.

    I would like people to browse the folder once they have entered the credentials - is that possible?

  4. #4

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,799
    Thank Post
    272
    Thanked 1,134 Times in 1,030 Posts
    Rep Power
    349
    You would have to allow directory listing in the Apache config if you are wanting to do what I think you are.

  5. #5
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,289
    Thank Post
    112
    Thanked 86 Times in 58 Posts
    Rep Power
    28
    I thought the Options -Multiviews in the Directory listing would allow that?

    I only want to allow directory browsing on this particular folder.

SHARE:
+ Post New Thread

Similar Threads

  1. Password protect a folder
    By bertster in forum Windows Server 2000/2003
    Replies: 28
    Last Post: 7th December 2010, 04:22 PM
  2. Password Protect a folder in XP
    By Trapper in forum Windows
    Replies: 9
    Last Post: 25th June 2010, 10:06 AM
  3. Password protect a folder within a shared folder
    By pbaddhan in forum Windows Server 2000/2003
    Replies: 7
    Last Post: 19th May 2010, 11:39 AM
  4. Password Protect Folders
    By brahma in forum Windows
    Replies: 5
    Last Post: 31st March 2009, 02:00 PM
  5. mapping a drive to web folder in windows xp
    By russdev in forum Windows
    Replies: 1
    Last Post: 3rd October 2005, 08:31 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •