2012-01-08

apache 서버에서 디렉토리(폴더) 내용이 보여지는 것 방지


httpd.conf에서 메인 디렉토리를 설정해 놓은 부분을 찾으면,  다음과 같은 부분이 나옵니다.
Directory는 htdocs이나 home등 개인 설정에 따라 다를 것 입니다.   제 경우에는 Option 값이 "Option All" 로 되어 있었는데 이것을 "Options FollowSymLinks" 으로 즉 Indexes항목을 제거하면 디렉토리 내용이 보이지 않게 됩니다.  좀 더 자세한 내용은 http://httpd.apache.org/docs/current/mod/core.html#options  을 참조하면 되겠습니다.

<Directory "/apache/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options All

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>


Options FollowSymLinks

No comments:

Post a Comment