Sheridan Posted November 16, 2011 Posted November 16, 2011 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: AuthUserFile /home/username/apassword AuthName "Please login" AuthType Basic Require user username 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: 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!
Cache Posted November 16, 2011 Posted November 16, 2011 Have you created a .htpasswd file? Authentication, Authorization and Access Control - Apache HTTP Server
Sheridan Posted November 16, 2011 Author Posted November 16, 2011 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?
glennda Posted November 16, 2011 Posted November 16, 2011 You would have to allow directory listing in the Apache config if you are wanting to do what I think you are.
Sheridan Posted November 17, 2011 Author Posted November 17, 2011 I thought the Options -Multiviews in the Directory listing would allow that? I only want to allow directory browsing on this particular folder.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now