Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Diable files listing in a directory.

Discussion in 'General Discussion' started by desiguru, Oct 15, 2009.

  1. desiguru

    desiguru Well-Known Member

    Joined:
    Aug 27, 2008
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    56
    Whenever a new domain is created, each one has access to its list of files if index file is not created there.

    For example if a directory domain.com/home has four files

    xzy.php
    none.php
    hello.php
    sample.php

    When one goes to domain.com/home all of those files show up. How do I disable that for all of the hosts?
     
  2. egsi

    egsi Member

    Joined:
    Aug 12, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    51
    One option is to create / edit your .htaccess file under the .../public_html folder and add the following line:

    Code:
    Options All -Indexes
    This will apply it to ALL subfolders under ..../public_html

    Would be nice to have cPanel enable this by default
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,563
    Likes Received:
    43
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    1. Login to WHM as root
    2. Click Apache Configuration
    3. Click Global Configuration
    4. Uncheck the box labeled Indexec in the Directory '/' Options[/i]
    5. Click Save
    6. Click 'Rebuild Configuration and Restart Apache'
    7. Wait for restart
    8. Directory indexing is now disabled globally.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. desiguru

    desiguru Well-Known Member

    Joined:
    Aug 27, 2008
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    56



    Awesome! That's exactly what I needed.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice