Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 26
  1. #1
    Member shaky's Avatar
    Join Date
    May 2003
    Posts
    53

    Question Disbable Global Server Directory Listing?

    Is it possible to disbable the global server directory listing by default?

    Whenever I design a site for a client I have to manually upload an .htaccess file to that particular account so that it disables directory listing on the site.

    But does anyone know how I can disable directory listing for my entire server?

    Is the answer in here somwhere?

    SSH:

    /usr/local/apache/conf/httpd.conf


    Thanks....

  2. #2
    Member
    Join Date
    Jul 2002
    Posts
    93

    Default



    Edit:
    ack.
    Scratch that... that's not going to work.

    Anyone else?
    Last edited by myrem; 05-25-2004 at 09:48 AM.

  3. #3
    Member shaky's Avatar
    Join Date
    May 2003
    Posts
    53

    Default

    Oops myrem, I just tried your post before you edited it...

    Will revert, but thx.

  4. #4
    Member shaky's Avatar
    Join Date
    May 2003
    Posts
    53

    Default

    Is this what it my code is supposed to look like myrem? I forgot...

    #
    # This may also be "None", "All", or any combination of "Indexes",
    # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    Options Indexes FollowSymLinks MultiViews

  5. #5
    Member
    Join Date
    Jul 2002
    Posts
    93

    Default

    Originally posted by shaky
    Is this what it my code is supposed to look like myrem? I forgot...
    yeah, that's right.

    I think the correct place to do it is:
    Code:
    # Each directory to which Apache has access, can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    #
    # First, we configure the "default" to be a very restrictive set of
    # permissions.
    # 
    <Directory />
    Options All 
    AllowOverride All
    </Directory>
    On the above options lines. But tried adding "-Indexes" to it but that didn't help either.

  6. #6
    Member shaky's Avatar
    Join Date
    May 2003
    Posts
    53

    Default

    Shame I was going to try that also

    But thanks for trying.

  7. #7
    Member shaky's Avatar
    Join Date
    May 2003
    Posts
    53

    Default

    Anyone any ideas...?

  8. #8
    Member
    Join Date
    Sep 2003
    Posts
    76

    Default

    Under Options, have you tried just removing 'indexes'?

  9. #9
    Member shaky's Avatar
    Join Date
    May 2003
    Posts
    53

    Default

    Yep, and also restarted apache but made no difference....

  10. #10
    Member
    Join Date
    Mar 2002
    Location
    Alberta, Canada
    Posts
    1,509

    Default

    Originally posted by myrem
    yeah, that's right.

    I think the correct place to do it is:
    Code:
    # Each directory to which Apache has access, can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    #
    # First, we configure the "default" to be a very restrictive set of
    # permissions.
    # 
    <Directory />
    Options All 
    AllowOverride All
    </Directory>
    On the above options lines. But tried adding "-Indexes" to it but that didn't help either.
    Actually, you needed to go a bit lower down.

    # This controls which options the .htaccess files in directories can
    # override. Can also be "All", or any combination of "Options", "FileInfo",
    # "AuthConfig", and "Limit"
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
    </Directory>

    <Directory /home/*/public_html>
    Options -Indexes
    </Directory>
    Helping people Host, Create, and Maintain their Web Site
    Also providing Server Admin Services - setup / troubleshooting

    http://potentproducts.com/

  11. #11
    Member shaky's Avatar
    Join Date
    May 2003
    Posts
    53

    Default

    Thanks Website Rob it works!

  12. #12
    Member
    Join Date
    Jan 2003
    Posts
    61

    Default

    That entire <Directory /home...> section is commented out in my httpd.conf

    So right underneath it I inserted this (just like above)

    <Directory /home/*/public_html>
    Options -Indexes
    </Directory>

    restarted apache and it worked perfect!

    Thanks!!!

    Tina

  13. #13
    Member
    Join Date
    Jan 2003
    Posts
    31

    Default disable directory listing

    When I put try to disable directory listing using htaccess I get "Internal Server Error"

    <Directory /home/*/public_html>
    Options -Indexes
    </Directory>

    when I type the domain.com it will not forward to index.asp?

  14. #14
    Member
    Join Date
    Nov 2002
    Posts
    1,781
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: disable directory listing

    Originally posted by certify
    When I put try to disable directory listing using htaccess I get "Internal Server Error"

    <Directory /home/*/public_html>
    Options -Indexes
    </Directory>

    when I type the domain.com it will not forward to index.asp?
    Try this

    <Directory /home/username/public_html>
    Options -Indexes
    </Directory>

    Substitute the username with your username.

    Btw to make the domain auto forward to index.asp (hmm is it asp or its a typo ?) just edit /usr/local/apache/conf/httpd.conf and locate this:

    # DirectoryIndex: Name of the file or files to use as a pre-written HTML
    # directory index. Separate multiple entries with spaces.
    #

    Below this you can put index.asp (if its not present).
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  15. #15
    Member
    Join Date
    Jan 2003
    Posts
    31

    Default

    Yes it's .asp

    Thanks for the tip.

    I put a .php to do auto forwarding instead for the mean time.

Similar Threads & Tags
Similar threads

  1. Directory Listing
    By Mini in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-04-2010, 10:49 AM
  2. Trying to Stop Global Directory Listing
    By AtariAge in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 12-10-2007, 06:53 AM
  3. no directory listing
    By tucman in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-04-2007, 12:56 AM
  4. /etc directory listing
    By zxcvbnm in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-02-2004, 08:12 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube