<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>勿忘我</title>
	<atom:link href="http://blog.wuwangwo.net/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.wuwangwo.net</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 08:53:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>MongoDB之no db response数据库没有响应</title>
		<link>http://blog.wuwangwo.net/articles/36.html</link>
		<comments>http://blog.wuwangwo.net/articles/36.html#comments</comments>
		<pubDate>Tue, 17 Jan 2012 07:45:12 +0000</pubDate>
		<dc:creator>勿忘我</dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[程序设计]]></category>
		<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://blog.wuwangwo.net/?p=36</guid>
		<description><![CDATA[今天查看PHP的error log有很多错误产生，有Fatal error也有Warning，本着错误的级别先开始处理Fatal error除了几条还被搜索机器人抓取的不在使用的页面产生这种错误外，发现了一个多行的Fatal error仔细查看下是： [17-Jan-2012 11:16:19] PHP Fatal error: Uncaught exception 'MongoCursorException' with message 'no db response' in XXXXX.php:194 乍一看是为捕获抛出的异常，异常的错误信息是&#8217;no db response&#8217;数据库没有响应，接下去查看代码： 省略... $query = array('type' =&#62; 5); $cursor = $collection-&#62;find($query); foreach($cursor as $key =&#62; $val) {//出错的行 省略... } &#8230;<p class="read-more"><a href="http://blog.wuwangwo.net/articles/36.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>今天查看PHP的error log有很多错误产生，有Fatal error也有Warning，本着错误的级别先开始处理Fatal error除了几条还被搜索机器人抓取的不在使用的页面产生这种错误外，发现了一个多行的Fatal error仔细查看下是：</p>
<pre class="wp-code-highlight prettyprint">
[17-Jan-2012 11:16:19] PHP Fatal error:  Uncaught exception 'MongoCursorException' with message 'no db response' in XXXXX.php:194
</pre>
<p>乍一看是为捕获抛出的异常，异常的错误信息是&#8217;no db response&#8217;数据库没有响应，接下去查看代码：</p>
<pre class="wp-code-highlight prettyprint">
省略...
$query = array('type' =&gt; 5);
$cursor = $collection-&gt;find($query);
foreach($cursor as $key =&gt; $val) {//出错的行
	省略...
}
省略...
</pre>
<p>变量$cursor为查询MongoDB的返回结果，但是抛出的异常是&#8217;MongoCursorException&#8217;异常信息是&#8217;no db response&#8217;，查看PHP手册解释是：This may not even be an error, for example, the database command “shutdown” returns no response. However, if you were expecting a response, this means the database didn&#8217;t give one.坑爹的PHP手册上来就说：This may not even be an error（这甚至有可能不会是一个错误），for example, the database command “shutdown” returns no response.（例如，数据库输入&#8217;shutdown&#8217;命令而没有获得相应）。<br />
访遍Google、百度没有获得满意的答案，不过问题应该已经比较清晰出现在了MongoDB或是网络上面，于是继续想办法查找问题中，截止到博文发布还没有找到问题原因！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wuwangwo.net/articles/36.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoAccess，Apache/Nginx 日志统计分析软件</title>
		<link>http://blog.wuwangwo.net/articles/20.html</link>
		<comments>http://blog.wuwangwo.net/articles/20.html#comments</comments>
		<pubDate>Tue, 13 Dec 2011 07:45:20 +0000</pubDate>
		<dc:creator>勿忘我</dc:creator>
				<category><![CDATA[服务器]]></category>
		<category><![CDATA[程序设计]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[GoAccess]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://blog.wuwangwo.net/?p=20</guid>
		<description><![CDATA[&#160; 什么是GoAccess？ GoAccess是运行在Unix系统终端，开源、实时分析Apache日志（其实也能够分析Nginx日志）并且能够动态呈现的软件。它为系统管理员提供了一个快速、有价值的HTTP统计，动态的可视化的服务器报告。 它是做什么以及如何工作？ 从本质上讲，GoAccess的工作方式是，它将解析众所周知的Apache访问日志文件 access log，GoAccess通过解析日志收集的数据，将会显示它的控制台或某个终端。收集到的信息或生成的报告将显示给在视觉、交互窗口的系统管理员用户。报告包括： 综合统计 访客排行榜 请求文件排行榜 请求的静态文件排行榜，如图片、JS文件、CSS文件等 访问来源 404页面 访问者的操作系统 访问者的浏览器 浏览器和蜘蛛（搜索爬虫） 主机，反向DNS，IP位置 HTTP状态码 推介网站 搜索关键词 显示时不同的配色方案 无限制日志文件的大小（决定了GoAccess的打开速度） 日志文件格式 GoAccess可以解析Apache的日志格式，通用日志格式（CLF）和组合日志格式（XLF/ ELF），包括虚拟主机. 它也能够解析Nginx日志. (如果你按照Apache日志的格式配置了Nginx日志) GoAccess主页 http://goaccess.prosoftcorp.com/ 安装方法 1、安装GoAccess需要一些系统支持库 Ncurses 提供字符终端处理库，包括面板和菜单 GLib C语言的函数库（大于2.0的版本） GeoIP 通过IP，定位他的经纬度，国家/地区，省市，甚至街道等位置信息。(如果不需要这个不是必须的，配置时候去掉这个选项 &#8211;enable-geoip) CentOS下yum安装 yum &#8230;<p class="read-more"><a href="http://blog.wuwangwo.net/articles/20.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><strong>什么是GoAccess？</strong></p>
<p>GoAccess是运行在Unix系统终端，开源、实时分析Apache日志（其实也能够分析Nginx日志）并且能够动态呈现的软件。它为系统管理员提供了一个快速、有价值的HTTP统计，动态的可视化的服务器报告。</p>
<p><img class="alignnone" title="GoAccess" src="http://goaccess.prosoftcorp.com/images/goaccessM.png" alt="" width="270" height="313" /></p>
<p><strong>它是做什么以及如何工作？</strong></p>
<p>从本质上讲，GoAccess的工作方式是，它将解析众所周知的Apache访问日志文件 access log，GoAccess通过解析日志收集的数据，将会显示它的控制台或某个终端。收集到的信息或生成的报告将显示给在视觉、交互窗口的系统管理员用户。报告包括：</p>
<ul>
<li>综合统计</li>
</ul>
<ul>
<li>访客排行榜</li>
</ul>
<ul>
<li>请求文件排行榜</li>
</ul>
<ul>
<li>请求的静态文件排行榜，如图片、JS文件、CSS文件等</li>
</ul>
<ul>
<li>访问来源</li>
</ul>
<ul>
<li>404页面</li>
</ul>
<ul>
<li>访问者的操作系统</li>
</ul>
<ul>
<li>访问者的浏览器</li>
</ul>
<ul>
<li>浏览器和蜘蛛（搜索爬虫）</li>
</ul>
<ul>
<li>主机，反向DNS，IP位置</li>
</ul>
<ul>
<li>HTTP状态码</li>
</ul>
<ul>
<li>推介网站</li>
</ul>
<ul>
<li>搜索关键词</li>
</ul>
<ul>
<li>显示时不同的配色方案</li>
</ul>
<ul>
<li>无限制日志文件的大小（决定了GoAccess的打开速度）</li>
</ul>
<p><strong>日志文件格式</strong></p>
<p>GoAccess可以解析Apache的日志格式，通用日志格式（CLF）和组合日志格式（XLF/ ELF），包括虚拟主机. 它也能够解析Nginx日志. (如果你按照Apache日志的格式配置了Nginx日志)</p>
<p>GoAccess主页 <a title="GoAccess" href="http://goaccess.prosoftcorp.com/" target="_blank">http://goaccess.prosoftcorp.com/</a></p>
<p><strong>安装方法</strong></p>
<p>1、安装GoAccess需要一些系统支持库</p>
<p><a href="http://www.gnu.org/software/ncurses/" target="_blank">Ncurses</a> 提供字符终端处理库，包括面板和菜单<br />
<a href="http://developer.gnome.org/glib/" target="_blank">GLib</a> C语言的函数库（大于2.0的版本）<br />
<a href="http://www.maxmind.com/" target="_blank">GeoIP</a> 通过IP，定位他的经纬度，国家/地区，省市，甚至街道等位置信息。(如果不需要这个不是必须的，配置时候去掉这个选项 &#8211;enable-geoip)</p>
<p>CentOS下yum安装</p>
<pre class="wp-code-highlight prettyprint">yum install ncurses-devel
yum install glib2-devel</pre>
<p>Ubuntu下apt安装</p>
<pre class="wp-code-highlight prettyprint">apt-get install libglib2.0-dev
apt-get install libncursesw5-dev</pre>
<p>2、安装GoAccess</p>
<p>CentOS下安装</p>
<pre class="wp-code-highlight prettyprint">wget http://sourceforge.net/projects/goaccess/files/0.4.2/goaccess-0.4.2.tar.gz
tar zxvf goaccess-0.4.2.tar.gz
cd goaccess-0.4.2
./configure --enable-utf8
make
make install</pre>
<p>Ubuntu下安装</p>
<pre class="wp-code-highlight prettyprint">apt-get install goaccess</pre>
<p><strong>GoAccess使用介绍</strong></p>
<p>启动参数介绍：</p>
<ul>
<li>-b 流量消耗统计，如果想要提高解析速度，不要开启这个选项。缺省值为不开启此选项</li>
<li>-f 日志文件路径。</li>
<li>-s HTTP 状态码报告，为了能够更好的解析日志，选项被默认关闭。</li>
<li>-e 指定IP地址的访问统计。</li>
<li>-a 通过代理的请求统计。</li>
</ul>
<p>菜单介绍</p>
<ul>
<li>F1 帮助菜单</li>
<li>F5 刷新</li>
<li>q 退出当前口窗、菜单、或是当前查看的选项</li>
<li>o 打开当前的选项、菜单</li>
<li>c 改变窗口配色（目前只有两种 默认和绿色）</li>
<li>SHIFT + TAB 从当前选定模块向后切换</li>
<li>RIGHT 打开当前选中模块，查看详细信息</li>
<li>s 通过日期排序，只会在访问请求模块起作用</li>
<li>S 通过点击次数排序，只会在访问请求模块起作用</li>
<li>/ 查看详细信息的窗口进行搜索</li>
<li>n 通过/进行查找后，查找下个匹配的内容的位置，如果没有则在窗口底部显示“search hit BOTTOM”</li>
<li>t 在查看详细信息窗口，移动指针到最顶部</li>
<li>b 在查看详细信息窗口，移动指针到最底部</li>
</ul>
<p>使用实例</p>
<ul>
<li>最简单、快速的使用方式</li>
</ul>
<pre class="wp-code-highlight prettyprint">goaccess -f /data1/logs/blog.wuwangwo.net/access.log</pre>
<ul>
<li>产生完整、全面统计数据的使用方式</li>
</ul>
<pre class="wp-code-highlight prettyprint">goaccess -f /data1/logs/blog.wuwangwo.net/access.log -a -s -b</pre>
<ul>
<li>通过管道的方式将更多access log 通过GoAccess解析</li>
</ul>
<pre class="wp-code-highlight prettyprint">zcat access.log.*.gz | goaccess</pre>
<p>或者</p>
<pre class="wp-code-highlight prettyprint">zcat -f access.log* | goaccess</pre>
<ul>
<li>另外一种通过管道使用GoAccess解析日志的方式</li>
</ul>
<pre class="wp-code-highlight prettyprint">sed -n '/05\/Dec\/2010/,$ p' access.log | goaccess -s -b</pre>
<ul>
<li>低优先级运行GoAccess的方式</li>
</ul>
<pre class="wp-code-highlight prettyprint">nice -n 19 goaccess -f access.log -s -a -b</pre>
<ul>
<li>如果你只把GoAccess安装到了一台服务器上</li>
</ul>
<pre class="wp-code-highlight prettyprint">ssh user@server 'cat /var/log/apache2/access.log' | goaccess -s -a -b</pre>
<p>注意事项</p>
<ol>
<li>每一个详细信息窗口，只显示300条数据</li>
<li>GoAccess 通过管道解析日志时将禁用实时解析的功能</li>
</ol>
<p>总结</p>
<p>GoAceess 不是很大的一款软件却有着强大的功能即使软件可能还有些BUG，软件的更多介绍信息请查看GoAccess的官方网站<a title="GoAccess" href="http://goaccess.prosoftcorp.com/faq" target="_blank">«./GoAccess»</a>，当前版本的官方手册页面 <a title="«./GoAccess» Man Page" href="http://goaccess.prosoftcorp.com/man" target="_blank">Man Page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wuwangwo.net/articles/20.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>勿忘我博客的搭建过程（留给自己）</title>
		<link>http://blog.wuwangwo.net/articles/5.html</link>
		<comments>http://blog.wuwangwo.net/articles/5.html#comments</comments>
		<pubDate>Sat, 10 Dec 2011 12:07:06 +0000</pubDate>
		<dc:creator>勿忘我</dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://blog.wuwangwo.net/?p=5</guid>
		<description><![CDATA[简述下此博客的搭建过程,现在的访问到的博客是第二次搭建了，第一次搭建完的时候出现了点问题，然后处理各种问题服务器被高的乱七八糟实在是不愿意再去解决自己搞出的问题了，直接重新刷新了系统，从头开始安装，由于经过了第一次的安装，第二个过程中就少了很多纠结很多问题 服务器：服务器采用的linode的VPS（日本东京机房） 不再多说直接简述服务器的搭建过程 软件准备： wget http://nginx.org/download/nginx-1.1.10.tar.gz wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz wget http://cdnetworks-kr-1.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz wget http://cdnetworks-kr-1.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz wget http://cdnetworks-kr-1.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz wget http://cdnetworks-kr-2.dl.sourceforge.net/project/pcre/pcre/8.20/pcre-8.20.tar.gz wget http://jp.php.net/distributions/php-5.3.8.tar.gz wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.19.tar.gz 操作系统采用的 Ubuntu 11.10 64bit（系统较为纯净要安装一些必要的工具软件） apt-get install gcc g++ ssh automake cmake build-essential autoconf make re2c wget cron bzip2 rcconf flex &#8230;<p class="read-more"><a href="http://blog.wuwangwo.net/articles/5.html">继续阅读 &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>简述下此博客的搭建过程,现在的访问到的博客是第二次搭建了，第一次搭建完的时候出现了点问题，然后处理各种问题服务器被高的乱七八糟实在是不愿意再去解决自己搞出的问题了，直接重新刷新了系统，从头开始安装，由于经过了第一次的安装，第二个过程中就少了很多纠结很多问题<br />
服务器：服务器采用的<a title="linode" href="http://linode.com" target="_blank">linode</a>的VPS（日本东京机房）<br />
不再多说直接简述服务器的搭建过程<br />
软件准备：</p>
<pre class="wp-code-highlight prettyprint">wget http://nginx.org/download/nginx-1.1.10.tar.gz
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
wget http://cdnetworks-kr-1.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
wget http://cdnetworks-kr-1.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
wget http://cdnetworks-kr-1.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/pcre/pcre/8.20/pcre-8.20.tar.gz
wget http://jp.php.net/distributions/php-5.3.8.tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.19.tar.gz</pre>
<p>操作系统采用的 Ubuntu 11.10 64bit（系统较为纯净要安装一些必要的工具软件）</p>
<pre class="wp-code-highlight prettyprint">apt-get install gcc g++ ssh automake cmake build-essential autoconf make re2c wget cron bzip2 rcconf flex vim bison m4 mawk cpp binutils libncurses5 unzip tar libncurses5 libncurses5-dev libtool libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev libltdl3-dev libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev libltdl3-dev libmcrypt-dev</pre>
<p>编译安装PHP所需的支持库</p>
<pre class="wp-code-highlight prettyprint">tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14/
./configure --prefix=/usr/local
make
make install
cd ../

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make
make install
cd ../

tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../

tar zxvf pcre-8.10.tar.gz
cd pcre-8.10
./configure
make
make install</pre>
<p>安装MySQL，版本5.5.19</p>
<pre class="wp-code-highlight prettyprint">tar zxvf mysql-5.5.19.tar.gz
cd mysql-5.5.19
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8-unicode_ci -DMYSQL_DATADIR=/usr/local/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306
make
make install
cd ../mysql
cp support-files/my-small.cnf /etc/my.cnf
/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
/usr/local/mysql/bin/mysqld_safe --user=mysql&amp;amp;
/usr/local/mysql/bin/mysqladmin -u root password 'XXXXXX'</pre>
<p>安装curl，没有想到系统纯净到连curl都没有</p>
<pre class="wp-code-highlight prettyprint">apt-get install libcurl4-gnutls-dev</pre>
<p>安装PHP，版本5.3.8</p>
<pre class="wp-code-highlight prettyprint">tar zxvf php-5.3.8.tar.gz
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap
make ZEND_EXTRA_LIBS='-liconv'
make test
make install
cp php.ini-production /usr/local/php/etc/php.ini</pre>
<p>执行命令查看PHP相关配置，获取PHP扩展存放目录extension-dir值</p>
<pre class="wp-code-highlight prettyprint">/usr/local/php/bin/php-config</pre>
<p>以上命令输出</p>
<pre class="wp-code-highlight prettyprint">
Usage: /usr/local/php/bin/php-config [OPTION]
Options:
  --prefix            [/usr/local/php]
  --includes          [-I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib]
  --ldflags           [ -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -L/usr/local/mysql/lib]
  --libs              [-lcrypt   -lz -lresolv -lcrypt -lrt -lmysqlclient -lmcrypt -lltdl -lcurl -lz -lrt -lm -ldl -lnsl  -lrt -lxml2 -lcurl -lxml2 -lmysqlclient -lz -lm -lrt -ldl -lxml2 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lxml2 -lcrypt ]
  --extension-dir     [/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626]
  --include-dir       [/usr/local/php/include/php]
  --man-dir           [/usr/local/php/man]
  --php-binary        [/usr/local/php/bin/php]
  --php-sapis         [cli fpm]
  --configure-options [--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap]
  --version           [5.3.8]
  --vernum            [50308]
</pre>
<pre class="wp-code-highlight prettyprint">vi /usr/local/php/etc/php.ini</pre>
<p>修改文件以下地方</p>
<pre class="wp-code-highlight prettyprint">extension_dir = &quot;./&quot;</pre>
<p>修改为</p>
<pre class="wp-code-highlight prettyprint">extension_dir = &quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/&quot;</pre>
<p>创建fastcgi配置文件</p>
<pre class="wp-code-highlight prettyprint">cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf</pre>
<p>修改fastcgi配置文件</p>
<pre class="wp-code-highlight prettyprint">vi /usr/local/php/etc/php-fpm.conf</pre>
<p>去掉注释以下几行的注释</p>
<pre class="wp-code-highlight prettyprint">pid = run/php-fpm.pid
error_log = log/php-fpm.log
log_level = notice
pm.start_servers
pm.min_spare_servers
pm.max_spare_servers</pre>
<p>修改文件以下两行，不修改启动fastcgi会报错 “fastcgi [pool www] cannot get gid for group &#8216;nobody&#8217;”</p>
<pre class="wp-code-highlight prettyprint">user = nobody
group = nobody</pre>
<p>修改为</p>
<pre class="wp-code-highlight prettyprint">user = www
group = www</pre>
<p>启动fastcgi</p>
<pre class="wp-code-highlight prettyprint">/usr/local/php/sbin/php-fpm</pre>
<p>创建日志文件目录</p>
<pre class="wp-code-highlight prettyprint">mkdir -p /data1/logs/blog.wuwangwo.net
chmod +w /data1/logs/blog.wuwangwo.net
chown -R www:www /data1/logs/blog.wuwangwo.net</pre>
<p>创建程序文件目录</p>
<pre class="wp-code-highlight prettyprint">mkdir -p /data/htdocs/blog.wuwangwo.net
chmod +w /data/htdocs/blog.wuwangwo.net
chown -R www:www /data/htdocs/blog.wuwangwo.net</pre>
<p>安装Nginx，版本1.1.10</p>
<pre class="wp-code-highlight prettyprint">tar zxvf nginx-1.1.10.tar.gz
cd nginx-1.1.10/
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module
make
make install</pre>
<p>启动Nginx</p>
<pre class="wp-code-highlight prettyprint">/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf</pre>
<p>ps：感谢在博客搭建过程中给予我巨大帮助的<a title="NoSQLFan，关注NoSQL相关的新闻与技术" href="http://blog.nosqlfan.com" target="_blank">NoSQLFan</a>博主<a title="iammutex" href="http://weibo.com/iammutex" target="_blank">iammutex</a>和<a title="苹果派苹果中文资讯 资源下载 苹果产品代购" href="http://ipie.me" target="_blank">苹果派</a>博主<a title="爱奇艺小木马" href="http://weibo.com/guanlin" target="_blank">小木马</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wuwangwo.net/articles/5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello,World!</title>
		<link>http://blog.wuwangwo.net/articles/1.html</link>
		<comments>http://blog.wuwangwo.net/articles/1.html#comments</comments>
		<pubDate>Sat, 10 Dec 2011 10:00:14 +0000</pubDate>
		<dc:creator>勿忘我</dc:creator>
				<category><![CDATA[杂谈]]></category>

		<guid isPermaLink="false">http://blog.wuwangwo.net/?p=1</guid>
		<description><![CDATA[&#60;?php echo 'Hello,World!';]]></description>
			<content:encoded><![CDATA[<pre class="wp-code-highlight prettyprint">
&lt;?php
echo 'Hello,World!';
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.wuwangwo.net/articles/1.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

