eygle.com   eygle.com
eygle.com  
 

« December 25, 2004 | Blog首页 | December 29, 2004 »



December 26, 2004

使用Solaris上的filestat工具

作者:eygle

出处:http://blog.eygle.com

Solaris Internals: Core Kernel Architecture的作者在书中提到一个用以产看文件inode及block分配情况的工具:filestat

这是一个非常有用的工具,有助于我们理解Solaris中空间管理及分配。
通过这个工具也可以帮助我们察看文件碎片是否严重,是否需要进行整理或重组。

其输出非常简单和直观:

# filestat /home/rmc/bigfile

Inodes per cyl group: 64
Inodes per block: 64
Cylinder Group no: 0
Cylinder Group blk: 64
File System Block Size: 8192
Device block size: 512
Number of device blocks: 204928

Start Block End Block Length (Device Blocks)
----------- ----------- ----------------------
66272 -> 66463 192
66480 -> 99247 32768
1155904 -> 1188671 32768
1277392 -> 1310159 32768
1387552 -> 1420319 32768
1497712 -> 1530479 32768
1607872 -> 1640639 32768
1718016 -> 1725999 7984
1155872 -> 1155887 16

Number of extents: 9
Average extent size: 22769 Blocks

以下讨论基于UFS文件系统:
我们知道inode包括2类指针:直接指针(Direct Pointers)和间接指针(Indirect Pointers)

1.直接指针
共有12个对数据块直接访问的直接指针,按照8k的块大小分配。
这12个直接指针可以为一直到96K(12x8k=96k)字节的容量的文件直接引用数据块。

2.间接指针

有3种类型的间接指针:
一级间接指针:一个一级间接指针使用一个文件系统块记录到数据块的指针。这个文件系统块包含2048个8K字节数据块的附加地址(即2048个指针),可以用以标示和定位16M字节的数据。

二级间接指针:一个二级间接指针使用一个文件系统块进行空间扩展。一个文件系统块记录2048个指针,每个指针指向下一级间接指针,每个二级间接指针可以继续定位2048个数据块。由此,二级间接指针可以指向的32G字节的数据。

三级间接指针:类似的一个三级间接指针可以查找超过70T字节的数据。可是,在一个ufs文件系统中的最大的文件容量是1T。

通过下图我们可以直观的看到inode的层次及结构:
inode.jpg

回过头来看我们前面的filestat输出:

.......
66272 -> 66463 192
66480 -> 99247 32768
1155904 -> 1188671 32768
1277392 -> 1310159 32768
1387552 -> 1420319 32768
1497712 -> 1530479 32768
1607872 -> 1640639 32768
1718016 -> 1725999 7984
1155872 -> 1155887 16
......

我们可以看到,第一个extent分配了192个操作系统块(512bytes/os block),192x512/1024=96k,正好是inode的一级块。
而此后的6个extent都是32768个os block,正好是16M。

如果大家注意一下的话,以上结构非常类似Oracle9i开始提出的ASSM位图管理,Oracle使用三级位图块来分配管理空间。

再来看一下我的系统中文件分配空间的情况:

bash-2.03# filestat 11.dbf
Inodes per cyl group: 5632
Inodes per block: 64
Cylinder Group no: 0
Cylinder Group blk: 64
File System Block Size: 8192
Device block size: 512
Number of device blocks: 204944

Start Block End Block Length (Device Blocks)
----------- ----------- ----------------------
5884448 -> 5884639 192
15943328 -> 15976095 32768
16027760 -> 16060527 32768
16120192 -> 16134495 14304
16144560 -> 16163023 18464
16397536 -> 16404735 7200
16419440 -> 16445007 25568
16767328 -> 16774479 7152
16791696 -> 16817311 25616
16948016 -> 16974751 26736
16978960 -> 16984991 6032
17040480 -> 17048495 8016

Number of extents: 12
Average extent size: 17078 Blocks


