티스토리 뷰
1 Tier 서버 (WEB IIS + DB 1 Server) 에서
유독 한 사이트가 느려서 서버 로그를 확인해보니
500 Script timeout 오류가 많이 발생하고 있었고
client ip들을 분석하여보니
timeout 유발은 99% 중국 아니면 외국이었다.
중국측 IP 대역만 막으려다가
딱히 국외를 위해 서비스할 사이트가 아니어서
한국 접속만 허용으로 정책을 정했다.
GeoIP 다운로드 [새창]
GeoLite Country 최근 DB 다운로드 [새창]
'한국만 접속 가능토록 필터링
remote_ip_address = request.ServerVariables("REMOTE_ADDR")
set geo_ip = Server.CreateObject("GeoIPCOM.GeoIP")
geo_ip.loadDataFile("C:\Program Files\GeoIP\GeoIP.dat")
country_code = geo_ip.country_code_by_name(remote_ip_address)
country_name = geo_ip.country_name_by_name(remote_ip_address)
'한국 국내 접속이 아니면
If UCase(country_code) <> "KR" Then
'Response.Status = "403 Forbidden" '금지 상태코드 내뱉어주기
msg = "HTTP Error 403.0 - Forbidden
"&_
"You do not have permission to view this directory or page.
"
Response.Write(msg)
Response.end '끝내기
End If
참고:
http://www.restapitutorial.com/httpstatuscodes.html
http://dev.maxmind.com/geoip/legacy/geolite/
국가별 IP 차단 대역 http://www.ipdeny.com/ipblocks/
KRNIC 중국 IP 대역 http://krnic.or.kr/jsp/infoboard/stats/ipCurrent.jsp?nationCode1=CN
'웹프로그래밍 > ASP Classic' 카테고리의 다른 글
| 내용 wysiwig 에디터에 한컴한글, 워드 Copy&Paste로 발생하는 dumy 주석 제거 (0) | 2015.02.11 |
|---|---|
| 무료 국산 파일 업/다운로드 컴포넌트 XionSoft (0) | 2014.11.18 |
| ASP 업로드 클래스 freeASPUpload ver. 2010-09-03 (0) | 2014.11.01 |
| ABCUpload 4 컴포넌트 (0) | 2014.11.01 |
| 무료 업로드 컴포넌트 UpDownExpress 2.0 (0) | 2014.05.07 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- macos
- IOS
- ASP
- Mac
- JQuery
- IE
- Linux
- mssql
- 한글
- classic asp
- nodejs
- laravel
- nginx
- Android
- CSS
- PHP
- Docker
- 워드프레스
- sencha touch
- JSON
- 안드로이드
- Debug
- Wordpress
- javascript
- centos
- git
- iis
- iphone
- Prototype
- API
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
글 보관함