Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    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.

  • #3
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts
    I like to make that directory browsable even I have IndexIgnore on httpd.conf. How to do it?

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Use
    Code:
    Options +Indexes
    in your .htaccess file in that directory.

  • #5
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts
    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

  • #6
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,307
    Thanks
    4
    Thanked 205 Times in 202 Posts
    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>
    Last edited by djm0219; 02-24-2011 at 05:21 PM. Reason: Had the wrong keyword to add ... should be Options
    Dave .... HostMonster for all of your hosting needs

  • #7
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts
    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

  • #8
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    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.

  • #9
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts
    If I understand right, it is not possible to list index with apache, if indexingore is in *?

  • #10
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Correct. If you want to exclude file names/extensions you can, but * blocks everything.

  • Users who have thanked Inigoesdr for this post:

    b_r_h (02-25-2011)

  • #11
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts
    That's what I was looking for. Thanks for clarifying!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •