青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

xiaoguozi's Blog
Pay it forword - 我并不覺的自豪,我所嘗試的事情都失敗了······習慣原本生活的人不容易改變,就算現(xiàn)狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預料,人們需要更細心的觀察別人,要隨時注意才能保護別人,因為他們未必知道自己要什么·····
官網(wǎng):http://gearman.org/

跨多種環(huán)境部署 Gearman
http://www.ibm.com/developerworks/cn/opensource/os-gearman/index.html
利用開源的Gearman框架構(gòu)建分布式圖片處理平臺-張宴
http://blog.s135.com/dips/
監(jiān)控:
https://github.com/yugene/Gearman-Monitor

一、簡介
Gearman是一個分發(fā)任務的程序架構(gòu),由三部分組成:
Gearman client:提供gearman client API給應用程序調(diào)用。API可以使用C,PHP,PERL,MYSQL UDF等待呢個語言,它是請求的發(fā)起者。
Gearman job server:將客戶端的請求分發(fā)到各個gearman worker的調(diào)度者,相當于中央控制器,但它不處理具體業(yè)務邏輯。
Gearman worker:提供gearman worker API給應用程序調(diào)用,具體負責客戶端的請求,并將處理結(jié)果返回給客戶端。
Mogilefs的分布式文件系統(tǒng)的核心就是用gearman實現(xiàn)的。
這個軟件的應用場景很多,比如視頻網(wǎng)站的視頻處理,分布式日志處理,電子郵件處理,文件同步處理,圖片處理等等,只要是可以放開,不影響體驗和響應的場 景,需要并行進行大量計算和處理的程序都是可以的。Yahoo在60或更多的服務器上使用gearman每天處理600萬個作業(yè)。新聞聚合器digg構(gòu)建 了一個相同規(guī)模的gearman網(wǎng)絡,每天可處理400000個作業(yè)。
Gearman不但可以做為任務分發(fā),還可以做為應用方面的負載均衡。可以讓worker放在不同的一堆服務器上,也可以啟動放在同一個cpu的多個核 上。比如,應用視頻轉(zhuǎn)換程序,不希望web服務器來處理視頻格式轉(zhuǎn)換,這時,可以在這一堆服務器上進行任務分發(fā),在上面加載worker處理視頻格式,對 外的web服務器就不會被視頻轉(zhuǎn)換過程影響。而且擴展方便,加一臺服務器到任務調(diào)度中心,注冊成worker即可,這時job server會在請求到來的時候,將請求發(fā)送給空閑的worker。還可以運行多個job server,組成ha架構(gòu),如果一個job server當?shù)袅耍琧lient和worker會自動遷移到另一臺job server上。

二、安裝
[Job Server (gearmand) -- 172.16.1.183]
1.首先安裝libdrizzle
    #yum install libdrizzle libdrizzle-devel
2.安裝gearman(兩種方法1.yum2.源碼包)。(c版的server)
    1)yum安裝
    #rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm
    #yum install -y gearmand
    2)源碼包安裝
    #cd /opt/build/
    #wget https://launchpad.net/gearmand/trunk/0.34/+download/gearmand-0.34.tar.gz
    #tar zxf gearmand-0.34.tar.gz
    #cd gearmand-0.34
    #./configure
    #make && make install
3.啟動gearman服務
    1)yum安裝方式
    #/etc/init.d/gearmand start
    2)源碼包安裝方式
    #/opt/build/gearmand-0.34/sbin/gearmand -d

    #gearmand -vvv -u root
    INFO Starting up
    INFO Listening on :::4730 (6)
    INFO Creating wakeup pipe
    INFO Creating IO thread wakeup pipe
    INFO Adding event for listening socket (6)
    INFO Adding event for wakeup pipe
    INFO Entering main event loop

worker&&client以php方式
[worker --  172.16.1.180]
安裝gearmand如上所示

安裝 Gearman PHP extension
1.下載gearman-0.8.0.tgz并安裝
    #cd /opt/build/
    #wget http://pecl.php.net/get/gearman-0.8.0.tgz
    # yum install -y libgearman-devel.x86_64
    # yum install -y re2c
    #tar zxf gearman-0.8.0.tgz
    #cd gearman-0.8.0.tgz
    #phpize
    # ./configure
    # make && make install
2.編輯php.ini配置文件加載相應模塊并使之生效
    # vim /etc/php.ini
    extension = "gearman.so"
3.查看gearman.so模塊是否加載
    # php --info | grep gearman
    gearman
    gearman support => enabled
    libgearman version => 0.14
    PWD => /opt/build/gearman-0.8.0
    _SERVER["PWD"] => /opt/build/gearman-0.8.0
    # php -m | grep gearman
    gearman
