우분투 설정은 다음과같다

서버웹서버tRoot로 사용하는 /var/www의 목록이 보여지는 것을 막고싶으면
 
 

/etc/apache2/sites-enabled/000-default     //  여기에서
 
Directory의 Options에서 Indexes를 제거


각 계정에 대한 파일들을 각 유저의 홈 디렉토리를 저장하고 이 디렉토리에 대한 목록을 설정할때

/etc/apache2/mods-enabled/userdir.conf
//이 파일을 수정하면된다.

<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root         

<Directory /home/*/public_html>                    >>>>> 만약 유저 사용자 홈 디렉토리가                                                                                                                  /home/**/public_html이라하고 Indexs 제거
AllowOverride FileInfo AuthConfig Limit
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec
</Directory>
</IfModule>





우분투가 아닌 다른 운영체제는 다음과 같이 하면된다

/etc/apache2/httpd.conf 파일을 열면 디렉토리 옵션중에 아래와 같은 옵션이 있습니다. 

  1. <directory "..."> 
  2. AllowOverride None 
  3. Options Indexes MultiView ExecCGI  
  4. </directory>  



여기서 Indexes옵션을 제거하고 아파치 데몬을 재시작하면 목록출력을 막을수 있습니다 . 
만약 httpd.conf에 나열된 index.htm ,index.html등의 파일이 없다면 페이지를 열때 다음과 같은 메세지를 보여줍니다.

Forbidden You don't have permission to access /test/ on this server. 
Free4u Webserver/0.02 Server at free4u.dnip.net Port 80
AND