The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to turn off index viewing by default in EA?

Discussion in 'General Discussion' started by dwh2, Feb 26, 2008.

  1. dwh2

    dwh2 Well-Known Member

    Joined:
    Jan 14, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    I don't want people to be able to surf directories by default if there's no index.html file in a directory. I thought I set that up somewhere in WHM, but I guess not.

    I notice that EA3 builds Apache with this directive:

    Code:
    <Directory "/usr/local/apache/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    
    </Directory>
    
    If I want it turned off, do I just remove "Indexes" above and run that cpanel program to register the change? Or is it somewhere else?

    Also, may I add a feature request that you add this option into the EA3 builder so we can turn indexes on/off in the httpd.conf by default and let the users override our serverwide default... For security I think directory browsing off would be better.

    P.S. a similar suggestion would be not to default ServerTokens FULL as default...although I changed it to Prod and checked in a server headers tool and it's still showing my PHP version for some reason...
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Individual account owners can turn off index viewing by going to cPanel -> Advanced -> Index Manager.
     
  3. dwh2

    dwh2 Well-Known Member

    Joined:
    Jan 14, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    OK, how about the reverse...turning it off by default serverwide? That's what I was looking for.
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    in the servers /home create a .htaccess with the following:

    Options All -Indexes
     
  5. dwh2

    dwh2 Well-Known Member

    Joined:
    Jan 14, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Thanks...so just /home/.htaccess and it will propagate to the directories below it?

    Wow, cool.
     
  6. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Yep you got it..
     
  7. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    If you enable index viewing by default, why not give people the option to turn off index viewing when compiling apache?

    Don't most hosts/server owners have indexing turned off for security reasons? Why enable it server wide by default if generally only a handful of users on a server might actually be interested in it. IMO it makes more sense to disable it by default and have the few users that need it enable it in their own cpanel account.
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    That sounds like a good idea for an official feature request. You can submit official feature requests to http://bugzilla.cpanel.net
     
  9. mstuebner

    mstuebner Well-Known Member

    Joined:
    May 13, 2007
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    Wow, isn't that a bit too big, instead of just modifying the vhost templates and to add -Indexes to Options?
     
  10. dwh2

    dwh2 Well-Known Member

    Joined:
    Jan 14, 2004
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    That's what I meant to say in the first post.
     
  11. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
  12. cesare

    cesare Registered

    Joined:
    Mar 16, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Im fairly new to this, but I have the understanding that using .htaccess files will create a recursive search through the subdirectories.
    Could someone more knowledgeable please elaborate on the consequences, compared to using a directive instead?
     
Loading...

Share This Page