4.啟動job
gearmand -d
如果當前用戶是 root 的話,則需要這樣操作:
gearmand -d -u root
缺省會使用 4730 端口,下面會用到。
    注意:如果找不到 gearmand 命令的路徑,別忘了用 whereis gearmand 確認

[client -- 172.16.1.181]
    安裝如work同。如上所示。

三、測試:
[Job Server (gearmand) -- 172.16.1.183]
啟動gearmand

以命令行工具來驗證gearman的功能
啟動 Worker:gearman -h 172.16.1.183 -w -f wc -- wc -l &
運行Client:gearman -h 172.16.1.183 -f wc < /etc/passwd
42
可以看到驗證成功。

以php驗證gearman的功能
編寫 Worker
worker.php 文件內(nèi)容如下:
<?php
$worker= new GearmanWorker();
$worker->addServer('172.16.1.183', 4730);
$worker->addFunction('reverse', 'my_reverse_function');
while ($worker->work());
function my_reverse_function($job) {
return strrev($job->workload());
}
?>
設置后臺運行 work
php worker.php &
編寫 Client
client.php 文件內(nèi)容如下:
<?php
$client= new GearmanClient();
$client->addServer('172.16.1.183', 4730);
echo $client->do('reverse', 'Hello World!'), "\n";
?>
運行 client
php client.php
輸出:!dlroW olleH

Q:

I've been trying to get Gearman compiled on CentOS 5.8 all afternoon. Unfortunately I am restricted to this version of CentOS by my CTO and how he has our entire network configured. I think it's simply because we don't have enough resources to upgrade our network... But anyways, the problem at hand.

I have searched through Server Fault, Stack Overflow, Google, and am unable to locate a working solution. What I have below is stuff I have pieced together from my searching.

Searches have told said to install the following via yum:

yum -y install --enablerepo=remi boost141-devel libgearman-devel e2fsprogs-devel e2fsprogs gcc44 gcc-c++ 

To get the Boost headers working correctly I did this:

cp -f /usr/lib/boost141/* /usr/lib/ cp -f /usr/lib64/boost141/* /usr/lib64/ rm -f /usr/include/boost ln -s /usr/include/boost141/boost /usr/include/boost 

With all of the dependancies installed and paths setup I then download and compile gearmand-1.1.2 just fine.

wget -O /tmp/gearmand-1.1.2.tar.gz https://launchpad.net/gearmand/1.2/1.1.2/+download/gearmand-1.1.2.tar.gz cd /tmp && tar zxvf gearmand-1.1.2.tar.gz ./configure && make -j8 && make install 

That works correctly. So now I need to install the Gearman library for PHP. I have attempted through PECL and downloading the source directly, both result in the same error:

checking whether to enable gearman support... yes, shared not found configure: error: Please install libgearman 

What I don't understand is I installed the libgearman-devel package which also installed the core libgearman. The installation installs libgearman-devel-0.14-3.el5.x86_64, libgearman-devel-0.14-3.el5.i386, libgearman-0.14-3.el5.x86_64, and libgearman-0.14-3.el5.i386.

Is it possible the package version is lower than what is required? I'm still poking around with this, but figured I'd throw this up to see if anyone has a solution while I continue to research a fix.

Thanks!


A:

This should do the trick:

export GEARMAN_LIB_DIR=/usr/include/libgearman 
export GEARMAN_INC_DIR=/usr/include/libgearman

That should work, if not you'll have to do some minor edits to config.m4.


other:

http://gearman.org/gearman_php_extension
http://blog.csdn.net/aidenliu/article/details/7406390
http://www.php.net/manual/en/gearmanclient.dobackground.php
http://www.wenzizone.com/2012/09/27/how_to_fix_rpm_filedigests_payloadisxz_is_needed.html
http://www.2cto.com/os/201206/136785.html
http://blog.s135.com/dips
http://blog.csdn.net/hfahe/article/details/5519582
http://hi.baidu.com/sunjiujiu/item/4406281c952cf47a7b5f2594

posted @ 2013-01-07 16:39 小果子 閱讀(7901) | 評論 (0)編輯 收藏
http://blog.sina.com.cn/s/blog_6f2caee40100uhj6.html
1.下載最新的boost
http://www.boost.org/
2.解壓文件
tar -xzvf boost_1_45_0.tar.gz 
3.編譯bjam
進入boost_1_45_0目錄中,運行./bootstrap.sh,完成后會得到一個bjam
4.編譯boost 
./bjam --with-date_time --with-system --with-regex --with-thread --with-filesystem --with-serialization --with-iostreams --with-math --with-mpi --with-program_options --with-python --with-math --with-signals --layout=tagged install variant=debug,release link=static --runtime-link=static threading=multi stage
5.查看boost
編譯完成后,在/usr/local/include/boost就有最新的boost頭文件了,在/usr/local/lib就有編譯好的.a庫文件了。
雖然usr/local/include和/usr/include都有目錄,但GCC是先訪問/usr/local/include,所以編譯完成后,就可以默認使用boost了。
6.測試boost
vi testboost.cpp
#include <iostream>
#include <boost/version.hpp>
int main()
{
    std::cout<<BOOST_VERSION<<std::endl;
    return 0;
}
編譯:g++ -o testboost testboost.cpp
posted @ 2013-01-07 16:38 小果子 閱讀(2992) | 評論 (1)編輯 收藏
轉(zhuǎn)自: https://www.akii.org/use-awstats-automatic-analysis-nginx-log.html
使用awstats可以分析apache日志,同樣也可以分析nginx日志。本文將詳細介紹自動定時切割nginx的訪問日志,并使用awstats來定時分析nginx的日志的實現(xiàn)方法。

前言

本文中使用的是awstats 7.0版本。
此版本增加了對win7的支持以及一些更新的特性。

New features/improvements:
- Detect Windows 7.
- Can format numbers according to language.
- More mime types.
- Added geoip_asn_maxmind plugin.
- Geoip Maxmind city plugin have now override file capabilities to complete
missing entries in geoip maxmind database.
- Added graphgooglechartapi to use online Google chart api to build graph.
- Can show map of country to report countries when using graphgooglechartapi.
- Part of codes was change to use more functions and have a cleaner code.
- Added parameter to ignore missing log files when merging for a site on
multiple servers where a single server may not have created a log for a given day.
- Update robots database.
- Added Download tracking where certain mime types are defined as downloads
and HTTP status 206 is tracked as download continuation

Awstats 是在 SourceForge 上發(fā)展很快的一個基于 Perl 的 WEB 日志分析工具,一個充分的日志分析讓 Awstats 顯示您下列資料:

  • 訪問次數(shù)、獨特訪客人數(shù),
  • 訪問時間和上次訪問,
  • 使用者認證、最近認證的訪問,
  • 每周的高峰時間(頁數(shù),點擊率,每小時和一周的千字節(jié)),
  • 域名/國家的主機訪客(頁數(shù),點擊率,字節(jié),269域名/國家檢測, geoip 檢測),
  • 主機名單,最近訪問和未解析的 IP 地址名單
  • 大多數(shù)看過的進出頁面,
  • 檔案類型,
  • 網(wǎng)站壓縮統(tǒng)計表(mod_gzip 或者 mod_deflate),
  • 使用的操作系統(tǒng) (每個操作系統(tǒng)的頁數(shù),點擊率 ,字節(jié), 35 OS detected),
  • 使用的瀏覽器,
  • 機器人訪問(檢測 319 個機器人),
  • 蠕蟲攻擊 (5 個蠕蟲家族),
  • 搜索引擎,利用關鍵詞檢索找到你的地址,
  • HTTP 協(xié)議錯誤(最近查閱沒有找到的頁面),
  • 其他基于 URL 的個性報導,鏈接參數(shù), 涉及綜合行銷領域目的.
  • 貴網(wǎng)站被加入”最喜愛的書簽”.次數(shù).
  • 屏幕大小(需要在索引頁補充一些 HTML 標簽).
  • 瀏覽器的支持比例: Java, Flash, RealG2 reader, Quicktime reader, WMA reader, PDF reader.
  • 負載平衡服務器比率集群報告.

Awstats 的運行是需要 PERL 環(huán)境的支持,從 awstats 的文檔來看,它對 Apache HTTP Server 的支持是非常完美的,而當我們把 Web 服務器換成 Nginx 后,要運行 awstats 變得很麻煩。首先 Nginx 本身對 Perl 的支持是比較弱的,甚至官方也不建議使用;另外在日志格式上有需要修改后才能運行。

日志切割

本文主要介紹通過讓 awstats 對日志統(tǒng)計的結(jié)果生成靜態(tài)頁面,然后通過 Nginx 輸出以達到統(tǒng)計 Nginx 訪問日志的效果,其中還包括如何讓 Nginx 自動切割日志文件。對于nginx的日志,我的做法是按天切割。然后存入日期形式的目錄中并壓縮。

需要注意的是,nginx的日志應該遵循以下格式,才可以被awstats識別,如定義日志格式

1
2
3
log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

使用日志格式

1
access_log  /home/www/logs/access.log  main;

這里需要有一個小技巧的提示:把log_format這段代碼放在你nginx的http的定義段中,可以在下面的每一個server中引用此格式。不必在每個server里面都去定義格式。
本文不講如何安裝nginx,稍后我將發(fā)布我的lnmp一鍵安裝包(linux nginx mysql php)。全編譯+優(yōu)化自動化安裝,使用php-fpm運行php的fastcgi進程。

我寫了一個定時切割日志的腳本。每天0:00開始執(zhí)行,切割昨天的日志(交由awstats分析),壓縮前天的日志(壓縮日志可減小存儲空間,為防 止awstats沒有分析完就被壓縮,所以只壓縮前天的日志)。如果你的nginx和log文件放的路徑和我的不一樣,請對應修改。

1
vim cut_log.sh

輸入以下內(nèi)容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
# This script run at 00:00
# cut yesterday log and gzip the day before yesterday log files.
# yesterday logs to awstats
 
# The Nginx logs path
logs_path="/home/www/logs/"
date_dir=${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/$(date -d "yesterday" +"%d")/
gzip_date_dir=${logs_path}$(date -d "-2 day" +"%Y")/$(date -d "-2 day" +"%m")/$(date -d "-2 day" +"%d")/
 
mkdir -p $date_dir
mv ${logs_path}*access.log $date_dir
/usr/local/nginx/sbin/nginx -s reopen
/usr/bin/gzip ${gzip_date_dir}*.log

然后讓它每天0時起開始進行,執(zhí)行crontab -e加入以下代碼再按:wq保存退出,這里我將此腳本放在/root/下,切記要給它可執(zhí)行權(quán)限(chmod +x cut_log.sh).

1
00 00 * * * /bin/bash /root/cut_log.sh

這樣就可以每天凌里自動切割昨天的日志到以日期為目錄結(jié)構(gòu)的目錄中。可以留存以后查詢。留著昨天的日志交給下面的awstats來分析,壓縮前天的日志(前天的已經(jīng)被分析過了)。

安裝和配置awstats

下載最新的 awstats,我使用的是迄今為止最新的7.0版本

安裝到/usr/local下,這個路徑是習慣。大部分人保持的良好習慣。

1
2
3
wget http://awstats.sourceforge.net/files/awstats-7.0.tar.gz
tar -zxvf awstats-7.0.tar.gz
mv awstats-7.0 /usr/local/awstats

修改權(quán)限,wget下載下來的包中權(quán)限是非root的,賦予過權(quán)限之后,.pl的文件也就可以運行了。

1
2
3
4
chown -R root:root /usr/local/awstats
chmod -R =rwX /usr/local/awstats
chmod +x /usr/local/awstats/tools/*.pl
chmod +x /usr/local/awstats/wwwroot/cgi-bin/*.pl

然后執(zhí)行 tools 目錄中的 awstats_configure.pl 配置向?qū)В瑒?chuàng)建一個新的統(tǒng)計

運行(注意這里要在當前目錄運行。否則會有一些關于標準目錄的提示。)

1
2
cd /usr/local/awstats/tools
./awstats_configure.pl

將會有如下一些提示:

1
2
3
4
5
6
7
8
9
10
-----> Running OS detected: Linux, BSD or Unix
 
-----> Check for web server install
 
Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
>none #這里添none并回車,因為我們沒有使用apache

回車之后下一個選項

1
2
3
4
5
6
7
8
9
10
11
Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)
 
-----> 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,創(chuàng)建一個新的配置文件

1
2
3
4
5
6
-----> 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:
>akii.org  #這里輸入你要分析的域名,或是隨便一個你易記的配置名并回車

接下來要定義你的配置文件存放的路徑,可用默認

1
2
3
4
5
-----> 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):
> #直接回車,使用默認路徑/etc/awstats

回車后的提示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-----> Create config file '/etc/awstats/awstats.akii.org.conf'
 Config file /etc/awstats/awstats.akii.org.conf created.
 
-----> 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=akii.org
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... #按回車繼續(xù)
 
A SIMPLE config file has been created: /etc/awstats/awstats.akii.org.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'yuyuanchun.com' with command:
> perl awstats.pl -update -config=akii.org
You can also build static report pages for 'akii.org' with command:
> perl awstats.pl -output=pagetype -config=akii.org
 
Press ENTER to finish... #回車完成配置文件的創(chuàng)建

完成配置文件的創(chuàng)建后,我們還要修改一下。因為我們是按天切割的日志,切割完成后交由awstats去分析。并不是讓awstats去分時正在時時 增長的也就是正在被寫入的日志,這樣的好處是不至于遺漏數(shù)據(jù),并且分析已經(jīng)切割完成的日志,更不用擔心會有沖突。壞處是我一天切割一次日志,你要等第二天 才能看昨天的一些詳細數(shù)據(jù)。

修改/etc/awstats/awstats.akii.org.conf,執(zhí)行:

1
vi /etc/awstats/awstats.akii.org.conf

找到

1
LogFile="/var/log/httpd/mylog.log"

修改為:

1
LogFile="/home/www/logs/%YYYY-24/%MM-24/%DD-24/akii.org_access.log"

如果你的日志路徑和我的不一樣,請修改成對應的日志文件名。以上的完整路徑是切割后保存的nginx日志文件。其中%YYYY-24/%MM-24/%DD-24表示年月日都減去24小時,也就是昨天的日志目錄。修改完成后按:wq保存退出。

接下來可以測試一下awstats分析日志了(前提是你已經(jīng)有了切割過的日志,沒有的話可以先退行一下切割日志的腳本/root/cut_log.sh)

首先,還要創(chuàng)建一個awstats用于記錄數(shù)據(jù)的目錄

1
mkdir -p /var/lib/awstats

然后運行awstats的wwwroot目錄中的awatsts.pl來測試一下

1
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=akii.org

你如果看到類似下面的提示就說明配置文件都正確了。

1
2
3
4
5
6
7
8
9
10
11
12
13
Create/Update database for config "/etc/awstats/awstats.akii.org.conf" by AWStats version 7.0 (build 1.964)
From data in log file "/home/www/logs/2010/07/24/akii.org_access.log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 43260)
Jumped lines in file: 43260
 Found 43260 already parsed records.
Parsed lines in file: 0
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 0 new qualified records

統(tǒng)計分析完成后,結(jié)果還在 Awstats 的數(shù)據(jù)庫中。在 Apache 上,可以直接打開 Perl 程序的網(wǎng)頁查看統(tǒng)計。 但本文開始時已經(jīng)提到,Nginx 對 Perl 支持并不好,所以我們要換個方法,利用 awstats 的工具將統(tǒng)計的結(jié)果生成靜態(tài)文件,具體的步驟如下:

  • 首先在 webroot 目錄下創(chuàng)建一個文件夾。例:/home/www/awstats
  • 寫一個腳本,定期執(zhí)行讓 Awstats 把靜態(tài)頁面生成到該目錄中

先生成存放awstats生成的靜態(tài)文件的目錄,我這里用的是/home/www/awstats

1
mkdir -p /home/www/awstats

我們來寫一個腳本

1
vim /root/awstats.sh

然后輸入以下內(nèi)容

1
2
3
4
5
#!/bin/bash
mkdir -p /home/www/awstats/akii.org
/usr/local/awstats/tools/awstats_buildstaticpages.pl -update  \
-config=akii.org -lang=cn -dir=/home/www/awstats/akii.org  \
-awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl

上述命令的具體意思如下:

  • /usr/local/awstats/tools/awstats_buildstaticpages.pl Awstats 靜態(tài)頁面生成工具
  • -update -config=akii.org 更新配置項
  • -lang=cn 語言為中文
  • -dir=/home/www/awstats 統(tǒng)計結(jié)果輸出目錄
  • -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl Awstats 日志更新程序路徑。

然后在你的nginx的配置文件中,在你想要安置awstats或默認的ip或域名的server段中,加入關于awstats和icon的兩個目錄配置。

如一個完整案例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
server {
listen       80;
server_name  localhost;
root /home/www;
index index.html;
 
location ~ ^/awstats/ {     # awstats  靜態(tài)頁面目錄
        root   /home/www/awstats;
        autoindex on; #可以目錄瀏覽你的多個域名的目錄用于分析
        index  index.html;
        access_log off;
}
 
location ~ ^/icon/ {             # 圖標目錄
        root   /usr/local/awstats/wwwroot;
        index  index.html;
        access_log off;
}
}

接下來可以測試一下腳本是否可以正確執(zhí)行

還是別忘了給它可執(zhí)行權(quán)限

1
2
chmod +x /root/awstats.sh
/root/awstats.sh

如果你看到它生成了一堆網(wǎng)頁,那就說明成功了。

輸出信息部分例如

1
2
3
4
5
6
Launch update process : "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -config=akii.org -update -configdir=
......
Build keywords page: "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -config=akii.org -staticlinks -lang=cn -output=keywords
Build errors404 page: "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -config=akii.org -staticlinks -lang=cn -output=errors404
20 files built.
Main HTML page is 'awstats.akii.org.html'.

然后可以把它加入自動運行了。

配置awstats腳本自動運行

1
crontab -e

加入

1
00 1 * * * /root/awstats.sh

然后保存退出。

這樣就可以每天在凌晨自動分割日志,并且開始自動用awstats分析nginx的日志了。

認證訪問

如果你想給你的awstats加上訪問密碼,可以見這里:nginx為目錄或網(wǎng)站加上密碼認證

原創(chuàng)文章,寫的辛苦。如果你要轉(zhuǎn)載,請保留出處及鏈接。

參考資料:http://www.ibm.com/developerworks/cn/linux/l-cn-awstats-nginx/index.html

posted @ 2013-01-06 18:05 小果子 閱讀(3310) | 評論 (0)編輯 收藏

Fast-CGI:
./configure --prefix=/usr/local/php --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=/etc --with-zlib --with-mysql --with-xml --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --enable-mbstring

PHP4-Server:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-config-file-path=/etc --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --enable-mbstring

PHP4-Max:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --mandir=/usr/share/man --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php/etc --with-openssl=/usr/local/openssl-0.9.7e --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-bz2 --with-inifile --with-hyperwave --enable-xml --enable-track-vars --enable-dba --enable-dbase --enable-filepro --enable-ftp --enable-versioning --enable-memory-limit --enable-calendar --enable-session --enable-sockets --enable-sysmsg --enable-sysvsem --enable-sysvshm --enable-tokenizer --enable-overload --enable-ctype --enable-sigchild --enable-magic-quotes --enable-roxen-zts --enable-fastcgi --enable-dbx --enable-dio --enable-shmop --enable-mbstring

PHP5-Server:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib-dir --with-bz2 --with-tiff-dir --with-libxml-dir --with-gd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-ttf --enable-mbstring --with-mysql=/usr/lib/mysql --with-config-file-path=/etc --disable-ipv6 --enable-gd-native-ttf

PHP5-Standard:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --mandir=/usr/share/man --with-openssl=/usr/local/openssl-0.9.7e --with-zlib --with-bz2 --with-tiff-dir --with-libxml-dir --enable-dio --enable-ftp --with-gd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-bz2-dir --with-ttf --enable-mbstring --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php/etc --disable-ipv6 --enable-gd-native-ttf

PHP5-Max:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --mandir=/usr/share/man --with-openssl=/usr/local/openssl-0.9.7e --with-zlib --with-bz2 --with-tiff-dir --with-libxml-dir --enable-dio --enable-ftp --with-gd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-bz2-dir --with-ttf --with-inifile --enable-dba --enable-dbase --enable-filepro --enable-versioning --enable-memory-limit --enable-calendar --enable-sockets --enable-sysvsem --enable-sigchild --enable-magic-quotes --enable-roxen-zts --enable-fastcgi --enable-dbx --enable-shmop --enable-mbstring --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php/etc --disable-ipv6 --enable-gd-native-ttf

posted @ 2013-01-05 17:37 小果子 閱讀(346) | 評論 (0)編輯 收藏
codeblocks很輕巧也很好用對于c/c++編寫在linux下相對于eclipse.
于是乎下了一個,由于是乎想寫幾個sample玩玩。于是乎拿<unix 高級環(huán)境編程> sample來測試。

于是乎建了一個c++ project.
<unix 高級環(huán)境編程>里的例子有個apue.h頭文件。不是系統(tǒng)自帶的。是作者自己寫的幾個util函數(shù)。
網(wǎng)上找編譯apue.h頭文件一大片。但是都是考來考去,不過核心的都差不多。不過有個方法是編譯完
libapue.a靜態(tài)庫后,還需要在apute.h頭文件尾巴加"error.c"。。完了拷貝error.c實現(xiàn)到目錄。。
看完后。我驚了呆。。好吧。。這庫還能這么用。。

既然libapue.a編譯完后,apue.h里的函數(shù)聲明在libapue.a都已經(jīng)實現(xiàn),當然包括err_xxx系列的。所以
在apue.h加"error.c"是畫蛇添足。。這里不推薦此方法。。

我的環(huán)境是mint14下, IDE用的是 codeblocks. 方法中基本都有這么一個步驟:
先在這個網(wǎng)站 http://www.apuebook.com/src.tar.gz 下載tar.gz格式的源碼包,然后解壓至某個目錄,比如說/home/xiaoguozi/下,然后進入目錄apue.2e,把文件 Make.defines.linux 中的 WKDIR=/home/xxx/apue.2e 修改為 WKDIR=/home/xiaoguozi/apue.2e ,然后再進入apue.2e目錄下的std目錄,打開linux.mk,將里面的nawk全部替換為awk
如果用vim編輯的話,可以用 :1,%s/nawk/awk/g 替換字符竄

完了make, 過程中,還遇到了幾個問題。(mint下,其他os不太清楚)

1: /usr/include/bits/timex.h:31:7:error: expect ':' , ',' , ';' , '}' or '__attribute__'   
 apue.2e/ipp/ipp.h中 #define status u.st 與 timex.h中的 status 沖突,更改 #define Status u.st

  

2:ARG_MAX 未定義

   在include/apue.h中加入 #define ARG_MAX 4096

   在threadctl/getenv1.c 加入 #include "../include/apue.h"

   在threadctl/getenv3.c 加入 #include "../include/apue.h"

完了之后,make應該就可以成功了

完了在codeblocks項目里引用剛編譯完的庫,有幾個方法:
1)將編譯完的庫,頭文件apue.h拷貝/usr/include,庫文件libapue.a拷貝到/usr/lib下,這個是系統(tǒng)目錄,gcc編譯的時候會在這目錄搜尋
2)在項目屬性添加靜態(tài)庫引用
添加頭文件:依次點擊project->bulid options->Search directories,在該標簽頁中點擊Compiler,單擊Add按鈕添加頭文件路徑
添加靜態(tài)庫路徑:依次點擊project->bulid options->Linker setting,在該標簽頁中點擊Add按鈕添加靜態(tài)庫路徑。

如果之前你建的是c project的話,應該就可以順利編譯通過了,但是對于建立c++的project,仍然提示鏈接錯誤,找不到函數(shù)實現(xiàn),
原因是libapue.a是c庫,用g++編譯的時候要引用c庫的話,因為c++編譯的時候會在函數(shù)加一些額外字符,所以當然會鏈接錯誤。
解決也簡單的在函數(shù)庫前加 extern "C",或者直接把apue.h用extern "C"包含,不清楚的補下相應知識。

加點額外的知識關于gcc/g++:
gcc和g++的區(qū)別

誤區(qū)一:gcc只能編譯c代碼,g++只能編譯c++代碼
兩者都可以,但是請注意:
1.后綴為.c的,gcc把它當作是C程序,而g++當作是c++程序;后綴為.cpp的,兩者都會認為是c++程序,注意,雖然c++是c的超集,但是兩者對語法的要求是有區(qū)別的。C++的語法規(guī)則更加嚴謹一些。
2.編譯階段,g++會調(diào)用gcc,對于c++代碼,兩者是等價的,但是因為gcc命令不能自動和C++程序使用的庫聯(lián)接,所以通常用g++來完成鏈接,為了統(tǒng)一起見,干脆編譯/鏈接統(tǒng)統(tǒng)用g++了,這就給人一種錯覺,好像cpp程序只能用g++似的。

誤區(qū)二:gcc不會定義__cplusplus宏,而g++會
實際上,這個宏只是標志著編譯器將會把代碼按C還是C++語法來解釋,如上所述,如果后綴為.c,并且采用gcc編譯器,則該宏就是未定義的,否則,就是已定義。

誤區(qū)三:編譯只能用gcc,鏈接只能用g++
嚴格來說,這句話不算錯誤,但是它混淆了概念,應該這樣說:編譯可以用gcc/g++,而鏈接可以用g++或者gcc -lstdc++。因為gcc命令不能自動和C++程序使用的庫聯(lián)接,所以通常使用g++來完成聯(lián)接。但在編譯階段,g++會自動調(diào)用gcc,二者等價。

gcc和g++的區(qū)別 我們在編譯c/c++代碼的時候,有人用gcc,有人用g++,于是各種說法都來了,譬如c代碼用gcc,而c++代碼用g++,或者說編譯用 gcc,鏈接用g++,一時也不知哪個說法正確,如果再遇上個extern "C",分歧就更多了,這里我想作個了結(jié),畢竟知識的目的是令人更清醒,而不是更糊涂。

posted @ 2013-01-04 20:23 小果子 閱讀(696) | 評論 (0)編輯 收藏
僅列出標題
共58頁: First 4 5 6 7 8 9 10 11 12 Last 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产精品99久久久久久久vr| 在线播放国产一区中文字幕剧情欧美| 欧美精品一区二区三区一线天视频 | 在线不卡欧美| 亚洲视频在线视频| 狠狠色伊人亚洲综合网站色| 亚洲老板91色精品久久| 久久久最新网址| 久久精品在线观看| 亚洲中午字幕| 欧美视频在线观看一区| 日韩天堂av| 欧美国产亚洲视频| 久久天堂av综合合色| 黄色成人av| 久久人91精品久久久久久不卡| 性色一区二区三区| 国产精品系列在线| 亚洲一区免费看| 一本久久精品一区二区| 欧美性一区二区| 香蕉久久夜色精品| 欧美中文字幕在线播放| 亚洲性xxxx| 国产日韩久久| 久久久国产成人精品| 先锋影音一区二区三区| 国际精品欧美精品| 蜜桃av噜噜一区| 欧美肥婆bbw| 一区二区精品| 这里只有精品电影| 国产伦精品一区二区三区免费| 午夜精品成人在线| 亚洲免费在线观看视频| 狠狠色狠狠色综合日日91app| 久久精品一区| 免费观看久久久4p| 中文欧美在线视频| 国产欧美亚洲日本| 久久久久久久性| 麻豆成人在线| 制服诱惑一区二区| 亚洲视频1区2区| 国产日韩欧美在线| 亚洲第一黄色网| 欧美顶级大胆免费视频| 中日韩视频在线观看| 欧美一区影院| 亚洲人成免费| 在线视频欧美日韩精品| 国产精品久久久久久久久果冻传媒 | 欧美成人免费网| 欧美粗暴jizz性欧美20| 一区二区三区视频在线看| 国产精品99久久久久久久女警| 国产乱码精品一区二区三区五月婷 | 91久久在线视频| 亚洲国产精品成人久久综合一区| 欧美高清视频| 欧美精品九九99久久| 欧美日韩亚洲网| 99视频精品在线| 亚洲国产另类久久精品| 欧美亚洲午夜视频在线观看| 欧美视频成人| 小黄鸭精品aⅴ导航网站入口| 亚洲精品美女| 欧美日韩国产在线一区| 日韩视频免费观看| 亚洲国产老妈| 欧美日韩一二三区| 亚洲一区二区三区高清| 一区二区三区精品视频| 欧美午夜视频网站| 午夜精品久久久久久久久久久久久| 欧美日本久久| 久久疯狂做爰流白浆xx| 激情欧美一区二区| 欧美jizz19hd性欧美| 狂野欧美性猛交xxxx巴西| 亚洲福利一区| 亚洲精品裸体| 国产精品亚洲综合久久| 久久久久在线观看| 美女日韩欧美| 在线亚洲+欧美+日本专区| 一区二区电影免费观看| 国产精品女人久久久久久| 欧美亚洲免费在线| 久久久999国产| 亚洲免费黄色| 亚洲欧美怡红院| 伊甸园精品99久久久久久| 亚洲国产一区二区a毛片| 欧美色图首页| 久久亚洲国产精品一区二区| 免费中文日韩| 午夜精品区一区二区三| 久久乐国产精品| 日韩亚洲不卡在线| 亚洲欧美韩国| 亚洲国产日韩欧美| 夜夜嗨av一区二区三区网页| 国产亚洲一区在线播放| 亚洲激情专区| 国产综合欧美在线看| 日韩写真视频在线观看| 国产自产高清不卡| 亚洲日本欧美天堂| 国产日本欧美一区二区三区在线| 欧美成人午夜视频| 国产欧美日韩三区| 亚洲美女精品久久| 日韩视频中文| 激情丁香综合| 亚洲国产精品123| 国产精品毛片大码女人| 亚洲丁香婷深爱综合| 国产精品家教| 亚洲精品久久视频| 永久久久久久| 亚洲欧美精品中文字幕在线| 日韩一区二区精品在线观看| 欧美在线在线| 欧美在线免费视屏| 国产精品成人一区二区三区夜夜夜 | 久久综合九色综合欧美就去吻| av成人动漫| 久久久一二三| 久久综合电影一区| 国产精品免费一区二区三区观看| 欧美激情一区二区三区在线视频观看 | 亚欧成人精品| 欧美理论在线| 亚洲激情在线观看| 亚洲欧洲精品一区二区三区不卡| 校园春色综合网| 性欧美video另类hd性玩具| 欧美日韩免费视频| 亚洲高清在线观看| 亚洲国产一区二区a毛片| 久久精品91久久久久久再现| 久久精品日韩| 国产丝袜一区二区| 午夜精品三级视频福利| 欧美一区观看| 国产一区二区在线观看免费播放 | 欧美亚洲日本一区| 国产美女诱惑一区二区| 国产精品99久久久久久久女警 | 1000部精品久久久久久久久| 久久久99精品免费观看不卡| 久久综合久久久| 亚洲欧洲午夜| 欧美在线免费观看视频| 久久免费国产精品| 亚洲电影下载| 欧美激情精品| 国产欧美精品一区| 91久久黄色| 一本久道久久综合狠狠爱| 欧美日韩久久久久久| 亚洲一区二区三区色| 香蕉久久一区二区不卡无毒影院| 国产麻豆精品久久一二三| 欧美一级理论性理论a| 麻豆久久婷婷| 亚洲精品欧美日韩专区| 欧美激情一区二区| 亚洲视频在线观看网站| 久久久久久电影| 亚洲精品在线一区二区| 国产精品99免视看9| 欧美亚洲视频| 亚洲激情在线激情| 久久精品国产99国产精品澳门 | 国内成人在线| 欧美区在线观看| 午夜伦欧美伦电影理论片| 免费一级欧美在线大片| 亚洲一区二区免费看| 激情综合五月天| 国产精品久久网| 免费观看成人| 欧美亚洲一区在线| 亚洲激情视频在线观看| 久久久亚洲高清| 亚洲网站视频| 最新成人av网站| 欧美日韩一区不卡| 午夜精品国产更新| 亚洲国产日韩欧美在线99| 欧美一级日韩一级| 妖精视频成人观看www| 国内外成人在线视频| 欧美视频一区二区三区在线观看| 久久夜色精品国产亚洲aⅴ | 久久精品国产一区二区三| 日韩一区二区高清|