LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-18-2009, 02:49 AM   #1
poiuytrez
LQ Newbie
 
Registered: May 2009
Posts: 15

Rep: Reputation: 0
Question Disable directory listing on apache in Debian Lenny


Hello,

I am trying to disable the directory listing in apache on debian lenny but I don't find the option in apache2.conf.
I found many tutorial on internet but they usually disable it in their virtual host. I have many virtual host so I want to disable the directory listing globally.

Thank you.
 
Old 06-18-2009, 03:18 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by poiuytrez View Post
Hello,

I am trying to disable the directory listing in apache on debian lenny but I don't find the option in apache2.conf.
I found many tutorial on internet but they usually disable it in their virtual host. I have many virtual host so I want to disable the directory listing globally.

Thank you.
Hello,

If you want to disable directory listing in Apache2 completely just disable the autoindex module using the command:

Code:
a2dismod autoindex
That removes the symlink to the module from the mods-enabled directory. Restart apache2 and that's it.

If you only want to disable listing of certain types of files edit the autoindex.conf file in mods-available (IndexIgnore ) and restart apache2.

Kind regards,

Eric
 
Old 06-18-2009, 03:18 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You have to remove "Indexes" from the general Options directive in your httpd.conf.
 
Old 06-18-2009, 05:14 AM   #4
poiuytrez
LQ Newbie
 
Registered: May 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks EricTRA! It works very well.

bathory, there is nothing in httpd.conf on debian lenny...
 
Old 06-18-2009, 05:20 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by poiuytrez View Post
Thanks EricTRA! It works very well.

bathory, there is nothing in httpd.conf on debian lenny...
Hello,

You're welcome!

FYI:

Apache2 doesn't use the httpd.conf file (if you don't specify it in apache2.conf). The httpd.conf file only exists for programs/services that look for it. Configuration is done in apache2.conf where includes are listed.
 
  


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
vsftpd and directory listing disable for user eugene2008 Linux - Software 0 07-06-2006 08:18 PM
Apache directory listing krneki Linux - Networking 3 06-17-2006 09:47 AM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 06:03 AM
apache - directory listing thejackal13 Linux - Software 1 01-05-2005 10:31 AM
Directory Listing with apache aroop Linux - Networking 2 06-02-2004 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:13 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