Page 1 of 1

how to restrict directory listing in apache

Posted: Sun Apr 30, 2006 5:54 am
by raghavan20
If an index.html or index.php file is not in an htdocs directory, I want to restrict the user from viewing the files in the directory. Any tutorials or scripts on that?

I am new to apache configuration process, I would be happy if someone can point to a tutorial which starts with basics and covers most of the topics with examples.

Thanks

Posted: Sun Apr 30, 2006 6:43 am
by qads

Posted: Sun Apr 30, 2006 7:33 am
by raghavan20
I have not read about this option and it says that this line has to be added in .htaccess file. I do not have a .htaccess file in my apache directory and its sub-directories. Is .htaccess different from httpd.conf file, if so, then where should I put the new .htacess file.

Please bear with my ignorance in the issue.

Posted: Sun Apr 30, 2006 7:42 am
by raghavan20
I have put the same line in httpd, it displays the following thus blocking access

Code: Select all

Index of /temp

Icon  Name                    Last modified      Size  Description

Apache/2.0.55 (Win32) PHP/5.1.2 Server at 82.x.x.x Port 8080
How can I make the Apache to display, 'Access is forbidden' in a separate page because I have seen this possible elsewhere?

Posted: Sun Apr 30, 2006 9:00 am
by redmonkey
Disable mod_autoindex