IP 및 조건부 인증
지정된 IP 및 네트워크에서만 접속 가능한 웹사이트 만들기
Apache HTTPD 2.4 웹서버의 httpd.conf 또는 VirtualHost 지시자 내부에 다음을 선언한다.
192.168.0.0~255, 172.16.0.50 에서만 http://example.net/secure 을 접속할 수 있다.
/etc/httpd/conf.d/example_net.conf
<VirtualHost *:443> ServerName example.net # ... <Location /secure> # Internal Network <If "-R '192.168.0.0/24'"> </If> # Specific IP <ElseIf "-R '172.16.0.50/32'"> </ElseIf> # External Network <Else> Require all denied ErrorDocument 403 "You are not allowed to access this page." </Else> </Location> </VirtualHost>