我们注意到,在这个文件中从第四个extent开始,空间分配开始不再连续,如果一个文件碎片过多,同样可能出现性能问题。

该工具可以在以下地址下载:下载地址

Posted by eygle at 10:10 PM | Comments (4)


了解一点硬件-硬盘生产全过程

作者:eygle

出处:http://blog.eygle.com

看到一篇关于硬盘生产过程的文章,转载在这里,了解一点硬件知识.
原文出处:
http://hk.netsh.com/bbs/700987/html/tree_1442982.html

  1957年IBM公司研制成功的IBM 350(RAMAC)是第一台真正意义上的硬盘存储器。它由许多片直径为61厘米的盘片组成,盘片由一台电动机带动,只有一个磁头,磁头上下前后运动起来寻找要读写的磁道,和现在的硬磁盘机几乎没有什么根本性的差别,它的体积很大,但存储容量只有5MB。2000年8月,IBM公司发布了目前体积最小的硬盘Micordriver,盘片直径大约是2.54厘米,而存储容量却达到了2000MB。相比之下,磁盘技术的发展真的是突飞猛进。

真正意义上的硬盘发展的历程碑应该是1973年,IBM 3340硬盘开始应用的温彻斯特技术,这种技术在1976年的IBM 3350逐渐成熟,它的出现使硬磁盘进入一个黄金时代。温彻斯特技术的主要内容有:1.磁头、盘片、主轴等运动部分密封在一个壳体中,形成一个头盘组合件(HDA),与外界环境隔绝,避免了灰尘的污染。2.采用小型化轻浮力的磁头浮动块,盘片表面涂润滑剂,实行接触起停。即平常盘片不转时,磁头停靠在盘片上,当盘片转速达一定值时,磁头浮起并保持一定的浮动间隙。这样简化了机械结构,缩短了起动时间。采用温彻斯特技术,磁头与磁盘是一一对应的,磁头读出的就是它本身写入的,信噪比等等都比可换的要好,因此存储密度提高了,存储容量也增加了。

最早把温彻斯特技术放在小型驱动器上的依旧是IBM,其62-PC,首次采用直径为20.3厘米的盘片。此后CDC公司、NEC公司开始生产20.3厘米的硬盘驱动器。 1980年Shugart公司首先制成13.3厘米硬盘驱动器,体积的更小型化,但其容量只有6MB。1983年,Rodime公司也制成了13.3厘米的硬盘驱动器,容量也仅有6MB左右。

硬盘另外一个发展里程碑就是使用溅射工艺来生产连续介质,这样就让硬盘的密度进一步增大,为提高硬盘的存储空间奠定了良好的基础。1991年IBM首次实现了1Gbit/英寸的密度,1992年日立公司则达到2Gbit/英寸,1997年又是IBM公司领先一步,得到了11.6Gbit/英寸的实验结果。1998年Seagate公司实现了16.3Gbit/英寸的密度,1999年IBM又推出了更加大的27.6Gbit/英寸,而且这个趋势还有提高。

了解了一些硬盘的背景后,相信很多人依旧对整合硬盘的制造流程有了解。因此今天我们的主要任务就是一起来看一下硬盘的制造流程。来参观一下硬盘制造商Seagate的硬盘装配厂,主角就是Seagate目前最高端的主流桌面硬盘-酷鱼IV硬盘的生产过程。

0.jpg
相信所有人都知道,硬盘中磁头同盘片之间的距离很小,一半来说只有十万分之一厘米,这个距离比灰尘来得更小。因此生产硬盘必须在超尘的情况下进行。以上就是Seagate硬盘厂的质检车间,这里的厂房里显得非常干净,而且所有工作人员必须穿上防尘服才能进入。

1.jpg

以上则是硬盘的自动装配生产线,为了保持洁净,一般来说这里操作的工人都比较少。不过我们有幸仔细看了一下硬盘的实际制造过程。

