AWSTATS 구성 파일의 Skikhosts에 대한 IP 범위 (Regex)를 어떻게 지정합니까?

StackOverflow https://stackoverflow.com/questions/158008

  •  03-07-2019
  •  | 
  •  

문제

일부 이전 AWSTATS 구성 파일을 업데이트하여 특정 IP 범위를 필터링합니다. 다음은 구성 파일의 관련 섹션입니다.

# Do not include access from clients that match following criteria.
# If your log file contains IP addresses in host field, you must enter here
# matching IP addresses criteria.
# If DNS lookup is already done in your log file, you must enter here hostname
# criteria, else enter ip address criteria.
# The opposite parameter of "SkipHosts" is "OnlyHosts".
# Note: Use space between each value. This parameter is not case sensitive.
# Note: You can use regular expression values writing value with REGEX[value].
# Change : Effective for new updates only
# Example: "127.0.0.1 REGEX[^192\.168\.] REGEX[^10\.]"
# Example: "localhost REGEX[^.*\.localdomain$]"
# Default: ""
#
SkipHosts=""

예를 들어 XYZ를 필터링하고 싶습니다 [97-110

이 형식을 시도했습니다 (참고 : 개인 범위를 예로 사용 하여이 IP 값이 아닙니다) : :

REGEX[^192\.168\.1\.[97-110]]

그러나 다음과 같은 오류가 발생합니다.

CGI 오류
지정된 CGI 응용 프로그램은 HTTP 헤더의 전체 세트를 반환하지 않음으로써 잘못 행동했습니다.

나는 모든 것이 다른 REGEX 구문을 사용하는 방식을 싫어합니다. 누구든지 이것이 어떻게 작동하는지, 여기서 범위를 어떻게 지정할 수 있는지 알고 있습니까?

도움이 되었습니까?

해결책

캐릭터 클래스가 Regex [] 내에서 지원된다고 가정합니다.

SkipHosts = "REGEX[^192\.168\.1\.(9[7-9]|10[0-9]|110)$]"

다른 팁

사용한 Regex는 9 또는 7 내지 1 또는 1 또는 0을 지정하여 엉망입니다.

당신이 사용할 수있는

SkipHosts="REGEX[^192\.168\.1\.(97|98|99|100|101|102|103|104|105|106|107|108|109|110)]"

당신이 너무 경향이 있다면

skikhosts를 비워두면 Awstats가 실행됩니까? 그렇지 않으면 CommandLine 유틸리티를 사용하여 오류를 확인하십시오. 예를 들어 Windows 사용 :

c:\perlpath\perl.exe awstats.pl config=yourconfigfile -update -logfile=yourlogfile

더 자세한 내용을 제시해야합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top