This is a brief one. 이것은 짧은 하나입니다. Thanks to 덕분에 The How-To Geek 어떻게 - 괴짜로 for bringing this command into my troubleshooting repertoire. 내 문제 해결을위한 레퍼토리로이 명령을 데려오.
A bit of background first. 배경의 첫 번째 비트. This command is helpful to determine who is causing the most hits to your web site. 이 명령은 자신의 웹 사이트에 가장 안타의 원인인지 확인하는 도움이 될 것입니다. On my music blog, I post a fair number of (totally legal) MP3s. 내 음악의 블로그에서 (완전히)의 MP3의 정당한 법적 번호를 게시할 수있습니다. Some less than ethical people often use those MP3s to stream via their site, causing mine to be slower (and a larger bandwidth bill). 일부 윤리적인 사람보다 자주 스트림에 자신의 사이트를 통해, 내 일으키는 그 MP3를 사용하는 (그리고 더 큰 대역폭이 법안이) 속도가 느려질 수있습니다. By figuring out the IP address of the site/person “stealing” my bandwidth I can then block their IP from accessing any of my content. 사이트의 IP 주소 / 1 인 ""그때 내의 콘텐츠에 액세스하지 못하도록 자신의 IP를 차단할 수있는 제 대역폭을 훔친 연구만.
Note: you’ll need shell access to your web server log files 참고 : 귀하의 웹 서버 로그 파일에 대한 접근 셀 필요합니다
- SSH (or telnet) to your web host. 귀하의 웹 호스트에 SSH (또는 텔넷). Switch to the directory that stores your web server log files. 디렉토리로 전환하여 웹 서버의 로그 파일을 저장합니다.
- Run this command: 이 명령을 실행 :
tail -100000 access.log | awk '{print $1}' | sort | uniq -c |sort -n 꼬리 -100000 access.log | AWK '()'$ 1 인쇄 | 종류 | 고유 - c 옵션 | 정렬 - n을
where 100000 is the number of lines (starting from the end of the log file) you want to search, and access.log is the name of your web server access log. 어디 100000 라인의 숫자 (로그 파일의 끝 부분에서)를 검색하려면, 시작과 access.log는 귀하의 웹 서버에 액세스 로그의 이름입니다.
- The result will be a (probably) fairly long list of IPs, sorted by fewest hits to most. 결과는 (아마도) IP는 상당히 긴리스트의 대부분을 적은 안타로 정렬됩니다. The first value in each row is the number of times the IP address (the second number) accessed your site (in the number of lines of the log file you specified). 각 행의 첫 번째 값을 차례의 IP 주소 (두번째 숫자)의 수를 지정한 로그 파일의 라인의 개수 ()에서 귀하의 사이트에 액세스할 수있습니다.
Use the host command to determine the fully qualified domain name of any IP address that shows up (you’ll probably want to know who the ones that hit your site the most are). In the screenshot example below, two of the IPs that hit simplehelp.net the most were Googlebot and the Yahoo Site Crawler. 아래의 스크린샷을 예제에서는 두 개의 IP의 대부분의 simplehelp.net 친 Googlebot과 야후 사이트 크롤러했다.
- If there’s an IP/domain that looks suspicious, you can check to see which files they were hitting by using the command: 거기에 의심스러워 보이는 경우는 IP / 도메인의, 당신은 그들 타격 명령을 사용하여 파일을 확인할 수있습니다 :
tail -1000 access.log | grep xx.xx.xx.xx 꼬리 -1000 access.log | grep xx.xx.xx.xx
In that command, 1000 is the number of lines to check, access.log is the name of your web server access log, and xx.xx.xx.xx is the IP you want to sort by. 그 명령에서, 1000 회선의 전화 번호를 확인하려면, access.log는 귀하의 웹 서버에 액세스 로그의 이름이고, xx.xx.xx.xx 당신의 IP를 정렬하려는입니다. I’d suggest using a smaller number (1000 vs. 100000 as used in the first command) as you probably don’t need/want to see every file they accessed. 나는 작은 번호를 사용 당신이 아마 필요 없어 (1000 대 100000로 첫 번째 명령에 사용) / 제안면 모든 사람들이 접근한 파일을보고 싶어. If you do, increase the 1000 number. 만약 당신이 1000 수를 늘리기 않습니다. Or, if not very many results show up, that means that they were hitting your site “earlier”, and you’ll want to increase 1000 to a higher number. 아니면, 아주 많은 결과가 없다면, 그 사람들이 귀하의 사이트에 "이전"타격 있었다, 그리고 높은 숫자 1000를 높이려는 뜻을 표시했다.
























{ 2 comments… read them below or (2 코멘트 ... 아니면 그들을 읽고 아래 add one 하나 추가 } )
The problem is that if someone hotlinks your mp3s (or images, or any other media), then it’s still the IPs of their users that will show up in your logs, not the offending webserver. 문제는 누군가가 당신의 mp3를 (또는 이미지, 또는 다른 미디어), 다음은 여전히 사용자의 로그에 표시됩니다 IP를, 안주는 웹서버의 hotlinks. That is to say, it will likely be a fairly even distribution of users and indistinguishable from that of your legitimate visitors (unless someone is just continuously refreshing your media content). 그런 말을하는 것입니다, 그것을 가능성이 귀하의 합법적인 방문자의 사용자와 분간의 비교적 고른 분포된다 (않는 한 누군가 계속) 미디어 콘텐츠를 신선하게 느껴진다.
What you want to be doing is checking for the referrer information to your media files (naturally excluding your own domain from the list). 뭘 원하는 미디어 파일에 대한 참조 정보를 확인하고있다 (자연스럽게) 목록에서 자신의 도메인을 제외하고.
Tony - 토니 -
Under normal circumstances yes, you’re absolutely right. 정상적인 상황에서 네, 그렇군요. In my specific case, the site was loading the files via a flash player that they hosted, and all the requests came from the sites flash player. 나의 특정한 경우에,이 사이트들은 플래시 플레이어를 통해 호스팅 및 파일 로딩 모든 요청은 사이트에서 나온 플래시 플레이어. Adding the IP to my .htaccess in turn stopped the flash player from loading the songs for anyone/everyone who tried to play them from the *explatives* site. 차례로 내. htaccess로하는 IP를 추가하는 사람을위한 노래를 도표에서 Flash Player를 중지 / 사람은 * explatives에서 * 사이트들을 모두 끌어들이려고했다.
Leave a Comment 코멘트를 남겨주세요