LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   indexes options not working (https://www.linuxquestions.org/questions/linux-server-73/indexes-options-not-working-791331/)

sang_froid 02-24-2010 02:18 PM

indexes options not working
 
Hi,

In our apache web server, we have a number of virtual hosts running.

I wanted to create an alias to a folder only to a specific virtual host. So what I did is, in the
virtual host configuration section of that specific site, I added as below:


<VirtualHost *:80>
....
....
...

Alias /myfiles/ "/webroot/myfiles/"

<Directory "/data/webroot/myfiles">
Options -Indexes -ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>


However, with this configuration,if index.html is not present in the system , I am still able to see directory listing of all files under that folder myfiles.

What could be going wrong ? Why "options" directive of is not working once it is placed inside <directory > of <virtualhost> ??


If I move <directory> in the main httpd.conf (ie , outside virtual host section), then again it works fine. But I don't want this as I don't want other virtual hosts also to be able to access to that directory...

In the main httpd.conf, I have something like

<Directory "/data/webroot">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

how to fix this issue ?? any ides ???

Thanks..

cyent 02-24-2010 02:28 PM

Possibly you should use <Location> instead of <Directory>. After all, all virtual hosts share the same file system, it's the URL name space that differs.

sang_froid 02-25-2010 08:20 AM

what is the main difference between using <Location> and <Directory> ?

bathory 02-25-2010 08:41 AM

Quote:

Alias /myfiles/ "/webroot/myfiles/"

<Directory "/data/webroot/myfiles">
Mind that you define Alias for the directory /webroot/myfiles, while you use -Indexes for the directory /data/webroot/myfiles that is a completely different one.

Regarding the difference between <Location> and <Directory ...> take a look at the apacje documentation.

Regards


All times are GMT -5. The time now is 05:23 AM.