linux apache日志 linux安装apache步骤
linux Apache 环境下安装AWStatsWEB日志分析工具
今天安装了awstats(AWStats是在Sourceforge上发展很快的一个基于Perl的WEB日志分析工具。),好好折腾了一把,终于搞完了,参考了不少资料,将主要步骤和遇到的问题分享一下。
1.在home下建一个目录awstats,cd/home/awstats
2.wget ,下载awstats最新版本7.0
3.安装
复制代码
代码如下:
[root@JMAppSer tools]# perl awstats_configure.pl
----- AWStats awstats_configure 1.0(build 1.9)(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
Found Web server Apache config file'/usr/local/apache/conf/httpd.conf'
----- Check and complete web server config file'/usr/local/apache/conf/httpd.conf'
Add'Alias/awstatsclasses"/usr/local/awstats/wwwroot/classes/"'
Add'Alias/awstatscss"/usr/local/awstats/wwwroot/css/"'
Add'Alias/awstatsicons"/usr/local/awstats/wwwroot/icon/"'
Add'ScriptAlias/awstats/"/usr/local/awstats/wwwroot/cgi-bin/"'
Add'Directory' directive
AWStats directives added to Apache config file.
----- 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
----- 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.b2bweb.co
----- 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):
/usr/local/awstats/config
----- Create config file'/usr/local/awstats/config/awstats.www.b2bweb.co.conf'
Config file/usr/local/awstats/config/awstats.www.b2bweb.co.conf created.
----- Restart Web server with'/sbin/service httpd restart'
Usage:/etc/init.d/httpd [-D name] [-d directory] [-f file]
[-C"directive"] [-c"directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name: define a name for use in IfDefine name directives
-d directory: specify an alternate initial ServerRoot
-f file: specify an alternate ServerConfigFile
-C"directive": process directive before reading config files
-c"directive": process directive after reading config files
-e level: show startup errors of level(see LogLevel)
-E file: log startup errors to file
-v: show version number
-V: show compile settings
-h: list available command line options(this page)
-l: list compiled in modules
-L: list available configuration directives
-t-D DUMP_VHOSTS: show parsed settings(currently only vhost settings)
-S: a synonym for-t-D DUMP_VHOSTS
-t-D DUMP_MODULES: show all loaded modules
-M: a synonym for-t-D DUMP_MODULES
-t: run syntax check for config files
----- 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.b2bweb.co
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:/usr/local/awstats/config/awstats.www.b2bweb.co.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for'www.b2bweb.co' with command:
perl awstats.pl-update-config=www.b2bweb.co
You can also read your statistics for'www.b2bweb.co' with URL:
Press ENTER to finish...
[root@JMAppSer tools]# cp/usr/loca/awstats/wwwroot/icon/usr/local/apache/htdocs/awstatsicons-rf
cp:无法 stat“/usr/loca/awstats/wwwroot/icon”:没有那个文件或目录
[root@JMAppSer tools]#
[root@JMAppSer tools]#
[root@JMAppSer tools]# ls
awstats_buildstaticpages.pl awstats_exportlib.pl geoip_generator.pl logresolvemerge.pl nginx webmin
awstats_configure.pl awstats_updateall.pl httpd_conf maillogconvert.pl urlaliasbuilder.pl xslt
[root@JMAppSer tools]# cd..
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config docs README.TXT tools wwwroot
[root@JMAppSer awstats]# ll
总计 1508
drwxr-xr-x 5 1000 1000 4096 2010-12-06 awstats-7.0
drwxr-xr-x 5 root root 4096 11-22 17:52 awstats-7.1
-rw-r--r-- 1 root root 1505352 11-22 18:02 awstats-7.1.zip
drwxr-xr-x 2 root root 4096 11-25 10:21 config
drwxr-xr-x 4 root root 4096 11-22 18:04 docs
-rw-r--r-- 1 root root 6787 11-22 18:04 README.TXT
drwxr-xr-x 5 root root 4096 11-22 18:04 tools
drwxr-xr-x 7 root root 4096 11-22 18:04 wwwroot
[root@JMAppSer awstats]# cd wwwroot/
[root@JMAppSer wwwroot]# ls
cgi-bin classes css icon js
[root@JMAppSer wwwroot]# cp icon//usr/local/jiemai/apache-blogs/htdocs/awstatsicons-rf
[root@JMAppSer wwwroot]#
[root@JMAppSer wwwroot]#
[root@JMAppSer wwwroot]# pwd
/usr/local/awstats/wwwroot
[root@JMAppSer wwwroot]# cd..
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config docs README.TXT tools wwwroot
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config docs README.TXT tools wwwroot
[root@JMAppSer awstats]# ll
总计 1508
drwxr-xr-x 5 1000 1000 4096 2010-12-06 awstats-7.0
drwxr-xr-x 5 root root 4096 11-22 17:52 awstats-7.1
-rw-r--r-- 1 root root 1505352 11-22 18:02 awstats-7.1.zip
drwxr-xr-x 2 root root 4096 11-25 10:21 config
drwxr-xr-x 4 root root 4096 11-22 18:04 docs
-rw-r--r-- 1 root root 6787 11-22 18:04 README.TXT
drwxr-xr-x 5 root root 4096 11-22 18:04 tools
drwxr-xr-x 7 root root 4096 11-22 18:04 wwwroot
[root@JMAppSer awstats]# cd config/
[root@JMAppSer config]# ls
awstats.www.b2bweb.co.conf
[root@JMAppSer config]# vi awstats.www.b2bweb.co.conf
# AWSTATS CONFIGURE FILE 7.0
#-----------------------------------------------------------------------------
# Copy this file into awstats.www.mydomain.conf and edit this new config file
# to setup AWStats(See documentation in docs/ directory).
# The config file must be in/etc/awstats,/usr/local/etc/awstats or/etc(for
# Unix/Linux) or same directory than awstats.pl(Windows, Mac, Unix/Linux...)
# To include an environment variable in any parameter(AWStats will replace
# it with its value when reading it), follow the example:
# Parameter="__ENVNAME__"
# Note that environment variable AWSTATS_CURRENT_CONFIG is always defined with
# the config value in an AWStats running session and can be used like others.
#-----------------------------------------------------------------------------
#$Revision: 1.353$-$Author: eldy$-$Date: 2012/02/15 14:19:22$
#-----------------------------------------------------------------------------
# MAIN SETUP SECTION(Required to make AWStats work)
#-----------------------------------------------------------------------------
#"LogFile" contains the web, ftp or mail server log file to analyze.
# Possible values: A full path, or a relative path from awstats.pl directory.
# Example:"/var/log/apache/access.log"
# Example:"../logs/mycombinedlog.log"
# You can also use tags in this filename if you need a dynamic file name
# depending on date or time(Replacement is made by AWStats at the beginning
# of its execution). This is available tags:
#%YYYY-n is replaced with 4 digits year we were n hours ago
#%YY-n is replaced with 2 digits year we were n hours ago
#%MM-n is replaced with 2 digits month we were n hours ago
#%MO-n is replaced with 3 letters month we were n hours ago
#%DD-n is replaced with day we were n hours ago
#%HH-n is replaced with hour we were n hours ago
#%NS-n is replaced with number of seconds at 00:00 since 1970
#%WM-n is replaced with the week number in month(1-5)
#%Wm-n is replaced with the week number in month(0-4)
#%WY-n is replaced with the week number in year(01-52)
#%Wy-n is replaced with the week number in year(00-51)
#%DW-n is replaced with the day number in week(1-7, 1=sunday)
# use n=24 if you need(1-7, 1=monday)
#%Dw-n is replaced with the day number in week(0-6, 0=sunday)
# use n=24 if you need(0-6, 0=monday)
# Use 0 for n if you need current year, month, day, hour...
# Example:"/var/log/access_log.%YYYY-0%MM-0%DD-0.log"
# Example:"C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
# You can also use a pipe if log file come from a pipe:
# Example:"gzip-d/var/log/apache/access.log.gz|"
# If there are several log files from load balancing servers:
# Example:"/pathtotools/logresolvemerge.pl*.log|"
#
#LogFile="/var/log/httpd/mylog.log"
LogFile="/usr/local/jiemai/apache-blogs/logs/access_logs"
/DirData
# Note: Result of DNS Lookup can be used to build the Country report. However
# it is highly recommanded to enable the plugin'geoip' or'geoipfree' to
# have an accurate Country report with no need of DNS Lookup.
# Possible values:
# 0- No DNS Lookup
# 1- DNS Lookup is fully enabled
# 2- DNS Lookup is made only from static DNS cache file(if it exists)
# Default: 2
DNSLookup=2
# When AWStats updates its statistics, it stores results of its analysis in
# files(AWStats database). All those files are written in the directory
# defined by the"DirData" parameter. Set this value to the directory where
# you want AWStats to save its database and working files into.
# Warning: If you want to be able to use the"AllowToUpdateStatsFromBrowser"
# feature(see later), you need"Write" permissions by web server user on this
# directory(and"Modify" for Windows NTFS file systems).
# Example:"/var/lib/awstats"
# Example:"../data"
# Example:"C:/awstats_data_dir"
# Default:"."(means same directory as awstats.pl)
DirData="/usr/local/awstats/data"
# Relative or absolute web URL of your awstats cgi-bin directory.
# This parameter is used only when AWStats is run from command line
# with-output option(to generate links in HTML reported page).
# Example:"/awstats"
# Default:"/cgi-bin"(means awstats.pl is in"/yourwwwroot/cgi-bin")
#
DirCgi="/usr/local/awstats/wwwroot/cgi-bin"
/AllowToUpdateStatsFromBrowser
# When this parameter is set to 1, AWStats adds a button on report page to
# allow to"update" statistics from a web browser. Warning, when"update" is
# made from a browser, AWStats is run as a CGI by the web server user defined
# in your web server(user"nobody" by default with Apache,"IUSR_XXX" with
# IIS), so the"DirData" directory and all already existing history files
# awstatsMMYYYY[.xxx].txt must be writable by this user. Change permissions if
# necessary to"Read/Write"(and"Modify" for Windows NTFS file systems).
# Warning: Update process can be long so you might experience"time out"
# browser errors if you don't launch AWStats frequently enough.
# When set to 0, update is only made when AWStats is run from the command
# line interface(or a task scheduler).
# Possible values: 0 or 1
# Default: 0
#
AllowToUpdateStatsFromBrowser=1
# AWStats saves and sorts its database on a month basis(except if using
# databasebreak option from command line).
# However, if you choose the-month=all from command line or
# value'-Year-' from CGI combo form to have a report for all year, AWStats
# needs to reload all data for full year(each month), and sort them,
# requiring a large amount of time, memory and CPU. This might be a problem
# for web hosting providers that offer AWStats for large sites, on shared
# servers, to non CPU cautious customers.
# For this reason, the'full year' is only enabled on Command Line by default.
# You can change this by setting this parameter to 0, 1, 2 or 3.
# Possible values:
# 0- Never allowed
# 1- Allowed on CLI only,-Year- value in combo is not visible
"awstats.www.b2bweb.co.conf" 1557L, 62015C written
[root@JMAppSer config]# chown-R root:root/usr/local/awstats
[root@JMAppSer config]# chmod-R 755/usr/local/awstats
[root@JMAppSer config]# mkdir/usr/local/awstats/data
[root@JMAppSer config]# chown nobody.nobody/usr/local/awstats/data
[root@JMAppSer config]# chmod 777 data
chmod:无法访问“data”:没有那个文件或目录
[root@JMAppSer config]# cd..
[root@JMAppSer awstats]# ls
awstats-7.0 awstats-7.1 awstats-7.1.zip config data docs README.TXT tools wwwroot
[root@JMAppSer awstats]# chmod 777 data
[root@JMAppSer awstats]# chmod 755/usr/local/awstats/wwwroot/cgi-bin/*.pl
tar zxf awstats-7.0.tar.gz
mv awstats-7.0/usr/local/awstats
cd/usr/local/awstats/tools
perl awstats_configure.pl
在[y/N]提示时,输入y
Your web site, virtual server or profile name:这时输入要被分析的域名
其他按Enter
Press ENTER to finish。。。完成安装
4.修改文件目录
cp/usr/loca/awstats/wwwroot/icon/usr/local/apache/htdocs/awstatsicons-rf
5.配置
vi/etc/awstats/awstats.上面输入的域名.conf
LogFile="/usr/local/apache/logs/access_logs"
DirData="/usr/local/awstats/data"
DirCgi="/usr/local/awstats/wwwroot/cgi-bin"
AllowToUpdateStatsFromBrowser=1
6.设置权限
chown-R root:root/usr/local/awstats
chmod-R 755/usr/local/awstats
mkdir/usr/local/awstats/data
chown nobody.nobody/usr/local/awstats/data
chmod 777 data
chmod 755/usr/local/awstats/wwwroot/cgi-bin/*.pl
7.生成分析日志与静态查看界面
cd/usr/local/awstats/wwwroot/cgi-bin
perl awstats.pl-config=上面域名-update-lang=cn
perl awstats.pl-config=上面域名-output-staticlinks-lang=cnawstats.上面域名.html
8.测试 http://上面的域名/awstats/awstats.pl?config=上面的域名
遇到的问题:
1.perl awstats.pl-config=上面域名-update-lang=cn提示出错,或在测试时提示出错。LogFormat不正确:
原因:access_logs格式不正确,删除access_logs,重启APACHE。搞定
2.测试时看图片显示不了。
原因:/etc/awstats/awstats.上面输入的域名.conf中的DirIcons配置不正确,这个目录一定要从/usr/local/apache/htdocs目录开始算,相对目录,要确保配置的目录可能过http访问到
3.点击测试页面的“立即更新”时,提示"xxxx.tmp"无法存储
原因:/usr/local/awstats/data的权限不正确,需要使用nobody权限,赋777.
Linux下重启apache的方法
Linux系统为Ubuntu
一、Start Apache 2 Server/启动apache服务
#/etc/init.d/apache2 start
or
$ sudo/etc/init.d/apache2 start
二、 Restart Apache 2 Server/重启apache服务
#/etc/init.d/apache2 restart
or
$ sudo/etc/init.d/apache2 restart
三、Stop Apache 2 Server/停止apache服务
#/etc/init.d/apache2 stop
or
$ sudo/etc/init.d/apache2 stop
linux下的apache重启和停止
本文档叙述了在类Unix系统上如何停止和重启Apache。 Windows NT/2000/XP/2003的用户请参见以服务方式运行Apache,Windows 9x/ME用户则参见在控制台中运行Apache。
简介
为了停止或者重新启动Apache,你必须向正在运行的httpd进程发送信号。有两种发送信号的方法。第一种方法是直接使用UNIX的kill命令向运行中的进程发送信号。你也许你会注意到你的系统里运行着很多httpd进程。但你不应该直接对它们中的任何一个发送信号,而只要对已经在PidFile中记载下了自身PID的父进程发送信号。也就是说,你不必对父进程以外的任何进程发送信号。你可以向父进程发送三种信号:TERM、HUP、USR1,我们过一会儿再进行详细的说明。
你可以用下面这样的命令来向父进程发送信号:
kill-TERM `cat/usr/local/apache2/logs/httpd.pid`
第二种方法是使用下面将要描述的httpd二进制可执行文件的-k命令行选项:stop、restart、graceful、graceful-stop。不过我们推荐你使用apachectl控制脚本来向httpd二进制可执行文件传递这些选项。
当你向httpd发送信号后,你可以这样来读取它的进行过程:
tail-f/usr/local/apache2/logs/error_log
你可以修改这些示例以适应你的ServerRoot和PidFile设置。
立即停止
信号:TERM
apachectl-k stop
发送TERM或stop信号到父进程可以使它立刻杀死所有子进程。这将花费一些时间来杀死所有子进程。然后父进程自己也退出。所有进行中的请求将被强行中止,而且不再接受其它请求。
优雅重启
信号:USR1
apachectl-k graceful
USR1或graceful信号使得父进程建议子进程在完成它们现在的请求后退出(如果他们没有进行服务,将会立刻退出)。父进程重新读入配置文件并重新打开日志文件。每当一个子进程死掉,父进程立刻用新的配置文件产生一个新的子进程并立刻开始伺服新的请求。
重启代码的设计能够确保MPM进程控制指令的正常运作,也就是在重启过程中确保有适当数量的进程和线程以响应客户端的请求。它是这样StartServers的:如果在一秒钟以后还没有新创建StartServers个子进程,则创建出足够完成现在任务的子进程个数。因此,代码除了保有能够维持服务器的现有负载数量的子进程外,也确保StartServers按你的意愿运作。
使用mod_status的用户会注意到在USR1信号发出后,服务器的统计信息没有被清零。代码被写成既能将你服务器无法伺服新请求的时间降至最少(这些请求将被操作系统放到队列里,使得它们不会丢失),又能遵从你的参数优化。为了做到这一点,它将在重新生成子进程的过程中,在scoreboard上保存所有子进程的状态。
mod_status还会将那些在优雅重启前就已经开始而没有结束伺服请求的子进程用一个"G"来标志。
目前,日志滚动脚本还无法使用USR1来确定所有写入预重启日志的子进程都已结束。我们建议你在发出了USR1信号后等待一个适当的时间,然后再对旧的日志做处理。比如说如果对于一个窄带用户来说,大部分的点击处理将在10分钟之内完成,那么你应该在处理旧的日志前等待15分钟。
如果Apache重启时发现配置文件有误,那么父进程将不会重启,而是报错并退出。在优雅重启的情况下,它将在处理中的子进程存在的情况下维持它的存在(就是那些被要求在处理完它们的请求后"优雅退出"的子进程)。如果你要重启服务器,这将导致一些问题:它将不能绑定到它的监听端口。在执行重启之前,你可以用-t命令行参数来检查配置文件语法的正确性(参见httpd)。但这仍然不能保证服务器一定可以正确的重启。为了从语法和语义两方面检查配置文件,你可以用一个非root用户来启动httpd。如果没有错误,它将尝试去打开套接字和日志文件,继而因没有root权限而失败(或是因为现在运行的httpd已经绑定了这些端口)。如果是因为其他原因那么就可能是一个配置文件产生的错误,你就应当在进行优雅重启之前改正这个错误。立即重启
信号:HUP
apachectl-k restart
向父进程发送HUP或restart信号会使它象收到TERM信号一样杀掉所有的子进程,不同之处在于父进程本身并不退出。它重新读入配置文件、重新打开日志文件。然后产生一系列新的子进程来继续服务。
使用mod_status的用户会注意到在HUP信号发出后,服务器统计信息会被清零。
如果你重启时配置文件有误,那么父进程将不会重启,而是报错并退出。参见上文中避免的方法。优雅停止
信号:WINCH
apachectl-k graceful-stop
WINCH或graceful-stop信号使得父进程建议子进程在完成它们现在的请求后退出(如果他们没有进行服务,将会立刻退出)。然后父进程删除PidFile并停止在所有端口上的监听。父进程仍然继续运行并监视正在处理请求的子进程,一旦所有子进程完成任务并退出或者超过由GracefulShutdownTimeout指令规定的时间,父进程将会退出。在超时的情况下,所有子进程都将接收到TERM信号并被强制退出。
在"优雅"状态下,TERM信号将会立即中止父进程和所有子进程。由于PidFile已经被删除,你将无法使用apachectl或httpd发送该信号。
graceful-stop允许你同时运行多个相同配置的httpd实例。这在对Apache进行平滑升级的时候是一个非常有用的特性。不过它在某些配置的情况下同样可能会导致死锁和竞争条件。
必须注意确保诸如Lockfile和ScriptSock之类的磁盘文件包含服务器的PID,并且能够安全的共存。然而如果一个配置指令、第三方模块或持久CGI使用任何磁盘锁或状态文件,必须注意确保多个httpd运行实例之间不会争抢文件。
你还必须防止潜在的竞争条件,比如使用rotatelogs风格的管道日志。运行中的多个rotatelogs实例企图同时滚动同一个日志文件可能会导致互相破坏对方的日志文件。
附录:信号和竞争条件
在Apache 1.2b9之前,有很多关于重启和死亡信号的竞争条件。关于竞争条件的一个简单描述是:一个时间敏感的问题,如果一些事情在不适当的时间或以不恰当的顺序发生,它将作出你不期望的反应;如果同样的事情在恰当的时间发生,则不会出现异常。凭借那些拥有"正确"特性设置的体系结构,我们尽量避免了它们的出现。但值得注意的是,仍然有一些竞争条件存在于这样的体系结构中。
使用物理磁盘的ScoreBoardFile就有损坏ScoreBoard的潜在危险。这将发生在"bind: Address already in use"(HUP之后)或"long lost child came home!"(USR1之后)时。前者是一个致命错误,而后者则会使服务器丢失ScoreBoard的一个记录。所以我们建议多使用优雅重启,偶尔使用硬重启。这些问题很难解决,但幸运的是大多数结构并不需要ScoreBoard文件。而如果你需要这样的结构,你可以参考ScoreBoardFile文档。
当每个子进程在一个HTTP的持续连接(KeepAlive)中涉及到第二个并发的请求时,所有的结构都会或多或少存在竞争状态的问题。它将在读取了请求而没有读取任何请求头之后立刻退出。这个修复对于1.2来说来得太晚了。但因为持续连接的客户端已经考虑到网络延时和服务器超时会造成类似的情况,所以理论上说,这不是一个太大的问题。而实际上似乎也没有任何影响:在一个测试案例中服务器在一秒之内被重启了20次,而客户端却成功的浏览了网站,而且没有任何破损的图片或空文档。
如何在Apache日志中记录处理时间
Apache日志中的处理时间
Apache的日志有很多可以自己定义的项目,其中一个%T能够显示出服务器处理请求所用的时间。我就是对这个的定义发生了疑问,所以做了一些考证。
在Apache2的中文手册中,是这样定义%T这个变量的。
%T处理完请求所花时间,以秒为单位。
在Apache2的英文文档中,定义如下:
%T the time taken to server the request, in seconds.
由此可见,这个时间表示的是服务器处理这个请求的总时间。而不是Apache服务器解析PHP脚本,并且输出脚本的时间。因此,我们可以看到同样的一个页面,网速比较慢的用户访问时间会长,而网速较快的用户访问,则时间比较短。
%T记录的是以秒为单位的时间,这对于我们来说是不太够的。因为很多情况下,我们需要保证我们网页的响应速度在1秒以内。从Apache 2.0开始,提供了一个新的参数%D。可以记录服务器处理请求的微秒时间(注意和%T的定义不同)。
我在服务器上做了一次测试,代码中嵌入了一个执行时间的检查判断,同时监视日志文件中产生的时间。结果为:页面监测脚本执行时间为10009206毫秒,而日志中记录的是10009838,两者时间并不一样,日志中记录的时间稍微长一些,包含了DNS查询等一系列的过程。
PS:由这个问题也可以衍生出一个如何测算客户端网速的问题。有这样一个办法,在Header中输出服务器的响应时间,用户收到后,判断收到的时间,这个时间差就是在服务器和客户端之间所消耗的时间。
参考资料:
1、Apache 2手册
2、Apache logs: how log does it take to server a request?