Deny directory indexes doesn't work

Discussion in 'Server Operation' started by MacGoose, May 11, 2011.

  1. MacGoose

    MacGoose New Member

    I'm managing my server using ISPConfig. All the sites set up in ISPConfig have no problems denying directory content. If I create a new directory via ftp I will get a 403 Forbidden trying to access it.

    However the default Apache site /var/www, answering on my servers IP adress on a http request, shows all directory content except for some directories like /clients. If I create a new directory via ftp it will be open for directory listing.

    I've been setting Options -Indexes in .htaccess files and httpd.conf and indexes are still open.

    Any ideas what to do? Am I missing something?

    , MacGoose
     
  2. erosbk

    erosbk New Member

    You must edit default settings for "default" (directory /var/www/)

    In the debian, with default installation with no changes in both files, you can use it... if you have another distro or this is not your scenario, just edit manually (add "-" in Options Indexes for Directory /var/www/)

    sed -i 's/Options Indexes/Options -Indexes/1' /etc/apache2/sites-available/default
    sed -i 's/Options Indexes/Options -Indexes/1' /etc/apache2/sites-available/default-ssl

    Regards

    Edit: I am new to this... if this is not the best way, please post! :p
     
  3. MacGoose

    MacGoose New Member

    Thanx! Worked like a charm. I'm on Ubuntu 10.04 btw...

    , MacGoose
     

Share This Page