小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

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

 漂在北方的狼 2006-08-13
使用cronolog可以格式化日志文件的格式,比如按時間分割,易于管理和分析。
cronolog的安裝配置非常簡單,簡要說明如下:
1.下載軟件
http:///download/index.html
2.解壓縮
gzip -d cronolog-1.6.2.tar.gz
tar xf cronolog-1.6.2.tar
2.進(jìn)入相應(yīng)的目錄 ./configure
3.make
4.make install
5.修改apache配置文件

以下是我的安裝日志,供大家參考:
[root@eygle opt]# wget http:///download/cronolog-1.6.2.tar.gz
            --08:05:12--  http:///download/cronolog-1.6.2.tar.gz
            => `cronolog-1.6.2.tar.gz‘
            Resolving ... done.
            Connecting to [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進(jìn)行適當(dāng)配置,修改httpd.conf文件,主要注意以下幾點:
1.自定義日志格式
CustomLog "|/usr/local/sbin/cronolog /opt/apache/logs/access_log.%Y%m%d" combined
2.如果存在多個虛擬站點
可以考慮在VirtualHost進(jìn)行相應(yīng)設(shè)置

            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
            


    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多