자료실

홈 / 고객센터 / 자료실

.htaccess로 특정 IP차단 설정

기본정보
  • 글쓴이
  • 고객지원팀
  • 조회수
  • 1,062회
상세내용

vi /etc/httpd/conf/httpd.conf


===================================================


맨밑


<Directory /home>

 Options ExecCGI IncludesNOEXEC FollowSymLinks

 AllowOverride None

 Deny from env=go_out

</Directory>


<Directory /home>

 AllowOverride FileInfo AuthConfig Limit All

</Directory>


===================================================



vi .htaccess // 특정IP 접속 차단할 디렉토리에 생성


===================================================


SetEnvIf Remote_Addr 14.206.3.* go_out

SetEnvIf Remote_Addr 14.206.4.* go_out

Order Allow,Deny

Allow from all

Deny from env=go_out


===================================================




.htaccess 파일안에는 아래와 같이 차단하려는 IP를 입력합니다.


66.249.67.99 동일한 IP를 차단합니다.

SetEnvIfNoCase REMOTE_ADDR 66.249.67.99 go_out


66.249.67. 앞자리가 동일한 IP대 전체를 차단합니다.

SetEnvIfNoCase REMOTE_ADDR 66.249.67. go_out

 

동일한 IP를 차단한다고 가정하면 아래와 같이 코드를 작성하시면 됩니다.

SetEnvIfNoCase REMOTE_ADDR 66.249.67.99 go_out

Order allow,deny

Allow from all

Deny from env=go_out

자료실

유용한 자료들을 모아두었습니다.