http://linuxchannel.net/docs/order-apache-vs-proftpd.txt
일단 위의 URL 문서 참고하세요.
일부분(asf, avi, wma) 만 deny 하고 모두 allow 해야하기 때문에
allow 정책이 우선 와야 합니다.
즉
Oreder Allow,Deny
Allow from all
Deny from env=is_not_access
이렇게 설정해야 합니다.
[김성민]님이 남기신 글:
>아... 다시해보니
>VirtualHost 섹션안에는 Directory 로 하면 안되고,
><VirtualHost 127.0.0.1>
> <Directory "/home/sungmin/www">
> Order deny,allow
> Deny from all
> Allow from env=is_allow_access
> </Directory>
></VirtualHost>
>
><VirtualHost 127.0.0.1>
> ServerAdmin me@localhost.com
> DocumentRoot /home/sungmin/www
> ServerName domain.com
> <location />
> Order deny,allow
> deny from all
> allow from env=is_allow_access
> </location>
></VirtualHost>
>
><location /> 을 이용하니 되네요??
>
>근데,
>
> <location />
> Order deny,allow
> deny from all
> allow from env=is_allow_access
> </location>
>
>이러면 되는데,
>
> <location />
> Order allow,deny
> allow from env=is_allow_access
> deny from all
> </location>
>
>이렇게 allow 가 우선하고, deny 가 나중이면,
>일단 is_allow_access 해당하면 allow 고, 해당되지 않으면 deny
되는거 아닌가요? 이렇게 하니 전부 deny 되더군요.
>
> <location />
> Order deny,allow
> deny from env!=is_allow_access
> </location>
>
>이래야 맞는건가요?
>
>
>
>[김성민]님이 남기신 글:
>
>>안녕하세요.
>>
>>Apache에서요.. (httpd.conf)
>>
>>ServerName...
>>...생략...
>>
>>SetEnvIFNoCase Request_URI .(asf|avi|wma)$ is_not_access
>>SetEnvIFNoCase Request_URI .(gif|jpg|jpeg)$ is_allow_access
>>
>>############
>>## 사례 1 ##
>>############
>>
>><Directory /home/*>
>> AllowOverride All
>> Order allow,deny
>> Allow from all
>> Deny from env=is_not_access
>></Directory>
>>
>>...생략...
>>
>>############
>>## 사례 2 ##
>>############
>>
>><VirtualHost 127.0.0.1>
>> ServerAdmin me@localhost.com
>> DocumentRoot /home/sungmin/www
>> ServerName domain.com
>> <Directory "/home/sungmin/www">
>> Order deny,allow
>> Deny from all
>> Allow from env=is_allow_access
>> </Directory>
>></VirtualHost>
>>
>>이런식으로 했습니다.
>>
>>사례 1의 경우 is_not_access 에 정의된 영상파일을 금지하는
것이고,
>>사례 2의 경우 is_allow_access 에 정의된 이미지 파일은 허용하고
나머지는 거부한다는 목적으로 한 것입니다.
>>
>>근데, 아무것도 거부 안되고 다 됩니다.??
>>
>>/usr/local/apache/bin/httpd -t 검사해도 OK고,
>>재시작해도 에러없습니다.
>>
>>뭐 잘못 되었는지요??
>
>========================================
========================================
|