Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-23-2011, 07:44 AM   PM User | #1
b_r_h
New Coder

 
Join Date: Dec 2008
Location: Western Belgium
Posts: 32
Thanks: 8
Thanked 0 Times in 0 Posts
b_r_h is an unknown quantity at this point
httpd.conf & .htaccess: Options not allowed here

Hello,

On my apache, there is
Code:
IndexIgnore *
on httpd.conf to ignore directory browsing. It is working ok.

On httpd.conf-file there is also directory settings for my directory:
Code:
<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.
Code:
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?
b_r_h is offline   Reply With Quote
Old 02-23-2011, 06:55 PM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,604
Thanks: 2
Thanked 399 Times in 392 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
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.
Inigoesdr is offline   Reply With Quote
Old 02-24-2011, 07:17 AM   PM User | #3
b_r_h
New Coder

 
Join Date: Dec 2008
Location: Western Belgium
Posts: 32
Thanks: 8
Thanked 0 Times in 0 Posts
b_r_h is an unknown quantity at this point
I like to make that directory browsable even I have IndexIgnore on httpd.conf. How to do it?
b_r_h is offline   Reply With Quote
Old 02-24-2011, 02:01 PM   PM User | #4
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,604
Thanks: 2
Thanked 399 Times in 392 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Use
Code:
Options +Indexes
in your .htaccess file in that directory.
Inigoesdr is offline   Reply With Quote
Old 02-24-2011, 03:04 PM   PM User | #5
b_r_h
New Coder

 
Join Date: Dec 2008
Location: Western Belgium
Posts: 32
Thanks: 8
Thanked 0 Times in 0 Posts
b_r_h is an unknown quantity at this point
I have tried it. Then Apache throws

Code:
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:
Code:
/var/www/html/files/.htaccess: Options not allowed here
b_r_h is offline   Reply With Quote
Old 02-24-2011, 04:20 PM   PM User | #6
djm0219
Senior Coder

 
djm0219's Avatar
 
Join Date: Aug 2003
Location: Wake Forest, North Carolina
Posts: 1,229
Thanks: 2
Thanked 190 Times in 188 Posts
djm0219 is on a distinguished road
In your configuration file add Options to your AllowOverride statement for that directory.

Code:
<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>
__________________
Dave .... HostMonster for all of your hosting needs

Last edited by djm0219; 02-24-2011 at 04:21 PM.. Reason: Had the wrong keyword to add ... should be Options
djm0219 is offline   Reply With Quote
Old 02-24-2011, 04:45 PM   PM User | #7
b_r_h
New Coder

 
Join Date: Dec 2008
Location: Western Belgium
Posts: 32
Thanks: 8
Thanked 0 Times in 0 Posts
b_r_h is an unknown quantity at this point
Thank's.

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

It looks a like:
Code:
Index of /files
[ICO]	Name	Last modified	Size	Description
b_r_h is offline   Reply With Quote
Old 02-24-2011, 05:32 PM   PM User | #8
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,604
Thanks: 2
Thanked 399 Times in 392 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Quote:
Originally Posted by b_r_h View Post
Maybe IndexIgnore?
Yes. Comment that out or change it to allow the files you do want to show.
Inigoesdr is offline   Reply With Quote
Old 02-24-2011, 05:36 PM   PM User | #9
b_r_h
New Coder

 
Join Date: Dec 2008
Location: Western Belgium
Posts: 32
Thanks: 8
Thanked 0 Times in 0 Posts
b_r_h is an unknown quantity at this point
If I understand right, it is not possible to list index with apache, if indexingore is in *?
b_r_h is offline   Reply With Quote
Old 02-24-2011, 06:04 PM   PM User | #10
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,604
Thanks: 2
Thanked 399 Times in 392 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Correct. If you want to exclude file names/extensions you can, but * blocks everything.
Inigoesdr is offline   Reply With Quote
Users who have thanked Inigoesdr for this post:
b_r_h (02-25-2011)
Old 02-25-2011, 07:29 AM   PM User | #11
b_r_h
New Coder

 
Join Date: Dec 2008
Location: Western Belgium
Posts: 32
Thanks: 8
Thanked 0 Times in 0 Posts
b_r_h is an unknown quantity at this point
That's what I was looking for. Thanks for clarifying!
b_r_h is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:48 PM.


Advertisement
Log in to turn off these ads.