2.jpg

这个就是已经制造好的硬盘底座,背后就是线路板,这个当然在刚才就已经做好了。

3.jpg

驱动器中需要安装的设备主要是:磁盘、磁头、液态轴承(FDB)马达等,不过这些部件的装配必须在无尘情况下进行。并且安装硬盘的时候气压有个绝对值,如果不在这个情况下安装,硬盘的可靠性就得不到保障。另外上面的图片就是已经安装好液态轴承马达的情况,由于处于商业机密,我们无法把安装马达的情况拍摄出来。

4.jpg
这个运送磁盘的装置,其中可以容纳25张磁盘,通过机械臂把需要的磁盘装配的硬盘中。

5.jpg

以上就是机械臂正在自动装填磁盘的情况,这一切都无需人为干预。

6.jpg
机械臂正在把磁盘装配到硬盘底座中的液态轴承马达上(先于磁盘安装)。当然磁盘是否水平我们不用担心,机械臂会自动进行水平位置的调节。

7.jpg

这道工序就是进行磁头的装配,由于磁头和磁盘的精密性,所有这道工序是整个硬盘安装中最复杂的,我们看到硬盘被放置在一个精确定位的装置中进行磁头装配。
8.jpg
一旦所有内部零件被安装好后,硬盘就基本成形了,之后就是把硬盘“盖”起来。同样这里的一切装配工作都是有流水线自动完成的。当硬盘被密封好后,就不必待在超尘的空间中了。之后就别送到最后收尾车间了。(这里无须超尘)

9.jpg
技术人员正在给硬盘上螺丝,同样这里的要求很严格,所有线路板都被有机玻璃隔离覆盖,这样就保证线路板不会收到静电的威胁,由于隔离的玻璃上面有定位空,这样装配起来更加不会出错了。

10.jpg
接着就是为线路板覆盖泡沫屏蔽层,主要是为了防止静电和控制噪音。


11.jpg
这才是真正最后的一步,给硬盘装上底盖,主要是进一步控制噪音,并且保护内部的原器件。当然完成这一步后,还需要为硬盘贴上标识,然后进行质检,最后当然就是出厂上市销售啦。

Posted by eygle at 3:03 PM | Comments (0)


配置AWStats,Apache日志分析工具

作者:eygle

出处:http://blog.eygle.com

今天参考了车东的文章,配置调整了AWStats工具,用于我的站点的日志分析。

AWstats是一个基于Perl的WEB日志分析工具,极其强大,界面友好,而且支持中文。
目前稳定版本是6.2,2004-11-06 发布,测试版已经到了6.3,为了稳定可靠,我安装了6.2版。

该软件可以到:
http://awstats.sourceforge.net/ 或者
http://sourceforge.net/projects/awstats/
下载。

在处理日志时,需要安装cronolog工具,将日志设置成按天截断。
可以参考我的:
安装cronolog,格式化Apache的日志文件

很不错的工具。
为了提高安全性,可以设置访问认证:

在httpd.conf文件中配置需要认证的目录:
< Directory "/opt/apache/www.eygle.com/cgi-bin/awstats/" > 
  AuthType Basic 
AuthName "Restricted Files" 
  AuthUserFile /opt/apache/passwd/passwords 
   Require user awsuser 
< /Directory > 

其中在 /opt/apache/passwd/下产生passwords 的密码文件
运行如下代码产生用户名为awsuser用户及其密码

/opt/apache/bin/htpasswd -c /opt/apache/passwd/passwords awsuser
注意:先要在 /opt/apache/下建passwd目录

我的网站访问分析:

访问分析

Posted by eygle at 10:37 AM | Comments (12)


关于windows上的lsass.exe进程

作者:eygle

出处:http://blog.eygle.com

今天见到有人问lsass.exe进程,翻了点东西,记录些东西在这里。

