Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I hope I came to the right site for this question.

Basically here is the scenario

You have folder name "Testfolder" which is hosted on Apache. Test folder has files that only certain users on the domain can read see them.

Example

file1.htm = Can only be viewed by all users
file2.htm = Can only be viewed by Domain Admin, Guy2, Guy3

So when you access them via example \WebServer\Site Name\testfolder\file1 & file2.htm they are viewed correctly by their respective users.

However when you go to "testwebsite.com/testfolder , all files are viewed by anyone and ignore the folder permissions. Any ideas on why that is happening? If anyone could help with this issue it would be MUCH appreciated. Thanks for reading.

share|improve this question
2  
Please edit your question and post your apache vhost configuration. –  EEAA Feb 6 '13 at 2:29
add comment

3 Answers 3

Answer to this totally depends on authentication mechanism you are following per-page basis. And how you maintain users and their permissions.

Next, if you just need to stop listing of contents of testwebsite.com/testfolder, adding following in httpd.conf will do the needful.

<Directory /var/www/html/testfolder>
      Options -Indexes
</Directory>

Replace /var/www/html/ with your path.

share|improve this answer
add comment

Apache operates from the concept that it either has permission to read the file (and thus serve it) or it doesn't. It does have the ability to restrict access to files or directories using the .htaccess methodology, but this is rudimentary.

http://httpd.apache.org/docs/2.2/howto/htaccess.html

This is a clunky, but effective way to determine who has authority to view pages or download files.

share|improve this answer
add comment

In Linux, Apache User www-data is the only one that can or can not have permission to read/modify.

Same in Windows (I don't know if is the same user).

You can not give permissions like if it's a shared folder.

You must use another kind of authentication, .htaccess based or making a file download/view system in PHP.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.