Re: dis allow to view directory on webpage
Andrew Kelly <[email protected]>
| Newsgroups | gmane.linux.redhat.release.enigma |
|---|---|
| Organization | Transparency International |
| Message-ID | <[email protected]> |
"Malik A. Ahad" wrote: > > Hi, > > Could anyone of you guys tell me, how to dis allow to view directory on web page. > > I have Apache web server running on Linux. if i dont enter after url /index.html, > it show me files names in the directory. where do i need to change setting, pls > guide > That is controlled in httpd.conf Look for any uncommented options directive (the word "Options" as the first non whitespace item on a line followed by various options). There can be multiple options directives, both inside and outside directory containters. The option "Indexes" (without the quotes) tells apache to display directory contents if it cannot find an index.html (or whatever file(s) is/are designated). Remove Indexes from any Options directive. (Options Includes Indexes FollowSymLinks becomes Options Includes FollowSymLinks) If you're new to such things and want to be as careful as possible, then copy and paste the line you want to alter so that there are two identical lines. Comment out the first one to make it inactive but save its contents, and make your change to the second line which will become the active line in the file/script/whatever. #Options Includes Indexes FollowSymLinks Options Includes FollowSymLinks Save and exit httpd.conf and restart apache. /etc/rc.d/init.d/httpd restart or if you've put in a symlink to save some typing like I have /etc/init.d/httpd restart service httpd restart will work as well, but I prefer the direct call because I can use command completion when I've spaced out the precise name of the service I want to start. Hope this helps. Andy