...

View Full Version : httpd.conf & .htaccess: Options not allowed here



b_r_h
02-23-2011, 08:44 AM
Hello,

On my apache, there is


IndexIgnore *

on httpd.conf to ignore directory browsing. It is working ok.

On httpd.conf-file there is also directory settings for my directory:


<Directory "/var/www/html/files/">
Options Indexes Includes
AllowOverride AuthConfig
AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/passwords/.htpass
Order allow,deny
Allow from all
</Directory>

That is also directory, which I like to make browsable. I have added .htaccess-file to this directory.


Options -Indexes


I get message:
Forbidden
You don't have permission to access /files/ on this server.

On error_log I get:
Directory index forbidden by Options directive: /var/www/html/files/

What am I missing?

Inigoesdr
02-23-2011, 07:55 PM
You don't have an index(index.html, index.php, etc.) file and you have disabled the directory listing(Options -Indexes). This is intended behavior.

b_r_h
02-24-2011, 08:17 AM
I like to make that directory browsable even I have IndexIgnore on httpd.conf. How to do it?

Inigoesdr
02-24-2011, 03:01 PM
Use

Options +Indexes
in your .htaccess file in that directory.

b_r_h
02-24-2011, 04:04 PM
I have tried it. Then Apache throws



Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.


and errolog says:


/var/www/html/files/.htaccess: Options not allowed here

djm0219
02-24-2011, 05:20 PM
In your configuration file add Options to your AllowOverride statement for that directory.



<Directory "/var/www/html/files/">
Options Indexes Includes
AllowOverride AuthConfig Options
AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/passwords/.htpass
Order allow,deny
Allow from all
</Directory>

b_r_h
02-24-2011, 05:45 PM
Thank's.

I tried that, error goes away, but there in no index-list available. Maybe IndexIgnore?

It looks a like:


Index of /files
[ICO] Name Last modified Size Description

Inigoesdr
02-24-2011, 06:32 PM
Maybe IndexIgnore?

Yes. Comment that out or change it to allow the files you do want to show.

b_r_h
02-24-2011, 06:36 PM
If I understand right, it is not possible to list index with apache, if indexingore is in *?

Inigoesdr
02-24-2011, 07:04 PM
Correct. If you want to exclude file names/extensions you can, but * blocks everything.

b_r_h
02-25-2011, 08:29 AM
That's what I was looking for. Thanks for clarifying!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum