awstats 网站访问量统计,主要用于Web Server为Apache
Install, Setup and Use AWStats
AWStats common use is made in 3 steps:
Step 0 : The install and setup
Step 1 : The build/update of statistics
Step 2 : The reading of results
Before starting, check that your Perl version is at least 5.005_03 (or higher) by running the perl -v command. If not, you can install a recent Perl interpreter from ActivePerl (Win32) or Perl.com (Unix/Linux/Other).
-->
Step 0 : Install and Setup with awstats_configure.pl
A) With Apache or compatible server (on Unix/Linux, Windows, MacOS...)
* Step 0-1:
(if you use a package provided with a Linux distribution or Windows installer, action done in step 0-1 might have already be done, if you don't know you, do it again)
After downloading and extracting the AWStats package, you should run the awstats_configure.pl script to do several setup actions. You will find it in the AWStats tools directory (If using the windows installer, the script is automatically launched):
perl awstats_configure.pl
This is what the script do/ask (you can do all those steps manually instead of running awstats_configure.pl if you prefer):
A) awstats_configure.pl try to find your Apache web server config file (ask path if not found) and check inside your server log format configuration. If you use a common log, awstats_configure.pl will suggest to change it to have NCSA combined/XLF/ELF log format (you can use your own log format but this predefined logformat is often the best choice and make setup easier).
If you answer yes, awstats_configure.pl will modify your httpd.conf to change all the following directives:
CustomLog /yourlogpath/yourlogfile common
into
CustomLog /yourlogpath/yourlogfile combined
See your Apache manual for more information on this directive.
To be sure the log format change is effective, later you can stop Apache, remove all old log files, restart Apache and go to your homepage. This is an example of records you should get then in your new log file:
62.161.78.75 - - [dd/mmm/yyyy:hh:mm:ss +0000] "GET / HTTP/1.1" 200 1234 "http://www.from.com/from.html" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
B) Then, awstats_configure.pl will add, if not already present, the following directives to your Apache config file (note that the "/usr/local/awstats/wwwroot" path might differ according to your distribution or OS:
#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path "/usr/local/awstats/" must reflect your AWStats install path.
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
Options None
AllowOverride None
Order allow,deny
Allow from all
C) awstats_configure.pl restart Apache to apply the changes made in A and B (if changes were made).
D) awstats_configure.pl will ask you a name for a config profile file. Enter here the name of your web server or any analysis profile name, for example myvirtualhostname.
So awstats_configure.pl will copy the file awstats.model.conf file into a new file named awstats.myvirtualhostname.conf. You can use the value of your choice instead of "myvirtualhostname". This new file is stored into:
- For Linux/BSD/Unix users: /etc/awstats.
- For Mac OS X, Windows and other OS: Same directory than awstats.pl (so cgi-bin).
E) awstats_configure.pl ends.
* Step 0-2:
Once a config file has been automatically created (by awstats_configure.pl, by your package installer or just by a manual copy of awstats.model.conf), it's important to edit it manually and change the "MAIN PARAMETERS" to match all your needs:
This is for example the parameters you should check seriously :
- Check/Change LogFile value with full path of your server log file (You can also use a relative path from your awstats.pl directory, but full path avoid errors).
- Check/Change LogType value with "W" for analyzing web server log files, "S" for a streaming server log file, "M" for mail log files, "F" for ftp log files.
- Check if LogFormat has the value "1" (it means "NCSA apache combined/ELF/XLF log format") or use a personalized log format if you don't use combined log format.
- Edit SiteDomain parameter with the main domain name or the intranet web server name used to reach the web site to analyze (Example: www.mydomain.com). If you have several possible name for same site, add list in HostAlias parameter.
- You can also change other parameters if you want.
Step 0 (Install and Setup) is finished. You can jump to the Build/Update Statistics section.
B) With IIS server
* Step 0-1:
Configure IIS to log in "Extended W3C log format" (You can still use your own log format but setup is easier if made like suggested). So, for this, start the IIS Snap-in, select the web site and look at its Properties. Choose W3C Extended Log Format, then Properties, then the Tab Extended Properties and uncheck everything under Extended Properties. Once they are all unchecked, check all following fields:
date
time
c-ip
cs-username
cs-method
cs-uri-stem
cs-uri-query
sc-status
sc-bytes
cs-version
cs(User-Agent)
cs(Referer)
To be sure the log format change is effective, you must stop IIS, remove all old log files, restart IIS and go to your homepage. This is an example of records you should get then in the new log file:
2000-07-19 14:14:14 62.161.78.73 - GET / 200 1234 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+5.01;+Windows+NT+5.0) http://www.from.com/from.htm
* Step 0-2:
Copy the contents of the provided cgi-bin folder from your hard drive to your server's cgi-bin directory (this includes awstats.pl, awstats.model.conf, and the lang, lib and plugins sub-directories).
* Step 0-3:
Move AWStats icon sub-directories and its content into a directory readable by your web server, for example C:/yourwwwroot/icon.
* Step 0-4:
Create a config file by copying awstats.model.conf file into a new file named awstats.myvirtualhostname.conf. You can use the value of your choice instead of "myvirtualhostname". This new file must be stored in
- Same directory than awstats.pl (so cgi-bin)
* Step 0-5:
Edit this new config file with your own setup :
- Change LogFile value with full path of your web server log file (You can also use a relative path from your awstats.pl directory).
- Change LogType value with "W" for analyzing web server log files, "S" for a streaming server log file, "M" for mail log files, "F" for ftp log files, "O" otherwise.
- Change LogFormat to a value with same field's name defined in step 0-1:
LogFormat="date time c-ip cs-username cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs-version cs(User-Agent) cs(Referer)"
- Change DirIcons parameter to reflect relative path of icon directory.
- Edit SiteDomain parameter with the main domain name or the intranet web server name used to reach the web site to analyze (Example: www.mydomain.com).
- Set AllowToUpdateStatsFromBrowser parameter to 1 if you don't have command line access and have only cgi access.
- You can change other parameters if you want.
Step 0 (Install and Setup) is finished. You can jump to the Build/Update Statistics section.
C) With other web servers
Setup process is similar to setup for Apache or IIS.
Use LogFormat to value "3" if you have WebStar native log format, use a personalized LogFormat if your log format is other.
Step 1 : Build/Update Statistics
* Step 1-1:
The first analyze/update of statistics should be made the first time manually from the command line since first time, process may be long and it's easier to solve problems (if you don't have Command Line access, just go to Step 1-2). The AWStats update command line is:
awstats.pl -config=myvirtualhostname -update
AWStats will read the config file awstats.myvirtualhostname.conf (or if not found, awstats.conf) and create/update its database with all summary information issued from analyzed log file.
AWStats database files are saved in directory defined by DirData parameter in config file.
When update is finished, you should get on screen a result like this:
Update for config "/etc/awstats/awstats.myvirtualhostname.conf"
With data in log file "/pathtoyourlog/yourlog.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 225730
Found 122 dropped records,
Found 87 corrupted records,
Found 0 old records,
Found 225521 new qualifed records.
Dropped records are records discarded because they were not user HTTP request or requests were not qualified by AWStats filters (See SkipHosts, SkipUserAgents, SkipFiles, OnlyHosts, OnlyUserAgents and OnlyFiles parameters). If you want to see which lines were dropped, you can add the -showdropped option on command line.
Corrupted records are records that does not match log format defined by "LogFormat" parameter in AWStats config/domain file. With all webservers you can experience a little bit corrupted records (If all your lines are corrupted and LogFormat parameter in AWStats config/domain file is correct, it may be the log format setup in your web server that is wrong. Don't forget that your LogFormat parameter in AWStats config/domain file MUST match the log file format you analyze.
If you want to see which lines are corrupted, you can add the -showcorrupted option on command line.
Old records are simply records that were already processed by a previous update process. You understood that it's not necessary to purge your log file after each update process even if it's highly recommended to do it as often as possible.
New records are records in your log file that were successfully used to build/update statistics.
Note : A log analysis process is slow (one second for each 4500 lines of your logfile with Athlon 1Ghz, plus DNS resolution time for each different IP address in your logfile if DNSLookup is set to 1 and not already done in your log file).
See Benchmark page for more accurate information.
* Step 1-2:
AWStats statistics can be updated from a browser, to provide real-time statistics, by clicking the "Update now" link that appears when AWStats is used as a CGI (Next section 'Read Statistics dynamically' gives you URL to use for that).
Warning !!
To enable this link, your parameter AllowToUpdateStatsFromBrowser must be set to 1 in your config file (Link is not enabled by default).
Then, using on-line update does not prevent you from running the update process from a scheduler frequently (command is same than update of first process).
For this, you have two choices:
- Include the update command in your logrotate process. See FAQ-COM120 for this.
- Or add instructions in your crontab (Unix/Linux) or your task scheduler (for Windows), to launch frequently the Awstats update process. See FAQ-COM130 for this.
See AWStats Benchmark page for recommanded update/logrotate frequency.
Step 2 : Read Statistics
To see results of analyze, you have several solutions depending on your security policy.
* First solution is to build the main reports, in a static HTML page, from the command line, like this (jump to second solution if you have ONLY CGI access):
perl awstats.pl -config=myvirtualhostname -output -staticlinks > awstats.myvirtualhostname.html
You can use all other output options (each of them give you another report). This is how to use all other possible output options(1) :
perl awstats.pl -config=myvirtualhostname -output=alldomains -staticlinks > awstats.myvirtualhostname.alldomains.html
perl awstats.pl -config=myvirtualhostname -output=allhosts -staticlinks > awstats.myvirtualhostname.allhosts.html
perl awstats.pl -config=myvirtualhostname -output=lasthosts -staticlinks > awstats.myvirtualhostname.lasthosts.html
perl awstats.pl -config=myvirtualhostname -output=unknownip -staticlinks > awstats.myvirtualhostname.unknownip.html
perl awstats.pl -config=myvirtualhostname -output=alllogins -staticlinks > awstats.myvirtualhostname.alllogins.html
perl awstats.pl -config=myvirtualhostname -output=lastlogins -staticlinks > awstats.myvirtualhostname.lastlogins.html
perl awstats.pl -config=myvirtualhostname -output=allrobots -staticlinks > awstats.myvirtualhostname.allrobots.html
perl awstats.pl -config=myvirtualhostname -output=lastrobots -staticlinks > awstats.myvirtualhostname.lastrobots.html
perl awstats.pl -config=myvirtualhostname -output=urldetail -staticlinks > awstats.myvirtualhostname.urldetail.html
perl awstats.pl -config=myvirtualhostname -output=urlentry -staticlinks > awstats.myvirtualhostname.urlentry.html
perl awstats.pl -config=myvirtualhostname -output=urlexit -staticlinks > awstats.myvirtualhostname.urlexit.html
perl awstats.pl -config=myvirtualhostname -output=browserdetail -staticlinks > awstats.myvirtualhostname.browserdetail.html
perl awstats.pl -config=myvirtualhostname -output=osdetail -staticlinks > awstats.myvirtualhostname.osdetail.html
perl awstats.pl -config=myvirtualhostname -output=unknownbrowser -staticlinks > awstats.myvirtualhostname.unknownbrowser.html
perl awstats.pl -config=myvirtualhostname -output=unknownos -staticlinks > awstats.myvirtualhostname.unknownos.html
perl awstats.pl -config=myvirtualhostname -output=refererse -staticlinks > awstats.myvirtualhostname.refererse.html
perl awstats.pl -config=myvirtualhostname -output=refererpages -staticlinks > awstats.myvirtualhostname.refererpages.html
perl awstats.pl -config=myvirtualhostname -output=keyphrases -staticlinks > awstats.myvirtualhostname.keyphrases.html
perl awstats.pl -config=myvirtualhostname -output=keywords -staticlinks > awstats.myvirtualhostname.keywords.html
perl awstats.pl -config=myvirtualhostname -output=errors404 -staticlinks > awstats.myvirtualhostname.errors404.html
Note (1): If you prefer, you can use awstats_buildstaticpages tool to build all those pages in one command or to generate PDF files.
Note (2): You can also add a filter on the following output reports:urldetail, urlentry, urlexit, allhosts, refererpages.
filter can be a regexp on the full key you want awstats to present information about and you must use it after the output parameter separated by a ":".
For example, to output the urldetail report, with a filter on all pages that contains /news, you can use the following command line:
perl awstats.pl -config=myvirtualhostname -output=urldetail:/news -staticlinks > awstats.myvirtualhostname.urldetailwithfilter.html
Note (3): If you want to build a report for a particular month, add options -month=MM -year=YYYY.
To build a report for full year (warning: This may use a lot of memory and CPU), add options -month=all -year=YYYY.
* Second solution is to view dynamically your statistics from a browser. For this, use URL:
http://www.myserver.mydomain/awstats/awstats.pl?config=myvirtualhostname
where myvirtualhostname is used to know which config file to use (AWStats will use awstats.myvirtualhostname.conf file).
Note (1): All output command line options (except -staticlinks) are still available when using AWStats as a browser.
Just use them as URL parameters like this example http://www.myserver.mydomain/awstats/awstats.pl?month=MM&year=YYYY&output=unknownos
Note (2): If AllowToUpdateStatsFromBrowser parameter is set to 1 in AWStats config/domain file, you will also be able to run the update process from your browser. Just click on link "Update now".

MySQL Index Cardinality는 쿼리 성능에 중대한 영향을 미칩니다. 1. 높은 카디널리티 인덱스는 데이터 범위를보다 효과적으로 좁히고 쿼리 효율성을 향상시킬 수 있습니다. 2. 낮은 카디널리티 인덱스는 전체 테이블 스캔으로 이어질 수 있으며 쿼리 성능을 줄일 수 있습니다. 3. 관절 지수에서는 쿼리를 최적화하기 위해 높은 카디널리티 시퀀스를 앞에 놓아야합니다.

MySQL 학습 경로에는 기본 지식, 핵심 개념, 사용 예제 및 최적화 기술이 포함됩니다. 1) 테이블, 행, 열 및 SQL 쿼리와 같은 기본 개념을 이해합니다. 2) MySQL의 정의, 작업 원칙 및 장점을 배우십시오. 3) 인덱스 및 저장 절차와 같은 기본 CRUD 작업 및 고급 사용량을 마스터합니다. 4) 인덱스의 합리적 사용 및 최적화 쿼리와 같은 일반적인 오류 디버깅 및 성능 최적화 제안에 익숙합니다. 이 단계를 통해 MySQL의 사용 및 최적화를 완전히 파악할 수 있습니다.

