커피닉스, 시스템 엔지니어의 쉼터
  Apache의 Indexes된 페이지에서 한글표시 작성일 : 2008/04/10 18:58
 
  • 글쓴이 : 좋은진호 ( http://coffeenix.net/ )
  • 조회수 : 11553
     
    제  목 : Apache의 Indexes된 페이지에서 한글표시
    작성자 : 좋은진호(truefeel, http://coffeenix.net/ )
    작성일 : 2008.3.25(화)
    정리일 : 2008.4.9(수)

    Apache 설정시 가장 먼저 없애는 설정중의 하나가 Options Indexes 이다. Indexes 설정이 되어 있고 해당 디렉토리에 index.html, index.php 등 DirectoryIndex에서 지정한 파일이 없다면, 해당 디렉토리의 파일 목록이 나열된다. 의도적으로 파일목록을 보여줘야하는 경우가 아니면, 보안을 위해서 빼주는게 좋다. http://www.ibiblio.org/pub/ 은 파일 제공등을 목적으로 Indexes 로 설정된 경우이다.

     
    <Directory "...">
            Options Indexes -MultiViews
    </Directory>
     


    주위 분이 Indexes를 필요해서 설정했는데, 한글파일이나 디렉토리가 깨진다는 말씀을 하셨다. Indexes를 사용하지 않는 관계로 몇가지 테스트와 설정을 찾아본 결과 apache 문서에서 답을 찾았다.



    Apache Module mod_autoindex
    http://httpd.apache.org/docs/2.2/en/mod/mod_autoindex.html#indexoptions

     
    Charset=character-set (Apache 2.0.61 and later)
        The Charset keyword allows you to specify the character set of the generated page. The default is either ISO-8859-1 or UTF-8, depending on whether the underlying file system is unicode or not.
        Example:

        IndexOptions Charset=UTF-8
     


    Apache 2.0.61 이후(2.2.x포함)에서 문자셋을 지정하는 설정이 추가었으며, 설정하지 않을 경우 ISO-8859-1 또는 UTF-8로 된다. 테스트결과 ISO-8859-1 으로 표시되었다. 따라서 EUC-KR로 인코딩된 파일명은 다음과 같은 설정을 추가해주면 된다.

     
    IndexOptions Charset=euc-kr
     





    커피닉스, 시스템 엔지니어의 쉼터 / URL : http://coffeenix.net/board_view.php?bd_code=1604