lsass - lsass.exe - 进程信息
进程文件: lsass or lsass.exe
进程名称: 本地安全权限服务
描述: 本地安全权限服务,控制Windows安全机制。
常见错误: N/A
是否为系统进程: 是

该进程为系统进程,不能在任务管理器里终止,记得以前在命令行kill该进程,可能会导致系统蓝屏(不确认了)。

微软的说明如下:

Lsass.exe - You cannot end this process from Task Manager.
This is the local security authentication server, and it generates the process responsible for authenticating users for the Winlogon service. This process is performed by using authentication packages such as the default Msgina.dll. If authentication is successful, Lsass generates the user's access token, which is used to launch the initial shell. Other processes that the user initiates inherit this token.

Link

意思是说:
这是一个本地的安全授权服务,并且它会为使用winlogon服务的授权用户生成一个进程。这个进程是通过使用授权的包,例如默认的msgina.dll来执行的。如果授权是成功的,lsass就会产生用户的进入令牌,令牌别使用启动初始的shell 。其他的由用户初始化的进程会继承这个令牌的。

但是适当的担心是有必要的,已知的部分病毒跟lsass有关。
首先,微软缺省的lsass.exe位于c:\windows\System32\lsass.exe

我们应该清楚正常运行lsass需要的动态链接库:


C:\>tlist 720
720 lsass.exe
CWD: C:\WINDOWS\system32\
CmdLine: C:\WINDOWS\system32\lsass.exe
VirtualSize: 43208 KB PeakVirtualSize: 49040 KB
WorkingSetSize: 1360 KB PeakWorkingSetSize: 10640 KB
NumberOfThreads: 19
732 Win32StartAddr:0x74497f07 LastErr:0x00000000 State:Waiting
736 Win32StartAddr:0x7c94798d LastErr:0x00000000 State:Waiting
740 Win32StartAddr:0x7c930760 LastErr:0x00000000 State:Waiting
744 Win32StartAddr:0x7c949fae LastErr:0x00000000 State:Waiting
748 Win32StartAddr:0x0000028e LastErr:0x00000000 State:Waiting
764 Win32StartAddr:0x7c930aca LastErr:0x00000000 State:Waiting
792 Win32StartAddr:0x00000000 LastErr:0x00000000 State:Waiting
800 Win32StartAddr:0x00040d64 LastErr:0x00000000 State:Waiting
812 Win32StartAddr:0x74488c23 LastErr:0x00000000 State:Waiting
1700 Win32StartAddr:0x74488c23 LastErr:0x00000000 State:Waiting
212 Win32StartAddr:0x77dbb479 LastErr:0x00000000 State:Waiting
364 Win32StartAddr:0x77c0a341 LastErr:0x000003e5 State:Waiting
376 Win32StartAddr:0x77c0a341 LastErr:0x00000000 State:Waiting
380 Win32StartAddr:0x77c0a341 LastErr:0x00000000 State:Waiting
3056 Win32StartAddr:0x759d8831 LastErr:0x00000000 State:Waiting
1048 Win32StartAddr:0x77e56bf0 LastErr:0x0000006d State:Waiting
2628 Win32StartAddr:0x00000000 LastErr:0x000003f0 State:Waiting
3204 Win32StartAddr:0x00000000 LastErr:0x00000000 State:Waiting
3032 Win32StartAddr:0x77e56bf0 LastErr:0x00000000 State:Waiting
5.1.2600.2180 shp 0x01000000 lsass.exe
5.1.2600.2180 shp 0x7c920000 ntdll.dll
5.1.2600.2180 shp 0x7c800000 kernel32.dll
5.1.2600.2180 shp 0x77da0000 ADVAPI32.dll
5.1.2600.2180 shp 0x77e50000 RPCRT4.dll
5.1.2600.2525 shp 0x74480000 LSASRV.dll
5.1.2600.2180 shp 0x71a90000 MPR.dll
5.1.2600.2180 shp 0x77d10000 USER32.dll
5.1.2600.2180 shp 0x77ef0000 GDI32.dll
5.1.2600.2180 shp 0x76db0000 MSASN1.dll
7.0.2600.2180 shp 0x77be0000 msvcrt.dll
5.1.2600.2180 shp 0x5fdd0000 NETAPI32.dll
5.1.2600.2180 shp 0x76770000 NTDSAPI.dll
5.1.2600.2180 shp 0x76ef0000 DNSAPI.dll
5.1.2600.2180 shp 0x71a20000 WS2_32.dll
5.1.2600.2180 shp 0x71a10000 WS2HELP.dll
5.1.2600.2180 shp 0x76f30000 WLDAP32.dll
5.1.2600.2180 shp 0x77fc0000 Secur32.dll
5.1.2600.2180 shp 0x71b70000 SAMLIB.dll
5.1.2600.2180 shp 0x743a0000 SAMSRV.dll
5.1.2600.2180 shp 0x76760000 cryptdll.dll
5.1.2600.2180 shp 0x5cc30000 ShimEng.dll
0x58fb0000 AcGenral.DLL
5.1.2600.2180 shp 0x76b10000 WINMM.dll
5.1.2600.2180 shp 0x76990000 ole32.dll
5.1.2600.2180 shp 0x770f0000 OLEAUT32.dll
5.1.2600.2180 shp 0x77bb0000 MSACM32.dll
5.1.2600.2180 shp 0x77bd0000 VERSION.dll
6.0.2900.2180 shp 0x773a0000 SHELL32.dll
6.0.2900.2180 shp 0x77f40000 SHLWAPI.dll
5.1.2600.2180 shp 0x759d0000 USERENV.dll
6.0.2900.2180 shp 0x5adc0000 UxTheme.dll
5.1.2600.2180 shp 0x76300000 IMM32.DLL
5.1.2600.2180 shp 0x62c20000 LPK.DLL
1.420.2600.2180 sh 0x73fa0000 USP10.dll
5.82.2900.2180 shp 0x77180000 comctl32.dll
5.82.2900.2180 shp 0x5d170000 comctl32.dll
5.1.2600.2180 shp 0x20000000 msprivs.dll
5.1.2600.2180 shp 0x71c70000 kerberos.dll
5.1.2600.2180 shp 0x77c40000 msv1_0.dll
5.1.2600.2180 shp 0x76d30000 iphlpapi.dll
5.1.2600.2180 shp 0x74410000 netlogon.dll
5.1.2600.2180 shp 0x76790000 w32time.dll
6.0.8168.0 shp 0x75ff0000 MSVCP60.dll
5.1.2600.2180 shp 0x767c0000 schannel.dll
5.131.2600.2180 sh 0x765e0000 CRYPT32.dll
5.1.2600.2180 shp 0x742e0000 wdigest.dll
5.1.2600.2161 shp 0x0ffd0000 rsaenh.dll
5.1.2600.2180 shp 0x74370000 scecli.dll
5.1.2600.2180 shp 0x76060000 SETUPAPI.dll
5.1.2600.2180 shp 0x74340000 ipsecsvc.dll
5.1.2600.2180 shp 0x77fe0000 AUTHZ.dll
5.1.2600.2180 shp 0x73ed0000 oakley.DLL
5.1.2600.2180 shp 0x742d0000 WINIPSEC.DLL
5.1.2600.2180 shp 0x74300000 pstorsvc.dll
0x43000000 GoogleDesktopNetwork1.dll
5.1.2600.2180 shp 0x719c0000 mswsock.dll
5.1.2600.2180 shp 0x60fd0000 hnetcfg.dll
5.1.2600.2180 shp 0x71a00000 wshtcpip.dll
5.1.2600.2180 shp 0x74320000 psbase.dll
5.1.2600.2133 shp 0x68100000 dssenh.dll

大家可以看到,Google的桌面搜索也需要在此注册,这个进程是权限控制所必需的。
有的软件验证和更新或验证注册信息,会使用500端口通信(Internet Key Exchange(IKE)-Internet密钥交换用端口),有时可能会被误报为病毒或木马。

通常我认为,只要对windows的进程有适当的认识,不依赖防病毒工具,我们仍然可以敏感的认识到异常进程或异常Dll,从而发现可疑进程,找出问题所在。
tlist这个简单的小工具就曾经帮助我发现过几个杀毒软件不能及时识别的病毒。

目前已知的和lsass相关的病毒有:
W32.HLLW.Lovgate.C@mm - Symantec Corporation
W32.Mydoom.L@mm - Symantec Corporation
W32.Nimos.Worm - Symantec Corporation
W32.Sasser.E.Worm (Lsasss.exe) - McAfee

所以大家还是应该适当的留意一下这个进程。

Posted by eygle at 9:44 AM | Comments (1)


安装cronolog,格式化Apache的日志文件

作者:eygle

出处:http://blog.eygle.com

使用cronolog可以格式化日志文件的格式,比如按时间分割,易于管理和分析。
cronolog的安装配置非常简单,简要说明如下:
1.下载软件
http://cronolog.org/download/index.html
2.解压缩
gzip -d cronolog-1.6.2.tar.gz
tar xf cronolog-1.6.2.tar
2.进入相应的目录 ./configure
3.make
4.make install
5.修改apache配置文件

以下是我的安装日志,供大家参考:
[root@eygle opt]# wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
--08:05:12--  http://cronolog.org/download/cronolog-1.6.2.tar.gz
           => `cronolog-1.6.2.tar.gz'
Resolving cronolog.org... done.
Connecting to cronolog.org[217.160.212.212]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 133,591 [application/x-gzip]

100%[==================================>] 133,591       26.23K/s    ETA 00:00

08:05:19 (26.23 KB/s) - `cronolog-1.6.2.tar.gz' saved [133591/133591]
[root@eygle opt]# gzip -d cronolog-1.6.2.tar.gz 
[root@eygle opt]# tar xf cronolog-1.6.2.tar 
[root@eygle opt]# cd cronolog-1.6.2
[root@eygle cronolog-1.6.2]# ls
aclocal.m4  config.cache   configure     cronolog.spec  install-sh  Makefile.am  mkinstalldirs  src
AUTHORS     config.log     configure.in  doc            lib         Makefile.in  NEWS           testsuite
ChangeLog   config.status  COPYING       INSTALL        Makefile    missing      README         TODO
[root@eygle cronolog-1.6.2]# ./configure 
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... (cached) yes
checking for ranlib... (cached) ranlib
checking for perl... (cached) /usr/bin/perl
checking how to run the C preprocessor... (cached) gcc -E
checking for ANSI C header files... (cached) yes
checking whether stat file-mode macros are broken... (cached) no
checking whether time.h and sys/time.h may both be included... (cached) yes
checking whether struct tm is in sys/time.h or time.h... (cached) time.h
checking for tm_zone in struct tm... (cached) yes
checking for fcntl.h... (cached) yes
checking for limits.h... (cached) yes
checking for unistd.h... (cached) yes
checking for working const... (cached) yes
checking for size_t... (cached) yes
checking whether struct tm is in sys/time.h or time.h... (cached) time.h
checking for strftime... (cached) yes
checking for vprintf... (cached) yes
checking for mkdir... (cached) yes
checking for mktime... (cached) yes
checking for putenv... (cached) yes
checking for strptime... (cached) yes
checking for localtime_r... (cached) yes
creating ./config.status
creating Makefile
creating lib/Makefile
creating src/Makefile
creating doc/Makefile
creating testsuite/Makefile
creating src/cronosplit
[root@eygle cronolog-1.6.2]# make
Making all in lib
make[1]: Entering directory `/opt/cronolog-1.6.2/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/cronolog-1.6.2/lib'
Making all in src
make[1]: Entering directory `/opt/cronolog-1.6.2/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/cronolog-1.6.2/src'
Making all in doc
make[1]: Entering directory `/opt/cronolog-1.6.2/doc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/cronolog-1.6.2/doc'
Making all in testsuite
make[1]: Entering directory `/opt/cronolog-1.6.2/testsuite'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/cronolog-1.6.2/testsuite'
make[1]: Entering directory `/opt/cronolog-1.6.2'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/opt/cronolog-1.6.2'
[root@eygle cronolog-1.6.2]# make install
Making install in lib
make[1]: Entering directory `/opt/cronolog-1.6.2/lib'
make[2]: Entering directory `/opt/cronolog-1.6.2/lib'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/opt/cronolog-1.6.2/lib'
make[1]: Leaving directory `/opt/cronolog-1.6.2/lib'
Making install in src
make[1]: Entering directory `/opt/cronolog-1.6.2/src'
make[2]: Entering directory `/opt/cronolog-1.6.2/src'
/bin/sh ../mkinstalldirs /usr/local/sbin
  /usr/bin/install -c  cronolog /usr/local/sbin/cronolog
