⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asg13.htm

📁 apache技术手册
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Counting the Unique Number of Visitors</B></FONT></CENTER></H4>

<BR>

<P>If you are interested in counting the number of visitors and you are logging the cookie information as in our example log format, it becomes a matter of just counting the number of unique cookies in our log file. On entering the site, each visitor is assigned a unique cookie by Apache. A cookie looks like the following:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">Apache=##################</FONT></PRE>

<P>Each # character represents a number. Counting users becomes a matter of counting unique cookies. The following series of commands retrieves this information:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">awk '{print $11}' <I>logfile</I> | sort | uniq | wc -l</FONT></PRE>

<P>The awk command prints the eleventh field in the file. Fields in the <I>logfile</I> are separated by spaces, so each space creates a field. Output containing only the cookies numbers is piped to sort, which will sort all the cookies in numerical order. The sorted output is piped to uniq, which removes duplicate lines. Finally, the thinned out list is sent to wc which counts the number of lines in the result. This number matches the number of unique visitors that came to your site. For more information on these commands, please consult your UNIX documentation.

<BR>

<BR>

<A NAME="E69E156"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Using </B><B>grep</B><B> to Determine the Origin of the User</B></FONT></CENTER></H4>

<BR>

<P>Another tool that is very useful for extracting information from your logs is the grep program.

<BR>

<P>By issuing the simple command

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">grep ibm.com access_log</FONT></PRE>

<P>You can see all the requests that originated from the ibm.com domain. If you just wanted a count of the accesses that came from the ibm.com domain, issue a -c flag to the command:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">grep -c ibm.com access_log</FONT></PRE>

<BR>

<A NAME="E69E157"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Daily Statistics</B></FONT></CENTER></H4>

<BR>

<P>If you wanted command a quick count of all the hits that your site sustained on a certain date, say on July 19, 1996, type the following:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">grep -c 19/Jul/1996 access_log</FONT></PRE>

<P>To count all hits that your site sustained on July 19, 1996, between 3 and 3:59 p.m. (15:00 hours, UNIX time is expressed in the 24-hour format), type the following:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">grep -c &quot;19/Jul/1996:15&quot; access_log</FONT></PRE>

<BR>

<A NAME="E69E158"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Home Page Statistics</B></FONT></CENTER></H4>

<BR>

<P>To count all accesses command to your home page, type the following:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">grep -c &quot;GET / &quot; access_log</FONT></PRE>

<P>or 

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">grep -c &quot;GET /index.html &quot; access_log</FONT></PRE>

<P>or

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">grep -c &quot;~/<I>username</I>&quot; accesslog</FONT></PRE>

<P>The sum of these two searches is the number of total accesses to your home page, assuming that your home page is at the root directory and it is named index.html. For private home pages, you should use the third option. Just replace <I>username</I> with the login of the user.

<BR>

<BR>

<A NAME="E69E159"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Searching the Error Log</B></FONT></CENTER></H4>

<BR>

<P>You should frequently check your error logs. Of special interest are the following messages user not found or password mismatch. If you get many repeated lines with these errors, someone may be trying to break into your site.

<BR>

<BR>

<A NAME="E68E155"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Tools for Summarizing Information</B></FONT></CENTER></H3>

<BR>

<P>While the command line is invaluable for creating on-demand reports that search for something very specific, there are many tools available that create nice reports that summarize most everything you want to know about your site's traffic. Many of these tools are free, and they all answer, in varying degrees of greatness, the following <A NAME="I15"></A>basic questions:

<BR>

<UL>

<LI>Who is visiting your site?

<BR>

<BR>

<LI>How many visitors are there and where are they from?

<BR>

<BR>

<LI>What are the most popular areas of your site?

<BR>

<BR>

<LI>What are your site's peak load times?

<BR>

<BR>

</UL>