MySQL의 실제 응용 프로그램에는 기본 데이터베이스 설계 및 복잡한 쿼리 최적화가 포함됩니다. 1) 기본 사용 : 사용자 정보 삽입, 쿼리, 업데이트 및 삭제와 같은 사용자 데이터를 저장하고 관리하는 데 사용됩니다. 2) 고급 사용 : 전자 상거래 플랫폼의 주문 및 재고 관리와 같은 복잡한 비즈니스 로직을 처리합니다. 3) 성능 최적화 : 인덱스, 파티션 테이블 및 쿼리 캐시를 사용하여 합리적으로 성능을 향상시킵니다.

MySQL의 SQL 명령은 DDL, DML, DQL 및 DCL과 같은 범주로 나눌 수 있으며 데이터베이스 및 테이블을 작성, 수정, 삭제, 삽입, 업데이트, 데이터 삭제 및 복잡한 쿼리 작업을 수행하는 데 사용됩니다. 1. 기본 사용에는 CreateTable 생성 테이블, InsertInto 삽입 데이터 및 쿼리 데이터 선택이 포함됩니다. 2. 고급 사용에는 테이블 조인, 하위 쿼리 및 데이터 집계에 대한 GroupBy 조인이 포함됩니다. 3. 구문 검사, 데이터 유형 변환 및 권한 관리를 통해 구문 오류, 데이터 유형 불일치 및 권한 문제와 같은 일반적인 오류를 디버깅 할 수 있습니다. 4. 성능 최적화 제안에는 인덱스 사용, 전체 테이블 스캔 피하기, 조인 작업 최적화 및 트랜잭션을 사용하여 데이터 일관성을 보장하는 것이 포함됩니다.

