查看完整版本: 網站流量分析軟體 Webalizer 安裝


ohmyadj 2008-1-5 10:09

網站流量分析軟體 Webalizer 安裝

<FONT size=3><FONT color=#0000ff>一.前言:</FONT></FONT><BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Webalizer 是一個好用的Web Server 紀錄檔分析軟體,它除了能夠分析 Apache web server 所產生的log 紀錄檔之外,還能夠分析FTP 的 Log 檔,以相當精美的HTML網頁輸出,目前相當多的網站便是使用這一個軟體作為流量分析統計之用,因此在這邊也分享給各位來使用。 <BR>&nbsp; &nbsp;&nbsp; &nbsp; Webalizer 還有一個好處便是您可以透過這個軟體來分析網站的運作情況,同時還有支援中文語系,不過要使用時請先看一下 INSTALL 及 README 兩個檔案,因為並不是很好安裝,同時設定也頗為困難,您可能先要了解 Apache Web Server 的運作才比較能夠了解選項的內容. <BR><BR>如何取得Package(目前最新版為webalizer-2.01-09): <BR>Webalizer Homepage: <A href="http://www.mrunix.net/webalizer/download.html" target=_blank><FONT color=#0000ff>http://www.mrunix.net/webalizer/download.html</FONT></A><BR>ADJ網頁流量分析: <A href="http://www.adj.idv.tw/usage" target=_blank><FONT color=#800080>http://www.adj.idv.tw/usage</FONT></A><BR><BR><FONT color=#6600ff>Before you compiler, decompress the tarball (tar.gz) : </FONT><BR>

<BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="95%">
<TBODY>
<TR>
<TD>[root@linux /]# <B>cp</B> webalizer-2.01-09-src.tgz /home/webalizer/[root@linux /]# <B>cd</B> /home/webalizer/[root@linux webalizer]# <B>tar</B> zxvf webalizer-2.01-09-src.tgz</TD></TR></TBODY></TABLE><FONT color=#6600ff></FONT><BR><FONT color=#6600ff>說明一下,由於網頁輸出時會用到 gd 這一個程式來作繪圖的部分,所以你必須先要有gd這一個軟體。您可以透過這個指令來看看是否有安裝gd:</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]# <B>rpm</B> -qi gdName&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;: gd&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Relocations: /usr<BR>Version&nbsp; &nbsp;&nbsp;&nbsp;: 1.3&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; Vendor: Red Hat, Inc.<BR>Release&nbsp; &nbsp;&nbsp;&nbsp;: 6&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Build Date: 西元2000年02月04日 (星期五) 01時31分42秒<BR>Install date: 西元2001年08月02日 (星期四) 11時59分35秒&nbsp; &nbsp;&nbsp; &nbsp;Build Host: porky.devel.redhat.com<BR>Group&nbsp; &nbsp;&nbsp; &nbsp; : System Environment/Libraries&nbsp; &nbsp;Source RPM: gd-1.3-6.src.rpm<BR>Size&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;: 322718&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;License: BSD-style<BR>Packager&nbsp; &nbsp; : Red Hat, Inc. &lt;<A href="http://bugzilla.redhat.com/bugzilla" target=_blank>http://bugzilla.redhat.com/bugzilla&gt;</A>;<BR>Summary&nbsp; &nbsp;&nbsp;&nbsp;: A graphics library for drawing .gif files.<BR>Description :<BR>Gd is a graphics library for drawing .gif files.&nbsp;&nbsp;Gd allows your code to<BR>quickly draw images (lines, arcs, text, multiple colors, cutting and<BR>pasting from other images, flood fills) and write out the result as a<BR>.gif file. Gd is particularly useful in web applications, where .gifs<BR>are commonly used as inline images.&nbsp;&nbsp;Note, however, that gd is not a<BR>paint program.Install gd if you are developing applications which need to draw .gif<BR>files. If you install gd, you'll also need to install the gd-devel<BR>package.<BR>&nbsp; &nbsp;&nbsp; &nbsp; </TD></TR></TBODY></TABLE><FONT color=#0000ff></FONT><BR><FONT size=3><FONT color=#0000ff>二.Compile webalizer:</FONT></FONT><BR><FONT color=#6600ff>Move into the new Webalizer directory and type the following commands on your terminal: </FONT><BR><FONT color=#6600ff>--with-language=chinese:就是讓webalizer變成中文化</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]#./configure --with-language=chinese --with-gdlib=/usr/lib --with-gd=/usr/bin [root@linux webalizer]#make<BR>[root@linux webalizer]#mkdir /var/www/html/usage</TD></TR></TBODY></TABLE><FONT color=#6600ff></FONT><BR><FONT color=#6600ff>Compiler之後.資料夾會多幾個檔案:</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]#lsCHANGES&nbsp; &nbsp;&nbsp; &nbsp; README.FIRST&nbsp; &nbsp;&nbsp; &nbsp; dns_resolv.h&nbsp;&nbsp;lang/&nbsp; &nbsp;&nbsp; &nbsp; parser.c&nbsp; &nbsp;&nbsp;&nbsp;webalizer.LSM<BR>COPYING&nbsp; &nbsp;&nbsp; &nbsp; aclocal.m4&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;dns_resolv.o&nbsp;&nbsp;lang.h&nbsp; &nbsp;&nbsp; &nbsp;parser.h&nbsp; &nbsp;&nbsp;&nbsp;webalizer.c<BR>Copyright&nbsp; &nbsp;&nbsp;&nbsp;config.cache&nbsp; &nbsp;&nbsp; &nbsp; graphs.c&nbsp; &nbsp;&nbsp; &nbsp;linklist.c&nbsp;&nbsp;parser.o&nbsp; &nbsp;&nbsp;&nbsp;webalizer.h<BR>DNS.README&nbsp; &nbsp; config.log&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;graphs.h&nbsp; &nbsp;&nbsp; &nbsp;linklist.h&nbsp;&nbsp;preserve.c&nbsp; &nbsp;webalizer.o<BR>INSTALL&nbsp; &nbsp;&nbsp; &nbsp; config.status*&nbsp; &nbsp;&nbsp;&nbsp;graphs.o&nbsp; &nbsp;&nbsp; &nbsp;linklist.o&nbsp;&nbsp;preserve.h&nbsp; &nbsp;webalizer.png<BR>Makefile&nbsp; &nbsp;&nbsp; &nbsp;configure*&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;hashtab.c&nbsp; &nbsp;&nbsp;&nbsp;msfree.png&nbsp;&nbsp;preserve.o&nbsp; &nbsp;webalizer_lang.h@<BR>Makefile.in&nbsp; &nbsp;configure.in&nbsp; &nbsp;&nbsp; &nbsp; hashtab.h&nbsp; &nbsp;&nbsp;&nbsp;output.c&nbsp; &nbsp; sample.conf&nbsp;&nbsp;webazolver@<BR>Makefile.std&nbsp;&nbsp;country-codes.txt&nbsp;&nbsp;hashtab.o&nbsp; &nbsp;&nbsp;&nbsp;output.h&nbsp; &nbsp; webalizer*<BR>README&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;dns_resolv.c&nbsp; &nbsp;&nbsp; &nbsp; install-sh*&nbsp; &nbsp;output.o&nbsp; &nbsp; webalizer.1<BR></TD></TR></TBODY></TABLE><FONT color=#6600ff></FONT><BR><FONT color=#6600ff>To run Webalizer, the following file is required, and must be created or copied to the appropriate directory on your server:</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]#cp webalizer /usr/bin/[root@linux webalizer]#cd /etc[root@linux etc]#ls webalizer*webalizer.conf.sample<BR>[root@linux etc]#cp webalizer.conf.sample webalizer.conf.adj[root@linux etc]#vi webalizer.conf.adj</TD></TR></TBODY></TABLE><FONT color=#0000ff></FONT><BR><FONT size=3><FONT color=#0000ff>三.Configure the /etc/webalizer.conf file:</FONT></FONT><BR><BR><FONT color=#6600ff>Edit the webalizer.conf.adj file(將裡面的值改成下列):</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>LogFile /var/log/httpd/access_log<BR>OutputDir /var/www/html/usage<BR>HostName&nbsp;&nbsp;<A href="http://www.adj.idv.twincremental/" target=_blank>www.adj.idv.twIncremental</A>&nbsp;&nbsp;yes<BR>PageType&nbsp;&nbsp;htm*<BR>PageType&nbsp;&nbsp;cgi<BR>PageType&nbsp;&nbsp;php<BR>HideURL&nbsp;&nbsp;*.gif<BR>HideURL&nbsp;&nbsp;*.GIF<BR>HideURL&nbsp;&nbsp;*.jpg<BR>HideURL&nbsp;&nbsp;*.JPG<BR>HideURL&nbsp;&nbsp;*.ra<BR>IgnoreURL&nbsp;&nbsp;/taskbar*<BR></TD></TR></TBODY></TABLE><FONT color=#0000ff></FONT><BR><FONT size=3><FONT color=#0000ff>四.Make Apache aware of Webalizer output directory:</FONT></FONT><BR>Once Webalizer has been installed in the system we must add the following lines into the httpd.conf file of Apache to be able to locate and use it features:<BR><FONT color=#336600></FONT><BR><FONT color=#336600>1.編輯 httpd.conf , vi /etc/httpd/conf/httpd.conf and add the following lines :</FONT> <BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>&lt;Directory "/var/www/html/usage"&gt;<BR>Options None<BR>AllowOverride None<BR>Order deny,allow<BR>Allow from all<BR>&lt;/Directory&gt;<BR></TD></TR></TBODY></TABLE><FONT color=#336600></FONT><BR><FONT color=#336600>2.別忘了重起 Apache:</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]#service httpd restartShutting down http:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;[&nbsp;&nbsp;OK&nbsp;&nbsp;]<BR>Starting httpd:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&nbsp;&nbsp;OK&nbsp;&nbsp;]<BR></TD></TR></TBODY></TABLE><FONT size=3><FONT color=#0000ff></FONT></FONT><BR><FONT size=3><FONT color=#0000ff>五:Running Webalizer manually first time:</FONT></FONT><BR><FONT color=#6600ff>第一次手動執行 Webalizer ,會有找不到記錄的現像..這是正常的...只要執行過第二次...就沒問題囉..:</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]#/usr/bin/webalizer -c /etc/webalizer.conf.adj<BR></TD></TR></TBODY></TABLE><FONT color=#6600ff></FONT><BR><FONT color=#6600ff>正常訊息如下:</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]#/usr/bin/webalizer -c /etc/webalizer.conf.adj<BR>Webalizer V2.01-09 (Linux 2.4.3-20mdk) Chinese<BR>使用記錄檔 /var/log/httpd/access_log (clf)<BR>產生輸出於 /var/www/html/usage<BR>主機名稱是 'www.adj.idv.tw'<BR>讀取歷史記錄 webalizer.hist<BR>Reading previous run data.. webalizer.current<BR>Saving current run data... [03/03/2002 18:21:06]<BR>產生報表給 三月 2002<BR>產生彙總報表<BR>儲存歷史記錄資訊<BR>120778 記錄 (119881 忽略) in 6.02 秒, 20062/sec<BR></TD></TR></TBODY></TABLE><FONT color=#6600ff></FONT><BR><FONT color=#6600ff>設定crontab ..讓它每二小時跑一次:</FONT><BR><BR>
<TABLE style="BACKGROUND: #e0e0e0" class=t_table width="90%">
<TBODY>
<TR>
<TD>[root@linux webalizer]#crontab -e0 */2 * * * /usr/bin/webalizer -c /etc/webalizer.conf.adj<BR></TD></TR></TBODY></TABLE><FONT color=#6600ff></FONT><BR><FONT color=#6600ff>執行結果如下:</FONT><BR><BR>[attach]49[/attach]<BR><BR>這樣就大公告成啦....Good Lucky Everyone!!!
頁: [1]
查看完整版本: 網站流量分析軟體 Webalizer 安裝