AWstats介紹
創新互聯成立于2013年,是專業互聯網技術服務公司,擁有項目成都網站設計、網站建設網站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元象山做網站,已為上家服務,為象山各地企業和個人服務,聯系電話:13518219792Awstats是一個免費非常簡潔而且強大有個性的網站日志分析工具。
它可以統計您站點的如下信息:
一:訪問量,訪問次數,頁面瀏覽量,點擊數,數據流量等
二:精確到每月、每日、每小時的數據
三:訪問者國家
四:訪問者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
效果如下
另外有需要云服務器可以了解下創新互聯cdcxhl.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
標題名稱:Nginx使用AWStats日志分析-創新互聯
分享鏈接:http://m.kartarina.com/article14/cdssde.html
成都網站建設公司_創新互聯,為您提供用戶體驗、自適應網站、商城網站、微信小程序、建站公司、網站內鏈
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