0

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.

1
  • 2
    Please edit your question and post your apache vhost configuration.
    – EEAA
    Feb 6, 2013 at 2:29

3 Answers 3

1

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.

0

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .