您好,登錄后才能下訂單哦!
AWstats介紹
Awstats是一個免費非常簡潔而且強大有個性的網站日志分析工具。
它可以統計您站點的如下信息:
一:訪問量,訪問次數,頁面瀏覽量,點擊數,數據流量等
二:精確到每月、每日、每小時的數據
三:訪問者國家
四:訪問者IP
五:Robots/Spiders的統計
六:訪客持續時間
七:對不同Files type 的統計信息
八:Pages-URL的統計
九:訪客操作系統瀏覽器等信息
十:其它信息(搜索關鍵字等等)
環境:
Centos7 操作系統 服務器IP 192.168.30.31。
已經部署好的Nginx服務器我這里使用的是編譯安裝的。
已經做好的DNS正向解析,通過www.aa.com可以正常訪問到該服務器。
部署服務:
安裝AWstats之前確認服務器上Perl環境已經安裝好。
1、解壓并安裝AWstats
[root@lin3031 ~]# tar xf awstats-7.6.tar.gz
[root@lin3031 ~]# mv awstats-7.6 /usr/local/awstats
修改awstats屬主屬組
[root@lin3031 local]# chown root.root -R /usr/local/awstats/
進入tools目錄
[root@lin3031 local]# cd /usr/local/awstats/tools/
2、為www.aa.com站點新建統計配置文件,借助awstats提供的awstats_configure.pl腳本進行創建,
[root@lin3031 tools]# ./awstats_configure.pl
----- AWStats awstats_configure 1.0 (build 20140126) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).
-----> Running OS detected: Linux, BSD or Unix
-----> Check for web server install
Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> none #Nginx輸入none
Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)
-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
File awstats.model.conf updated.
-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y #輸入y
-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> www.aa.com #輸入需要統計的域名
-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
> #保持默認并回車
-----> Create config file '/etc/awstats/awstats.www.aa.com.conf'
Config file /etc/awstats/awstats.www.aa.com.conf created.
-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.aa.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue... #回車
A SIMPLE config file has been created: /etc/awstats/awstats.www.aa.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.aa.com' with command:
> perl awstats.pl -update -config=www.aa.com
You can also build static report pages for 'www.aa.com' with command:
> perl awstats.pl -output=pagetype -config=www.aa.com
Press ENTER to finish... #回車
3、修改www.aa.com統計配置文件
[root@lin3031 ~]# vim /etc/awstats/awstats.www.aa.com.conf
修改nginx日志文件位置
數據目錄,awstats目錄默認不存在需要創建
創建/var/lib/awstats目錄
[root@lin3031 ~]# mkdir -p /var/lib/awstats
4 、更新分析日志文件
[root@lin3031 ~]# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.aa.com
5、生成靜態分析日志網頁數據
[root@lin3031 ~]# /usr/local/awstats/tools/awstats_buildstaticpages.pl -update -config=www.aa.com -lang=cn -dir=/usr/local/awstats/wwwroot -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl
上述命令解釋如下:
? /usr/local/awstats/tools/awstats_buildstaticpages.pl :awstats靜態頁面生成工具
? -update -config=www.test.com :更新配置域名
? -lang=cn :語言為中文
? dir=/usr/local/awstats/wwwroot :統計結果輸出的目錄
? awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl :日志更新程序的路徑
修改nginx的conf文件使其訪問www.aa.com 和www.aa.com/awstats 互不影響
o
效果如下
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。