Results 1 to 9 of 9

Thread: Disable Directory Browsing

  1. #1
    Join Date
    Dec 2005
    Beans
    13

    Disable Directory Browsing

    I'm running Ubuntu 9.04 Server. My server is currently hosting three individual websites. I set those up by adding virtual host entries in apache2.conf that link to subfolders of /var/www. All that business works fine and always has.

    I'm trying to disable directory listing on Apache but haven't had any luck. I removed the Indexes option from the /var/www directory in apache2/sites-available/default and restarted Apache but that didn't work. I'm not quite sure where to go from here.

    Thanks!

  2. #2
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Disable Directory Browsing

    IIRC, Indexing is turned on by default, so to disable it, add -Indexes.
    「明後日の夕方には帰ってるからね。」


  3. #3
    Join Date
    Dec 2005
    Beans
    13

    Re: Disable Directory Browsing

    I tried that as well as removing the Indexes option completely. It didn't work.

  4. #4
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,630

    Re: Disable Directory Browsing

    How about in /apache2/sites-enabled/default ?

  5. #5
    Join Date
    Feb 2008
    Beans
    52

    Re: Disable Directory Browsing

    In the apache config you can change the line:

    ServerTokens Full

    to

    ServerTokens Prod

    To stop directory browsing. you might also want to add this line for security

    ServerSignature Off
    ~Sprouty

  6. #6
    Join Date
    Dec 2005
    Beans
    13

    Re: Disable Directory Browsing

    I tried it in sited-enabled/default as well as apache2.conf with no luck. I did add those two lines, sprouty (they didn't exist yet) and see that I'm no longer showing the server info, but I'm still getting directory browsing. Could it be related to the virtual hosts?

  7. #7
    Join Date
    Feb 2008
    Beans
    52

    Re: Disable Directory Browsing

    Sorry mate!

    I got a little confusted, this is how i blocked it:
    in the directory

    /etc/apache2/mods-enabled/
    i renamed
    autoindex.conf
    autoindex.load

    to
    autoindex.conf.1
    autoindex.load.1

    So the config file is never loaded, prob not the best way but it works
    ~Sprouty

  8. #8
    Join Date
    Sep 2012
    Beans
    1

    Re: Disable Directory Browsing

    If anyone stumbles upon this thread : I think the clean way to disable auto indexing in ubuntu is just:

    a2dismod autoindex

  9. #9
    Join Date
    Nov 2008
    Location
    Storybrooke
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Disable Directory Browsing

    Necromancing - thread locked/closed

    As per the Ubuntu Forums Code of Conduct, please do not post in threads more than one year old.

    Thanks
    Ubuntu Forums Moderation Staff
    This could be the worst idea you've ever had and you hired the Wicked Witch as your nanny. - Regina

Bookmarks

Posting Permissions

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