LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-04-2010, 02:30 AM   #1
naruponk
LQ Newbie
 
Registered: Feb 2009
Posts: 27

Rep: Reputation: 15
How to disable directory indexing ?


Hi

I'm concerning about my web server, I use nikto to see where should I improve my configurations, then I just know my web server is enable directory indexing.

I have searched and found that I should just put
Code:
Options -Indexes
to disable directory indexing.
I have already restart apache but directory indexing still enable
here is my httpd.conf Where did I wrong ?

Code:
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120

KeepAlive Off

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75 
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Listen 80

Include conf.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

UseCanonicalName Off

<Directory />
    Options -Indexes FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/docs">
    Options -Indexes FollowSymLinks

    AllowOverride None

    Order allow,deny
    Allow from all

</Directory>

<IfModule mod_userdir.c>
    UserDir disable
</IfModule>


DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

TypesConfig /etc/mime.types

DefaultType text/plain

HostnameLookups Off

ErrorLog logs/error_log

ServerSignature On

Alias /icons/ "/var/www/icons/"

<Directory "/var/www/icons">
    Options -Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
</IfModule>

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip


DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

ForceLanguagePriority Prefer Fallback

AddDefaultCharset UTF-8

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddHandler type-map var

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>

</IfModule>
</IfModule>

TraceEnable off
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /var/www/docs/abc.com
<Directory /var/www/docs/abc.com>
allow from all
Options -Indexes
</Directory>
ServerName www.abc.com
</VirtualHost>
 
Old 05-04-2010, 03:12 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Have you tested it on your server ?
can you see inside a directory ?

How do you know it's still enabled ?

Nothing in your conf suggests that it is enabled.

If you are using Apache2 check the modules directory for something that's setting indexes
/etc/apache2/mods-available/
 
Old 05-04-2010, 03:36 AM   #3
naruponk
LQ Newbie
 
Registered: Feb 2009
Posts: 27

Original Poster
Rep: Reputation: 15
I'm currently test with nikto, how can I test is it still enable or disabled ?

I create a new folder named as beta and nikto said /beta ... this might be interesting, I though It can see what folder inside my site

How can I check myself ?
 
Old 05-04-2010, 04:07 AM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
open it in a browser.
You are running a web server ?
 
Old 05-04-2010, 04:45 AM   #5
naruponk
LQ Newbie
 
Registered: Feb 2009
Posts: 27

Original Poster
Rep: Reputation: 15
Yes, i'm running web server.
I have tried to open in a browser it said
You don't have permission to access /beta/ on this server.
but how can they know I have folder that name ?

So, Are there any other way to list folder ?
 
Old 05-04-2010, 04:51 AM   #6
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
So it's not giving directory listings.
Of course it can see there is a folder there, otherwise you would not be able to open a page within that folder.

Web servers are set up by default so that the world can see anything you put on the server (inside the document root). If you want to keep things private, you either change the directory permissions to 750 or password protect it. Don't do that to the document root, or no one will be able to see any pages from a browser, including you.
 
1 members found this post helpful.
Old 05-04-2010, 05:21 AM   #7
naruponk
LQ Newbie
 
Registered: Feb 2009
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks a lot !!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up Directory Indexing with Apache? your_shadow03 Linux - Server 27 10-25-2009 08:58 PM
Multiple Directory Indexing and Security?? your_shadow03 Linux - Newbie 3 10-23-2009 03:51 PM
Apache Directory Indexing and permission? your_shadow03 Linux - Newbie 3 10-20-2009 10:30 PM
Can not disable Directory Indexing on a Slackware 9.1 Apache 1 Webserver... mtlhd Linux - Server 4 09-22-2009 10:13 AM
Directory Indexing Apache bborisovich Linux - Server 2 03-07-2008 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration