작성일 : 15-03-04 16:58
|
[DNS] 아파치에서 파일에서 해당 폴더에 파일목록 볼수 있게 만들기 [.htaccess or Directory ]
|
|
|
글쓴이 :
조형래
 조회 : 2,345
|
.htaccess 파일에서 해당 폴더의 목록을 볼수 있게 하려면, 다음의 한줄만 추가해 주면 된다.
Options Indexes
httpd.conf 파일에서 특정 폴더의 목록을 볼수 있게 하려면 아래와 같이 추가해 주면 된다.
디렉토리 리스트가 보이는 상태 (수정전)
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</ Directory>
디렉토리 리스트가 보이지 않는 상태 (수정후)
<Directory />
Options FollowSymLinks
AllowOverride All
</ Directory>
혹은
<Directory />
Options -Indexes FollowSymLinks
AllowOverride All
</ Directory>
Virtual Hosting
아파치설정에서 Virtual Hosting 을 하고 있다면 Apache <Directory> 설정 바꾸기를 추천한다.
또 특정 디렉토리만 리스트가 보이게 설정할 수 있다.
아래는 http://siteurl/www/dirlist 디렉토리가 보이게 설정된 예이다.
<Directory /www/dirlist>
Options Indexes FollowSymLinks
AllowOverride All
</ Directory>
예)
http://adminschool.net 의 모든 디렉토리 보기는 막혀있고, http://adminschool.net/images 만 디렉토리 보기가 허용된 상태이다.
<VirtualHost *:80>
ServerName www.adminschool.net
ServerAlias adminschool.net
DocumentRoot /html/adminschool/
ServerAdmin webmaster@adminshcool.net
<Directory /html/adminschool>
Options -Indexes
</Directory>
<Directory /html/adminschool/images/>
Options Indexes
</Directory>
<IfModule mod_suphp.c>
suPHP_Engine on
</IfModule>
ErrorLog /var/log/apache2/www.adminschool.net-error.log
CustomLog /var/log/apache2/www.adminschool.net-access.log combined env=!dontlog
</VirtualHost>
|
|