<P>Your choice will depend on what type of output you like. These tools are available in two types: graphical and text. You can find free, shareware, and expensive versions of these tools. Shop closely, and look on the Net for the latest on these tools. A good place to search is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080"><A HREF="javascript:if(confirm('http://www.yahoo.com/Computers_and_Internet/World_Wide_Web/HTTP/Servers/Log_ Analysis_Tools/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.yahoo.com/Computers_and_Internet/World_Wide_Web/HTTP/Servers/Log_ Analysis_Tools/'" tppabs="http://www.yahoo.com/Computers_and_Internet/World_Wide_Web/HTTP/Servers/Log_ Analysis_Tools/"> http://www.yahoo.com/Computers_and_Internet/World_Wide_Web/HTTP/Servers/Log_ Analysis_Tools/</A></FONT></PRE>

<P>The higher-end tools, such as net.Analysis from net.Genesis (<A HREF="javascript:if(confirm('http://www.netgen.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.netgen.com/'" tppabs="http://www.netgen.com/"> http://www.netgen.com</A>), cost anywhere from $295&#150;$2,995. They provide a number of features that may be interesting to very high-traffic sites.

<BR>

<P>In the inexpensive range (less than $100), there are many nice tools with tons of options available. My favorite tools are described in the following sections.

<BR>

<BR>

<A NAME="E69E160"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>AccessWatch</B></FONT></CENTER></H4>

<BR>

<P>AccessWatch by Dave Maher, <A HREF="javascript:if(confirm('http://netpressence.com/accesswatch/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://netpressence.com/accesswatch/'" tppabs="http://netpressence.com/accesswatch/"> http://netpressence.com/accesswatch/</A>, is a graphically appealing log analyzer. It provides information about today's Web access. The software is implemented as a Perl script, so it is portable to environments that run Perl. This software is free for the U.S. Government, noncommercial home use, and academic use. Any other use has a license of U.S. $40/year. Figures 13.1&#150;13.5 show examples of AccessWatch reports.

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg01.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg01.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg01.gif">Figure 13.1. AccessWatch daily access and </B><B>predictions report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg02.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg02.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg02.gif">Figure 13.2. AccessWatch summary report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg03.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg03.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg03.gif">Figure 13.3. AccessWatch hourly access </B><B>report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg04.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg04.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg04.gif">Figure 13.4. AccessWatch page access report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg05.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg05.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg05.gif">Figure 13.5. AccessWatch domain access </B><B>report.</A></B>

<BR>

<BR>

<A NAME="E69E161"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Wusage</B></FONT></CENTER></H4>

<BR>

<P>Wusage by Thomas Boutell, <A HREF="javascript:if(confirm('http://www.boutell.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.boutell.com/'" tppabs="http://www.boutell.com/"> http://www.boutell.com</A>, is a powerful and appealing log analyzer that is distributed in binary form. There are versions for various types of UNIX and Windows. Wusage provides all the configuration commands you could possibly want. As a bonus, it comes with a friendly utility for configuring the program. It utilizes Boutell's gd Graphical Interchange Format (GIF) library to generate a variety of attractive charts. Its number one feature is that it lets you create reports based on a pattern, be it a filename or a site. It can also analyze multiple log files at once. The license price varies depending on the number of copies you purchase and the intended use. Single user licenses are $25 for educational and nonprofit institutions. All others are $75. Various Wusage reports are shown in Figures 13.6&#150;13.10.

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg06.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg06.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg06.gif">Figure 13.6. Wusage daily access report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg07.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg07.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg07.gif">Figure 13.7. Wusage monthly access report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg08.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg08.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg08.gif">Figure 13.8. Wusage hourly graph report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg09.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg09.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg09.gif">Figure 13.9. Wusage domain access report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg10.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg10.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg10.gif">Figure 13.10. Wusage top 10 document </B><B>requests.</A></B>

<BR>

<BR>

<A NAME="E69E162"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Analog</B></FONT></CENTER></H4>

<BR>

<P>Analog by Stephen Turner with the Statistical Laboratory, University of Cambridge (<A HREF="javascript:if(confirm('http://www.statslab.cam.ac.uk/~sret1/analog  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.statslab.cam.ac.uk/~sret1/analog'" tppabs="http://www.statslab.cam.ac.uk/~sret1/analog"> http://www.statslab.cam.ac.uk/~sret1/analog</A>), is highly configurable and is fully HTML 2.0 compliant. It does have some graphics options, but I like the text reports, as shown in Figures 13.11&#150;13.14. They are very comprehensive. Analog runs under UNIX, Macintosh, and DOS.

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg11.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg11.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg11.gif">Figure 13.11. Analog's summary report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg12.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg12.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg12.gif">Figure 13.12. Analog's monthly report and </B><B>partially showing the daily report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg13.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg13.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg13.gif">Figure 13.13. Analog's hourly summary </B><B>report.</A></B>

<BR>

<P><B> <A HREF="javascript:if(confirm('http://docs.rinet.ru:8080/Apachu/13asg14.gif  \n\nThis file was not retrieved by Teleport Pro, because it was redirected to an invalid location.  You should report this problem to the site\'s webmaster.  \n\nDo you want to open it from the server?'))window.location='http://docs.rinet.ru:8080/Apachu/13asg14.gif'" tppabs="http://docs.rinet.ru:8080/Apachu/13asg14.gif">Figure 13.14. Analog's domain report.</A></B>

<BR>

<BR>

<A NAME="E69E163"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>wwwstat</B></FONT></CENTER></H4>

<BR>

<P>Another popular utility is wwwstat, <A HREF="javascript:if(confirm('http://www.ics.uci.edu/WebSoft/wwwstat/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.ics.uci.edu/WebSoft/wwwstat/'" tppabs="http://www.ics.uci.edu/WebSoft/wwwstat/"> http://www.ics.uci.edu/WebSoft/wwwstat/</A>. This utility, when coupled with gwstat (<A HREF="javascript:if(confirm('ftp://dis/cs.umass.edu/pub/gwstat.tar.gz  \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications.  \n\nDo you want to open it from the server?'))window.location='ftp://dis/cs.umass.edu/pub/gwstat.tar.gz'" tppabs="ftp://dis/cs.umass.edu/pub/gwstat.tar.gz"> ftp://dis/cs.umass.edu/pub/gwstat.tar.gz</A>), produces nice graphic reports. However, the graphic system only works under the X11 (The X Windowing System). I also had trouble with it processing my 40MB log file on a very fast PA-RISC server, something that leads me to believe that there was a compatibility problem on my side. The other software packages previously mentioned quickly processed the 40MB log file in a minute or so without any problems.

<BR>

<BR>

<A NAME="E68E156"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>

<BR>

<P>Logging information provides you with interesting statistical information about visitors to your site. By carefully analyzing this data, you may be able to catch a glimpse on a trend. This information can be invaluable in terms of determining what visitors like to see in your site as well as pointing out the content you should enhance. Responding to these perceived needs will help you build a better site&#151;one that is useful to your visitors and one that will attract more of them.

<BR>

<P>Using software tools to graph Web accounting information is better than looking at raw numbers. &quot;A picture is worth a thousand words,&quot; and in this case, it will help you understand your site's traffic statistics better. Many of these reporting tools summarize information by time periods and access groups, which lets you see your information in several different ways. By associating this data with press releases and other media-dissemination information, you can gage customer interest in your products or <A NAME="I16"></A>services. Your traffic is your feedback.<A NAME="I17"></A>

<BR>

<P ALIGN=LEFT>

<A HREF="asg12.htm" tppabs="http://docs.rinet.ru:8080/Apachu/asg12.htm" TARGET="_self"><IMG SRC="purprev.gif" tppabs="http://docs.rinet.ru:8080/Apachu/purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="#I0" TARGET="_self"><IMG SRC="purtop.gif" tppabs="http://docs.rinet.ru:8080/Apachu/purtop.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Page Top"></A>

<A HREF="index.htm" tppabs="http://docs.rinet.ru:8080/Apachu/index.htm" TARGET="_self"><IMG SRC="purtoc.gif" tppabs="http://docs.rinet.ru:8080/Apachu/purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="asgpt5.htm" tppabs="http://docs.rinet.ru:8080/Apachu/asgpt5.htm" TARGET="_self"><IMG SRC="purnext.gif" tppabs="http://docs.rinet.ru:8080/Apachu/purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>


</BODY></HTML>





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -