Nginx使用AWStats日志分析-創(chuàng)新互聯(lián)

AWstats介紹

創(chuàng)新互聯(lián)成立于2013年,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢想脫穎而出為使命,1280元象山做網(wǎng)站,已為上家服務(wù),為象山各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:13518219792

Awstats是一個(gè)免費(fèi)非常簡潔而且強(qiáng)大有個(gè)性的網(wǎng)站日志分析工具。

它可以統(tǒng)計(jì)您站點(diǎn)的如下信息:

一:訪問量,訪問次數(shù),頁面瀏覽量,點(diǎn)擊數(shù),數(shù)據(jù)流量等

二:精確到每月、每日、每小時(shí)的數(shù)據(jù)

三:訪問者國家

四:訪問者IP

五:Robots/Spiders的統(tǒng)計(jì)

六:訪客持續(xù)時(shí)間

七:對(duì)不同F(xiàn)iles type 的統(tǒng)計(jì)信息

八:Pages-URL的統(tǒng)計(jì)

九:訪客操作系統(tǒng)瀏覽器等信息

十:其它信息(搜索關(guān)鍵字等等)

環(huán)境:

Centos7 操作系統(tǒng) 服務(wù)器IP 192.168.30.31。

已經(jīng)部署好的Nginx服務(wù)器我這里使用的是編譯安裝的。

已經(jīng)做好的DNS正向解析,通過www.aa.com可以正常訪問到該服務(wù)器。

部署服務(wù):

安裝AWstats之前確認(rèn)服務(wù)器上Perl環(huán)境已經(jīng)安裝好。

Nginx使用AWStats日志分析

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/

進(jìn)入tools目錄

[root@lin3031 local]# cd /usr/local/awstats/tools/

2、為www.aa.com站點(diǎn)新建統(tǒng)計(jì)配置文件,借助awstats提供的awstats_configure.pl腳本進(jìn)行創(chuàng)建,

[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  #輸入需要統(tǒng)計(jì)的域名

-----> 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):

>    #保持默認(rèn)并回車

-----> 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統(tǒng)計(jì)配置文件

[root@lin3031 ~]# vim /etc/awstats/awstats.www.aa.com.conf

修改nginx日志文件位置

Nginx使用AWStats日志分析

數(shù)據(jù)目錄,awstats目錄默認(rèn)不存在需要?jiǎng)?chuàng)建

Nginx使用AWStats日志分析

創(chuàng)建/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、生成靜態(tài)分析日志網(wǎng)頁數(shù)據(jù)

[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靜態(tài)頁面生成工具

? -update -config=www.test.com :更新配置域名

? -lang=cn :語言為中文

? dir=/usr/local/awstats/wwwroot :統(tǒng)計(jì)結(jié)果輸出的目錄

? awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl :日志更新程序的路徑

修改nginx的conf文件使其訪問www.aa.com 和www.aa.com/awstats 互不影響

Nginx使用AWStats日志分析o

效果如下

Nginx使用AWStats日志分析

Nginx使用AWStats日志分析

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

標(biāo)題名稱:Nginx使用AWStats日志分析-創(chuàng)新互聯(lián)
分享鏈接:http://muchs.cn/article14/cdssde.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗(yàn)、自適應(yīng)網(wǎng)站、商城網(wǎng)站、微信小程序建站公司、網(wǎng)站內(nèi)鏈

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司