/bin/sh ../mkinstalldirs /usr/local/sbin
 /usr/bin/install -c  cronosplit /usr/local/sbin/cronosplit
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/opt/cronolog-1.6.2/src'
make[1]: Leaving directory `/opt/cronolog-1.6.2/src'
Making install in doc
make[1]: Entering directory `/opt/cronolog-1.6.2/doc'
make[2]: Entering directory `/opt/cronolog-1.6.2/doc'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ../mkinstalldirs /usr/local/info
 /usr/bin/install -c -m 644 ./cronolog.info /usr/local/info/cronolog.info
 install-info --info-dir=/usr/local/info /usr/local/info/cronolog.info
make  install-man1
make[3]: Entering directory `/opt/cronolog-1.6.2/doc'
/bin/sh ../mkinstalldirs /usr/local/man/man1
 /usr/bin/install -c -m 644 ./cronolog.1m /usr/local/man/man1/cronolog.1m
 /usr/bin/install -c -m 644 ./cronosplit.1m /usr/local/man/man1/cronosplit.1m
make[3]: Leaving directory `/opt/cronolog-1.6.2/doc'
make[2]: Leaving directory `/opt/cronolog-1.6.2/doc'
make[1]: Leaving directory `/opt/cronolog-1.6.2/doc'
Making install in testsuite
make[1]: Entering directory `/opt/cronolog-1.6.2/testsuite'
make[2]: Entering directory `/opt/cronolog-1.6.2/testsuite'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/opt/cronolog-1.6.2/testsuite'
make[1]: Leaving directory `/opt/cronolog-1.6.2/testsuite'
make[1]: Entering directory `/opt/cronolog-1.6.2'
make[2]: Entering directory `/opt/cronolog-1.6.2'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/opt/cronolog-1.6.2'
make[1]: Leaving directory `/opt/cronolog-1.6.2'
[root@eygle cronolog-1.6.2]# which cronolog
/usr/local/sbin/cronolog
安装完成以后需要对apache进行适当配置,修改httpd.conf文件,主要注意以下几点:
1.自定义日志格式
CustomLog "|/usr/local/sbin/cronolog /opt/apache/logs/access_log.%Y%m%d" combined
2.如果存在多个虚拟站点
可以考虑在VirtualHost进行相应设置

    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common

我的www.eygle.com存在多个子站点,但是都使用了同一个日志文件
配置后生成日志文件的效果:
[root@eygle logs]# ls -l access_log.20041226 
-rw-r--r--    1 root     root       110425 Dec 26 09:10 access_log.20041226


Posted by eygle at 9:20 AM | Comments (3)



CopyRight © 2004-2008 eygle.com, All rights reserved.