Google Search Console의 커버리지 보고서를 확인하던 중, 포럼 페이지 중 상당수가 robots.txt에 의해 차단되어 있는 것을 발견했습니다. 그래서 robots.txt 파일을 직접 확인해 보니, semrushbot과 ahrefsbot이 기본적으로 차단되어 있었습니다:
이 두 가지는 널리 사용되는 SEO 도구인데, 왜 이 봇들을 차단하는 건가요?
neounix
(Dark Matter)
7월 14, 2020, 9:03오전
2
이 봇들은 사이트가 소모하는 리소스에 비해 제공되는 가치가 매우 적은 "리소스를 무차별적으로 소비하는 봇"이기 때문입니다.
물론 원하신다면 Discourse의 robots.txt 파일을 사용자 정의하여 이들을 허용할 수 있습니다. 하지만 우리는 Discourse가 출시되기 훨씬 전에 이미 이 봇들을 차단하고 있으며, 앞으로도 계속 차단할 것입니다.
참고 (수정됨):
이 “리소스를 무차별적으로 소비하는 봇” 중 많은 수가 robots.txt를 무시한다는 점을 언급하는 것을 잊었습니다. 따라서 이들은 HTTP User Agent 레벨에서 차단되어야 합니다. 일반적으로(참고로, 리버스 프록시 뒤에서 실행하는 여러 가지 좋은 이유 중 하나입니다) 우리는 리버스 프록시 레벨에서 mod_rewrite를 사용하여 이 "무례한 리소스 소비 봇"들을 차단합니다.
정보 주셔서 정말 감사합니다!
또 다른 문제를 발견했는데, 이 부분도 의견을 나눠 주실 수 있을까요?
Discourse가 기본적으로 사용자 페이지를 차단하고 있다는 점은 알고 있지만, Google Search Console의 커버리지 보고서에 여전히 몇몇 사용자 페이지가 인덱싱되어 있습니다. 이 페이지들은 인덱싱되지 않아야 하므로 Google 입장에서는 문제가 됩니다:
감사합니다!
osioke
(Osioke Itseuwa)
7월 14, 2020, 12:35오후
4
이 문제는 최근에 수정되었습니다.
committed 05:56AM - 08 Jan 20 UTC
Discourse를 업데이트한 후 다시 확인해 주시겠습니까?
@osioke 답변 감사합니다! 현재 설치된 버전에는 이미 해당 기능이 포함된 것 같습니다. 1월에 해당 수정이 커밋된 것을 확인했기 때문이에요.
이 기능을 사용하려면 최신 버전으로 업그레이드해야 하는지 확인해 주실 수 있을까요?
osioke
(Osioke Itseuwa)
7월 15, 2020, 7:03오전
7
개인적 의견으로는 업데이트하는 데 손해는 없지만, 네, 그 수정 사항은 이미 설치된 버전에는 포함되어 있어야 합니다. 다른 특별한 이유가 없다면 업데이트를 시도한 뒤 다시 확인해 보시는 걸 추천합니다.
그냥 별로라서요? 아무런 이점도 없이 서버 부하를 많이 유발하고, 우리 고객님들은 요금제에 페이지뷰 한도가 있기 때문입니다.
좋네요. 지금 업데이트하고 있습니다. 업데이트 후 문제가 해결되길 바랍니다. 결과를 알려드리도록 하겠습니다. 감사합니다!
확인 차원에서 여쭤봅니다. semrushbot과 SEO 스파이더를 차단 해제할 방법이 전혀 없나요? SEO 감사에 이 봇들이 필요합니다. /admin/customize/robots에서 두 봇을 모두 제거해 보았고(Allow:도 시도해 보았지만) Screaming Frog에서 429 오류가 발생합니다. 아니면 이 429 오류는 별개의 문제일까요? 조언을 부탁드립니다.
Johani
(Joe)
12월 2, 2020, 4:34오후
11
429 오류는 해당 크롤러가 속도 제한(rate-limit)을 받고 있음을 의미합니다. Discourse는 악용을 방지하기 위해 기본적으로 일부 스로틀링(throttling)이 활성화되어 있습니다. 자세한 내용은 여기서 확인할 수 있습니다.
Discourse ships with 3 different global rate limits that can be configured by site admins.
Global per-ip rate limits
These limits apply to every unique IP address that hits the Discourse application. (files that are served directly from the filesystem or the CDN are excluded)
By default this rate limit is enabled, you may disable it or set it to a reporting mode.
DISCOURSE_MAX_REQS_PER_IP_MODE : default block, this rate limit applies out of the box. (other options are warn, warn+block, and n…
neounix
(Dark Matter)
12월 3, 2020, 9:35오전
12
이 방법을 시도해 보셨나요? (다만, 컨테이너 이름을 사용하세요)
참고: Admin UI에서도 이 설정을 구성할 수 있습니다:
# docker exec -it socket-only bash
root@socket-only:/# rails c
[1] pry(main)> SiteSetting.blocked_crawler_user_agents
=> "mauibot|semrushbot|ahrefsbot|blexbot|seo spider"
[2] pry(main)> SiteSetting.blocked_crawler_user_agents = ""
=> ""
[3] pry(main)> SiteSetting.blocked_crawler_user_agents
=> ""
[4] pry(main)>
다음도 참고하세요:
# Available options:
#
# default - The default value of the setting. For upload site settings, use the id of the upload seeded in db/fixtures/010_uploads.rb.
# client - Set to true if the javascript should have access to this setting's value.
# refresh - Set to true if clients should refresh when the setting is changed.
# min - For a string setting, the minimum length. For an integer setting, the minimum value.
# max - For a string setting, the maximum length. For an integer setting, the maximum value.
# regex - A regex that the value must match.
# validator - The name of the class that will be use to validate the value of the setting.
# allow_any - For choice settings allow items not specified in the choice list (default true)
# secret - Set to true if input type should be password and value needs to be scrubbed from logs (default false).
# enum - The setting has a fixed set of allowed values, and only one can be chosen.
# Set to the class name that defines the set.
# locale_default - A hash which overrides according to `SiteSetting.default_locale`.
# The key should be as the same as possible value of default_locale.
#
#
# type: email - Must be a valid email address.
# type: username - Must match the username of an existing user.
# type: list - A list of values, chosen from a set of valid values defined in the choices option.
This file has been truncated. show original
다음도 참고하세요:
def self.allow_crawler?(user_agent)
return true if SiteSetting.allowed_crawler_user_agents.blank? &&
SiteSetting.blocked_crawler_user_agents.blank?
...
...
# frozen_string_literal: true
module CrawlerDetection
WAYBACK_MACHINE_URL = "archive.org"
def self.to_matcher(string, type: nil)
escaped = string.split('|').map { |agent| Regexp.escape(agent) }.join('|')
if type == :real && Rails.env == "test"
# we need this bypass so we properly render views
escaped << "|Rails Testing"
end
Regexp.new(escaped, Regexp::IGNORECASE)
end
def self.crawler?(user_agent, via_header = nil)
return true if user_agent.nil? || user_agent&.include?(WAYBACK_MACHINE_URL) || via_header&.include?(WAYBACK_MACHINE_URL)
# this is done to avoid regenerating regexes
This file has been truncated. show original
코드를 보면 이 두 사이트 설정을 "빈 값(blank)"으로 설정하면 차단이 이루어지지 않음을 알 수 있습니다:
SiteSetting.allowed_crawler_user_agents
SiteSetting.blocked_crawler_user_agents
Discourse 코어에서 기본적으로 차단하는 이 봇들은 robots.txt를 준수하지 않기 때문에 변경하지 않는 것을 권장 합니다. 하지만 이는 사용자의 사이트이므로 원하시는 대로 설정할 수 있습니다. 코어에서 이들을 차단하는 데는 좋은 이유가 있습니다.
그럼에도 불구하고, Discourse는 UI의 SiteSettings를 사용하여 이들을 "차단 해제"할 수 있는 옵션을 제공합니다.