본문 바로가기

Linux

디렉토리 리스팅 막기

/var/www/html 막기

/etc/apache2/apache2.conf

<Directory /var/www/>

#   option Indexes FollowSymLinks 주석처리

option FollowSymLinks

AllowOverride None

Require all granted

</Directory>


public_html막기

etc/apache2/mods-available/userdir.conf 파일에 존재하는 


<Directory /home/*/public_html>

                AllowOverride FileInfo AuthConfig Limit Indexes

#               Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

                Options MultiViews SymLinksIfOwnerMatch IncludesNoExec


                <Limit GET POST OPTIONS>

                       Order allow,deny

                        Allow from all

                </Limit>

                <LimitExcept GET POST OPTIONS>

                        Order deny,allow

                        Deny from all

                </LimitExcept>

        </Directory>


위와 같이 Indexes 를 없애주면 된다