Innodb는 잠금 장치 및 MVCC를 통한 Undolog, 일관성 및 분리를 통해 원자력을 달성하고, Redolog를 통한 지속성을 달성합니다. 1) 원자력 : Undolog를 사용하여 원래 데이터를 기록하여 트랜잭션을 롤백 할 수 있는지 확인하십시오. 2) 일관성 : 행 수준 잠금 및 MVCC를 통한 데이터 일관성을 보장합니다. 3) 격리 : 다중 격리 수준을지지하고 반복적 인 방사선이 기본적으로 사용됩니다. 4) 지속성 : Redolog를 사용하여 수정을 기록하여 데이터가 오랫동안 저장되도록하십시오.

데이터베이스 및 프로그래밍에서 MySQL의 위치는 매우 중요합니다. 다양한 응용 프로그램 시나리오에서 널리 사용되는 오픈 소스 관계형 데이터베이스 관리 시스템입니다. 1) MySQL은 웹, 모바일 및 엔터프라이즈 레벨 시스템을 지원하는 효율적인 데이터 저장, 조직 및 검색 기능을 제공합니다. 2) 클라이언트 서버 아키텍처를 사용하고 여러 스토리지 엔진 및 인덱스 최적화를 지원합니다. 3) 기본 사용에는 테이블 작성 및 데이터 삽입이 포함되며 고급 사용에는 다중 테이블 조인 및 복잡한 쿼리가 포함됩니다. 4) SQL 구문 오류 및 성능 문제와 같은 자주 묻는 질문은 설명 명령 및 느린 쿼리 로그를 통해 디버깅 할 수 있습니다. 5) 성능 최적화 방법에는 인덱스의 합리적인 사용, 최적화 된 쿼리 및 캐시 사용이 포함됩니다. 모범 사례에는 거래 사용 및 준비된 체계가 포함됩니다

MySQL은 소규모 및 대기업에 적합합니다. 1) 소기업은 고객 정보 저장과 같은 기본 데이터 관리에 MySQL을 사용할 수 있습니다. 2) 대기업은 MySQL을 사용하여 대규모 데이터 및 복잡한 비즈니스 로직을 처리하여 쿼리 성능 및 트랜잭션 처리를 최적화 할 수 있습니다.

InnoDB는 팬텀 읽기를 차세대 점화 메커니즘을 통해 효과적으로 방지합니다. 1) Next-Keylocking은 Row Lock과 Gap Lock을 결합하여 레코드와 간격을 잠그기 위해 새로운 레코드가 삽입되지 않도록합니다. 2) 실제 응용 분야에서 쿼리를 최적화하고 격리 수준을 조정함으로써 잠금 경쟁을 줄이고 동시성 성능을 향상시킬 수 있습니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

VSCode Windows 64비트 다운로드
Microsoft에서 출시한 강력한 무료 IDE 편집기

드림위버 CS6
시각적 웹 개발 도구

WebStorm Mac 버전
유용한 JavaScript 개발 도구

안전한 시험 브라우저
안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경
