﻿
<?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://www.helloyi.cn/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.helloyi.cn</link>
	<description>春色三分,二分尘土,一分流水</description>
	<lastBuildDate>Fri, 30 Sep 2011 08:46:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>MAC OSX Lion 下通过macport安装nginx和php笔记</title>
		<link>http://www.helloyi.cn/index.php/2011/09/30/mac-osx-lion-macport-nginx-php/</link>
		<comments>http://www.helloyi.cn/index.php/2011/09/30/mac-osx-lion-macport-nginx-php/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 08:43:52 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[linux系统]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3384</guid>
		<description><![CDATA[MAC OSX 下有类似于 centos下的 yum 包管理工具，就是 macports 首先安装macports 到这里下载最新的macports的Mac OS X Package(.pkg)安装包 sudo port nginx sudo port php5 源代码来编译安装了，其中nginx和php是通过macport进行的， mysql则通过官网的dmg包进行安装。 首先安装macport，从其官网上下载dmg包进行安装，安装完成后重启bash执行sudo port selfupdate。 接下来安装php（安装了fastcgi模块，这里通过fastcgi来执行php），打开bash，输入 sudo port install php5 +fastcgi fcgi php5-gd php5-mysql php5-sqlite php5-curl php5-iconv 待安装完成后，继续执行 cd /opt/local/etc/php5 sudo cp php.ini-development php.ini 然后打开配置文件php.ini，修改时区date.timezone=Asia/Chongqing和错误级别error_reporting=E_ALL&#38;~E_NOTICE，其他配置项视情况修改。 启动phpfcgi：sudo /opt/local/bin/spawn-fcgi -C 2 -p 9000 /opt/local/bin/php-cgi。执行后即在9000这个端口监听请求。 杀死phpfcgi进程：sudo killall -9 php-cgi。 接下来安装nginx，输入 [...]]]></description>
			<content:encoded><![CDATA[<p>MAC OSX 下有类似于 centos下的 yum 包管理工具，就是 macports</p>
<p>首先安装macports</p>
<p>到<a href="“http://guide.macports.org”&quot;">这<span style="text-decoration: underline;">里</span></a>下载最新的macports的Mac OS X Package(.pkg)安装包</p>
<p>sudo port nginx</p>
<p>sudo port php5</p>
<p><span id="more-3384"></span>源代码来编译安装了，其中nginx和php是通过<a href="http://www.macports.org/">macport</a>进行的，</p>
<p>mysql则通过官网的dmg包进行安装。</p>
<p>首先安装macport，从其官网上下载dmg包进行安装，安装完成后重启bash执行sudo port selfupdate。</p>
<p>接下来安装php（安装了fastcgi模块，这里通过fastcgi来执行php），打开bash，输入</p>
<div>
<p>sudo port install php5 +fastcgi fcgi php5-gd php5-mysql php5-sqlite php5-curl php5-iconv</p>
</div>
<p>待安装完成后，继续执行</p>
<div>
<p>cd /opt/local/etc/php5 sudo cp php.ini-development php.ini</p>
</div>
<p>然后打开配置文件php.ini，修改时区date.timezone=Asia/Chongqing和错误级别error_reporting=E_ALL&amp;~E_NOTICE，其他配置项视情况修改。</p>
<p>启动phpfcgi：sudo /opt/local/bin/spawn-fcgi -C 2 -p 9000 /opt/local/bin/php-cgi。执行后即在9000这个端口监听请求。</p>
<p>杀死phpfcgi进程：sudo killall -9 php-cgi。</p>
<p>接下来安装nginx，输入</p>
<div>
<p>sudo port install nginx spawn-fcgi</p>
</div>
<p>安装完毕后，执行vim /opt/local/etc/nginx/nginx.conf,修改配置文件。可大致参考：</p>
<div>
<p># 自动显示目录索引 autoindex on; autoindex_exact_size on; autoindex_localtime on;  server{     #web根目录的位置，这里直接使用当前目录     root /Users/你的用户名/Sites/;      index  index.php index.html index.htm;      #本机自用，关闭log     access_log off;      #php的设置     location ~ \.php$ {        fastcgi_pass   127.0.0.1:9000;        fastcgi_index  index.php;        fastcgi_param  SCRIPT_FILENAME /Users/你的用户名/Sites/$fastcgi_script_name;        include        fastcgi_params;     }  }</p>
</div>
<p>配置文件写好后，可通过sudo nginx -t来检测配置文件是否有效。</p>
<p>启动nginx: sudo nginx。重启nginx的命令是：sudo nginx -s reload。nginx启动成功后，访问<a href="http://127.0.0.1/">http://127.0.0.1</a>检查是否有效。如正常，则可创建index.php以测试php部分是否正常。index.php的典型内容是：</p>
<div>
<p>&lt;?php phpinfo();</p>
</div>
<p>访问这个页面，正常则可看到php的相关信息。</p>
<p>mysql的安装则很简单，访问官网下载相应的版本安装即可。安装完成后可执行sudo vim /etc/bashrc，在bash的配置文件中添加mysql和mysqladmin这两个工具的别名。在bashrc文件的末尾添加：</p>
<div>
<p>alias mysql=&#8217;/usr/local/mysql/bin/mysql&#8217; alias mysqladmin=&#8217;/usr/local/mysql/bin/mysqladmin&#8217;</p>
</div>
<p>完成后重启bash。默认情况下mysql的root账号是没有密码的，可以通过mysqladmin -u root password &#8220;新密码&#8221;来设置。</p>
<p>接下来安装phpmyadmin作为mysql的管理工具。从官网下载文件后解压到~/Sites目录，目录名为phpmyadmin，然后执行cp ~/Sites/phpmyadmin/config.sample.inc.php ~/Sites/phpmyadmin/config.inc.php，然后打开config.inc.php文件，修改以下内容：</p>
<div>
<p>$cfg['blowfish_secret'] = &#8216;输入一串字符&#8217;; //cookies加密用</p>
</div>
<p>访问 <a href="http://127.0.0.1/phpmyadmin">http://127.0.0.1/phpmyadmin</a> 输入账户密码，即可进入管理界面。此时可能会看到一些提示，比如没有mbstring库，安装mbstring后即可正常，重新执行上文提到的php安装指令（需在指令末尾加上php5-mbstring）即可。</p>
<p>至此，nginx-php-mysql基本配置完毕。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2011/09/30/mac-osx-lion-macport-nginx-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secret Socks for Mac OSX 翻墙工具</title>
		<link>http://www.helloyi.cn/index.php/2011/08/26/secret-socks-for-mac-osx-%e7%bf%bb%e5%a2%99%e5%b7%a5%e5%85%b7/</link>
		<comments>http://www.helloyi.cn/index.php/2011/08/26/secret-socks-for-mac-osx-%e7%bf%bb%e5%a2%99%e5%b7%a5%e5%85%b7/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 07:38:54 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[网页设计]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3377</guid>
		<description><![CDATA[Secret Socks 是mac osx 下的一款翻墙工具类似于windows下面的MyEnTunnel工具，通一个SSH帐号设置就可以进行完成翻墙 可以是全局性的，你也可以通过firefox下面的AoutoProy插件进行浏览器翻墙，其它网络不影响。 如果需要取消SSH翻墙上网，关闭Secret Socks 连接同时需要到-》打开网络偏号设置-》高级-》代理-》中取消SOCKS才行 下载 ：http://socks.nihilex.com/SecretSocks-1.0.2.dmg]]></description>
			<content:encoded><![CDATA[<p>Secret Socks 是mac osx 下的一款翻墙工具类似于windows下面的MyEnTunnel工具，通一个SSH帐号设置就可以进行完成翻墙</p>
<p>可以是全局性的，你也可以通过firefox下面的AoutoProy插件进行浏览器翻墙，其它网络不影响。</p>
<p>如果需要取消SSH翻墙上网，关闭Secret Socks 连接同时需要到-》打开网络偏号设置-》高级-》代理-》中取消SOCKS才行</p>
<p><span id="more-3377"></span></p>
<p>下载 ：http://socks.nihilex.com/SecretSocks-1.0.2.dmg</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2011/08/26/secret-socks-for-mac-osx-%e7%bf%bb%e5%a2%99%e5%b7%a5%e5%85%b7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linux下mysql5.5.11编译安装笔记</title>
		<link>http://www.helloyi.cn/index.php/2011/04/08/mysql5-5-11-install-log/</link>
		<comments>http://www.helloyi.cn/index.php/2011/04/08/mysql5-5-11-install-log/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 08:59:01 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[数据库应用]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql5.5]]></category>
		<category><![CDATA[mysql5.5.11]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3347</guid>
		<description><![CDATA[mysql 最新的版本5.5.11需要cmake编译安装，估计以后的版本也会采用这种方式，网上找了一些安装方法有些地方是错的，自己整理一份 所以特地记录一下安装步骤及过程，以供参考！ 1,安装所需要系统库相关库文件 yum –y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* 2,创建mysql安装目录 # mkdir -p /usr/local/webserver/mysql/ 3,创建数据存放目录 # mkdir -p /data/mysql/ 4,创建用户和用户组与赋予数据存放目录权限 # groupadd mysql # useradd -g mysql mysql # chown mysql.mysql -R /data/mysql/ 5,安装cmake（mysql5.5以后是通过cmake来编译的） # wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz # tar zxvf cmake-2.8.4.tar.gz # cd cmake-2.8.4 #.configure # [...]]]></description>
			<content:encoded><![CDATA[<p>mysql 最新的版本5.5.11需要cmake编译安装，估计以后的版本也会采用这种方式，网上找了一些安装方法有些地方是错的，自己整理一份 所以特地记录一下安装步骤及过程，以供参考！<br />
<span id="more-3347"></span></p>
<div class="codecolorer-container c mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>安装所需要系统库相关库文件<br />
yum –y install gcc gcc<span style="color: #339933;">-</span>c<span style="color: #339933;">++</span> gcc<span style="color: #339933;">-</span>g77 autoconf automake zlib<span style="color: #339933;">*</span> fiex<span style="color: #339933;">*</span> libxml<span style="color: #339933;">*</span><br />
ncurses<span style="color: #339933;">-</span>devel libmcrypt<span style="color: #339933;">*</span> libtool<span style="color: #339933;">-</span>ltdl<span style="color: #339933;">-</span>devel<span style="color: #339933;">*</span><br />
<span style="color: #0000dd;">2</span><span style="color: #339933;">,</span>创建mysql安装目录<br />
<span style="color: #339933;"># mkdir -p /usr/local/webserver/mysql/</span><br />
<span style="color: #0000dd;">3</span><span style="color: #339933;">,</span>创建数据存放目录<br />
<span style="color: #339933;"># mkdir -p /data/mysql/</span><br />
<span style="color: #0000dd;">4</span><span style="color: #339933;">,</span>创建用户和用户组与赋予数据存放目录权限<br />
<span style="color: #339933;"># groupadd mysql</span><br />
<span style="color: #339933;"># useradd -g mysql mysql</span><br />
<span style="color: #339933;"># chown mysql.mysql -R /data/mysql/</span><br />
<span style="color: #0000dd;">5</span><span style="color: #339933;">,</span>安装cmake（mysql5.5以后是通过cmake来编译的）<br />
<span style="color: #339933;"># wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz</span><br />
<span style="color: #339933;"># tar zxvf cmake-2.8.4.tar.gz</span><br />
<span style="color: #339933;"># cd cmake-2.8.4</span><br />
<span style="color: #339933;">#.configure</span><br />
<span style="color: #339933;"># make &amp;amp;&amp;amp; make install</span><br />
<span style="color: #0000dd;">6</span><span style="color: #339933;">,</span>下载解压mysql 5.5.11<br />
wget http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.11.tar.gz</span><br />
<span style="color: #009900;">&#91;</span>root@localhost down<span style="color: #009900;">&#93;</span><span style="color: #339933;"># tar zxvf mysql-5.5.11.tar.gz</span><br />
<span style="color: #009900;">&#91;</span>root@localhost down<span style="color: #009900;">&#93;</span><span style="color: #339933;"># cd mysql-5.5.11</span><br />
<span style="color: #0000dd;">7</span><span style="color: #339933;">,</span>编译mysql<span style="color: #339933;">-</span>5.5.11<br />
cmake . <span style="color: #339933;">-</span>DCMAKE_INSTALL_PREFIX<span style="color: #339933;">=/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>webserver<span style="color: #339933;">/</span>mysql<span style="color: #339933;">/</span><br />
\<span style="color: #339933;">-</span>DMYSQL_DATADIR<span style="color: #339933;">=/</span>data<span style="color: #339933;">/</span>mysql<br />
\<span style="color: #339933;">-</span>DMYSQL_UNIX_ADDR<span style="color: #339933;">=/</span>data<span style="color: #339933;">/</span>mysql<span style="color: #339933;">/</span>mysqld.<span style="color: #202020;">sock</span><br />
\<span style="color: #339933;">-</span>DWITH_INNOBASE_STORAGE_ENGINE<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><br />
\<span style="color: #339933;">-</span>DENABLED_LOCAL_INFILE<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span> \<span style="color: #339933;">-</span>DMYSQL_TCP_PORT<span style="color: #339933;">=</span><span style="color: #0000dd;">3306</span><br />
\<span style="color: #339933;">-</span>DEXTRA_CHARSETS<span style="color: #339933;">=</span>all \<span style="color: #339933;">-</span>DDEFAULT_CHARSET<span style="color: #339933;">=</span>utf8<br />
\<span style="color: #339933;">-</span>DDEFAULT_COLLATION<span style="color: #339933;">=</span>utf8<span style="color: #339933;">-</span>general_ci<br />
\<span style="color: #339933;">-</span>DMYSQL_UNIX_ADDR<span style="color: #339933;">=/</span>data<span style="color: #339933;">/</span>mysql<span style="color: #339933;">/</span>mysql.<span style="color: #202020;">sock</span><br />
\<span style="color: #339933;">-</span>DMYSQL_USER<span style="color: #339933;">=</span>mysql \<span style="color: #339933;">-</span>DWITH_DEBUG<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><br />
<span style="color: #009900;">&#91;</span>root@host mysql<span style="color: #339933;">-</span>5.5.11<span style="color: #009900;">&#93;</span><span style="color: #339933;"># make</span><br />
<span style="color: #009900;">&#91;</span>root@host mysql<span style="color: #339933;">-</span>5.5.11<span style="color: #009900;">&#93;</span><span style="color: #339933;"># make install</span><br />
<span style="color: #0000dd;">8</span><span style="color: #339933;">,</span>复制配置文件<br />
<span style="color: #009900;">&#91;</span>root@mysql<span style="color: #339933;">-</span>5.5.11<span style="color: #009900;">&#93;</span><span style="color: #339933;"># cp support-files/my-medium.cnf /etc/my.cnf</span><br />
<span style="color: #009900;">&#91;</span>root@mysql<span style="color: #339933;">-</span>5.5.11<span style="color: #009900;">&#93;</span><span style="color: #339933;"># cp support-files/mysql.server /etc/init.d/mysqld</span><br />
<span style="color: #009900;">&#91;</span>root@mysql<span style="color: #339933;">-</span>5.5.11<span style="color: #009900;">&#93;</span><span style="color: #339933;"># chmod 755 /etc/init.d/mysqld</span><br />
<span style="color: #0000dd;">9</span><span style="color: #339933;">,</span>初始化数据库<br />
bash scripts<span style="color: #339933;">/</span>mysql_install_db <span style="color: #339933;">--</span>user<span style="color: #339933;">=</span>mysql <span style="color: #339933;">--</span>basedir<span style="color: #339933;">=</span><br />
<span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>webserver<span style="color: #339933;">/</span>mysql <span style="color: #339933;">--</span>datadir<span style="color: #339933;">=/</span>data<span style="color: #339933;">/</span>mysql<span style="color: #339933;">/</span><br />
<span style="color: #0000dd;">10</span><span style="color: #339933;">,</span>启动mysql服务<br />
<span style="color: #009900;">&#91;</span>root@localhost mysql<span style="color: #339933;">-</span>5.5.11<span style="color: #009900;">&#93;</span><span style="color: #339933;"># /etc/init.d/mysqld start</span><br />
<span style="color: #0000dd;">11</span><span style="color: #339933;">,</span>启动完成之后用ps <span style="color: #339933;">-</span>ef <span style="color: #339933;">|</span>grep mysql 命令查看是否启动<br />
<span style="color: #0000dd;">12</span><span style="color: #339933;">,</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>local<span style="color: #339933;">/</span>webserver<span style="color: #339933;">/</span>mysql<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>mysql <span style="color: #339933;">-</span>u root <span style="color: #339933;">-</span>p<br />
通过命令行登录管理MySQL服务器 初始密码为空<br />
<span style="color: #0000dd;">13</span><span style="color: #339933;">,</span>修改root密码<br />
mysql<span style="color: #339933;">&gt;;</span>use mysql <span style="color: #339933;">;</span><br />
mysql<span style="color: #339933;">&gt;;</span> update user set password<span style="color: #339933;">=</span>PASSWORD<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;123456&quot;</span><span style="color: #009900;">&#41;</span> where user<span style="color: #339933;">=</span><span style="color: #ff0000;">'root'</span><span style="color: #339933;">;</span><br />
mysql<span style="color: #339933;">&gt;;</span> FLUSH PRIVILEGES<span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2011/04/08/mysql5-5-11-install-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web编程基础知识-之HTTP状态码复习篇</title>
		<link>http://www.helloyi.cn/index.php/2011/04/04/web-programme-base-http-status-code/</link>
		<comments>http://www.helloyi.cn/index.php/2011/04/04/web-programme-base-http-status-code/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 14:16:51 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[WEB编程]]></category>
		<category><![CDATA[http协议]]></category>
		<category><![CDATA[HTTP状态码]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3339</guid>
		<description><![CDATA[对于从事Web编程人员来说，熟悉了解HTTP协议的状态码是很有必要的，很多时侯可能根据HTTP协议的状态码很快就能定位到错误信息！今天整理复习了一下所有HTTP状态码. HTTP状态码:（HTTP Status Code）是用以表示网页服务器HTTP响应状态的3位数字代码。它由RFC 2616规范定义的，并得到RFC 2518、RFC 2817、RFC 2295、RFC 2774、RFC 4918等规范扩展。所有状态码的第一个数字代表了响应的五种状态之一。（&#8212;&#8212;wikipedia解释) HTTP/1.1定义的状态码值和对应的原因短语（Reason-Phrase）的例子. lXX表示:客户端错误 &#8220;100&#8243; : Continue  客户端应当继续发送请求。这个临时响应是用来通知客户端它的部分请求已经被服务器接收，且仍未被拒绝。客户端应当继续发送请求的剩余部分. &#8220;101&#8243; : witching Protocols 服务器已经理解了客户端的请求，并将通过Upgrade消息头通知客户端采用不同的协议来完成这个请求。在发送完这个响应最后的空行后，服务器将会切换到在Upgrade消息头中定义的那些协议。: 只有在切换新的协议更有好处的时候才应该采取类似措施. &#8220;102&#8243;: Processing  由WebDAV（RFC 2518）扩展的状态码，代表处理将被继续执行。 2XX表示:成功 &#8220;200&#8243; : OK &#8220;201&#8243; : Created 已创建 &#8220;202&#8243; : Accepted 接收 &#8220;203&#8243; : Non-Authoritative Information 非认证信息 &#8220;204&#8243; : No Content 无内容 &#8220;205&#8243; : Reset Content 重置内容 &#8220;206&#8243; : [...]]]></description>
			<content:encoded><![CDATA[<p>对于从事Web编程人员来说，熟悉了解HTTP协议的状态码是很有必要的，很多时侯可能根据HTTP协议的状态码很快就能定位到错误信息！今天整理复习了一下所有HTTP状态码.</p>
<p><strong> HTTP状态码:</strong>（HTTP Status Code）是用以表示<a href="http://zh.wikipedia.org/wiki/%E7%B6%B2%E9%A0%81%E4%BC%BA%E6%9C%8D%E5%99%A8">网页服务器</a><a title="HTTP" href="http://zh.wikipedia.org/wiki/HTTP">HTTP</a>响应状态的3位数字代码。它由<a href="http://tools.ietf.org/html/rfc2616">RFC 2616</a>规范定义的，并得到<a href="http://tools.ietf.org/html/rfc2518">RFC 2518</a>、<a href="http://tools.ietf.org/html/rfc2817">RFC 2817</a>、<a href="http://tools.ietf.org/html/rfc2295">RFC 2295</a>、<a href="http://tools.ietf.org/html/rfc2774">RFC 2774</a>、<a href="http://tools.ietf.org/html/rfc4918">RFC 4918</a>等规范扩展。所有状态码的第一个数字代表了响应的五种状态之一。（&#8212;&#8212;wikipedia解释)<span id="more-3339"></span><br />
HTTP/1.1定义的状态码值和对应的原因短语（Reason-Phrase）的例子.</p>
<p>lXX表示:客户端错误</p>
<p>&#8220;100&#8243; : Continue  客户端应当继续发送请求。这个临时响应是用来通知客户端它的部分请求已经被服务器接收，且仍未被拒绝。客户端应当继续发送请求的剩余部分.</p>
<p>&#8220;101&#8243; : witching Protocols 服务器已经理解了客户端的请求，并将通过Upgrade消息头通知客户端采用不同的协议来完成这个请求。在发送完这个响应最后的空行后，服务器将会切换到在Upgrade消息头中定义的那些协议。: 只有在切换新的协议更有好处的时候才应该采取类似措施.</p>
<p>&#8220;102&#8243;: Processing  由WebDAV（RFC 2518）扩展的状态码，代表处理将被继续执行。</p>
<p>2XX表示:成功</p>
<p>&#8220;200&#8243; : OK</p>
<p>&#8220;201&#8243; : Created 已创建</p>
<p>&#8220;202&#8243; : Accepted 接收</p>
<p>&#8220;203&#8243; : Non-Authoritative Information 非认证信息</p>
<p>&#8220;204&#8243; : No Content 无内容</p>
<p>&#8220;205&#8243; : Reset Content 重置内容</p>
<p>&#8220;206&#8243; : Partial Content 服务器已经成功处理了部分GET请求。类似于<a title="FlashGet" href="http://zh.wikipedia.org/wiki/FlashGet">FlashGet</a>或者<a href="http://zh.wikipedia.org/wiki/%E8%BF%85%E9%9B%B7">迅雷</a>这类的HTTP <a title="Category:下载工具" href="http://zh.wikipedia.org/wiki/Category:%E4%B8%8B%E8%BC%89%E5%B7%A5%E5%85%B7">下载工具</a>都是使用此类响应实现断点续传或者将一个大文档分解为多个下载段同时下载。</p>
<p>&#8220;207&#8243;: Multi-Status<br />
由WebDAV(RFC 2518)扩展的状态码，代表之后的消息体将是一个XML消息，并且可能依照之前子请求数量的不同，包含一系列独立的响应代码.<br />
3XX表示: 重定向</p>
<p>&#8220;300&#8243; : Multiple Choices 多路选择</p>
<p>&#8220;301&#8243; : Moved Permanently  永久转移</p>
<p>&#8220;302&#8243; : Found 暂时转移</p>
<p>&#8220;303&#8243; : See Other 参见其它</p>
<p>&#8220;304&#8243; : Not Modified 未修改</p>
<p>&#8220;305&#8243; : Use Proxy 使用代理</p>
<dl>
<dt>&#8220;306&#8243;: Switch Proxy  在最新版的规范中，306状态码已经不再被使用。</dt>
</dl>
<p>&#8220;307&#8243; : Temporary Redirect 请求的资源现在临时从不同的URI响应请求。由于这样的重定向是临时的，客户端应当继续向原有地址发送以后的请求。只有在Cache-Control或Expires中进行了指定的情况下，这个响应才是可缓存的。</p>
<p>4XX表示: 客户端错误</p>
<p>&#8220;400&#8243; : Bad Request 错误请求</p>
<p>&#8220;401&#8243; : Unauthorized 未认证</p>
<p>&#8220;402&#8243; : Payment Required 需要付费</p>
<p>&#8220;403&#8243; : Forbidden 禁止</p>
<p>&#8220;404&#8243; : Not Found  请求失败，请求所希望得到的资源未被在服务器上发现</p>
<p>&#8220;405&#8243; : Method Not Allowed 方法不允许</p>
<p>&#8220;406&#8243; : Not Acceptable 不接受</p>
<p>&#8220;407&#8243; : Proxy Authentication Required 需要代理认证</p>
<p>&#8220;408&#8243; : Request Time-out 请求超时</p>
<p>&#8220;409&#8243; : Conflict 冲突</p>
<p>&#8220;410&#8243; : Gone 失败</p>
<p>&#8220;411&#8243; : Length Required 需要长度</p>
<p>&#8220;412&#8243; : Precondition Failed 条件失败</p>
<p>&#8220;413&#8243; : Request Entity Too Large 请求实体太大</p>
<p>&#8220;414&#8243; : Request-URI Too Large 请求URI太长</p>
<p>&#8220;415&#8243; : Unsupported Media Type 不支持媒体类型</p>
<p>&#8220;416&#8243; : Requested range not satisfiable 如果请求中包含了Range请求头，并且Range中指定的任何数据范围都与当前资源的可用范围不重合，同时请求中又没有定义If-Range请求头，那么服务器就应当返回416状态码。<br />
&#8220;417&#8243; : Expectation Failed 在请求头Expect中指定的预期内容无法被服务器满足</p>
<p>&#8220;421 &#8220;:There are too many connections from your internet address<br />
从当前客户端所在的IP地址到服务器的连接数超过了服务器许可的最大范围。通常，这里的IP地址指的是从服务器上看到的客户端地址.<br />
&#8220;422&#8243;: Unprocessable Entity<br />
请求格式正确，但是由于含有语义错误，无法响应。（RFC 4918 WebDAV）<br />
&#8220;423&#8243;: Locked<br />
当前资源被锁定。（RFC 4918 WebDAV）<br />
&#8220;424&#8243;: Failed Dependency<br />
由于之前的某个请求发生的错误，导致当前请求失败，例如PROPPATCH。（RFC 4918 WebDAV）<br />
&#8220;425&#8243;: Unordered Collection<br />
在WebDav Advanced Collections草案中定义，但是未出现在《WebDAV顺序集协议》（RFC 3658）中。<br />
&#8220;426&#8243;:Upgrade Required<br />
客户端应当切换到TLS/1.0。（RFC 2817）<br />
&#8220;449&#8243;: Retry With<br />
由微软扩展，代表请求应当在执行完适当的操作后进行重试。</p>
<p>5XX表示: 服务器错误</p>
<p>&#8220;500&#8243; : Internal Server Error  服务器遇到了一个未曾预料的状况，导致了它无法完成对请求的处理。一般来说，这个问题都会在服务器的程序码出错时出现</p>
<p>&#8220;501&#8243; : Not Implemented 未实现</p>
<p>&#8220;502&#8243; : Bad Gateway  作为<a href="http://zh.wikipedia.org/wiki/%E7%BD%91%E5%85%B3">网关</a>或者<a title="代理服务器" href="http://zh.wikipedia.org/wiki/%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8">代理</a>工作的服务器尝试执行请求时，从上游服务器接收到无效的响应</p>
<p>&#8220;503&#8243; : Service Unavailable 由于临时的服务器维护或者<a title="过载" href="http://zh.wikipedia.org/w/index.php?title=%E8%BF%87%E8%BD%BD&amp;action=edit&amp;redlink=1">过载</a>，服务器当前无法处理请求。这个状况是临时的，并且将在一段时间以后恢复。<br />
&#8220;504&#8243; : Gateway Time-out 网关超时</p>
<p>&#8220;505&#8243; : HTTP Version not supported  服务器不支持，或者拒绝支持在请求中使用的HTTP版本。这暗示着服务器不能或不愿使用与客户端相同的版本。响应中应当包含一个描述了为何版本不被支持以及服务器支持哪些协议的实体。</p>
<dl>
<dt>506 Variant Also Negotiates</dt>
<dd>由《透明内容协商协议》（<a href="http://tools.ietf.org/html/rfc2295">RFC 2295</a>）扩展，代表服务器存在内部配置错误：被请求的协商变元资源被配置为在透明内容协商中使用自己，因此在一个协商处理中不是一个合适的重点。</dd>
<dt>507 Insufficient Storage</dt>
<dd>服务器无法存储完成请求所必须的内容。这个状况被认为是临时的。WebDAV（<a href="http://tools.ietf.org/html/rfc4918">RFC 4918</a>）</dd>
<dt>509 Bandwidth Limit Exceeded</dt>
<dd>服务器达到<a href="http://zh.wikipedia.org/wiki/%E5%B8%A6%E5%AE%BD">带宽</a>限制。这不是一个官方的状态码，但是仍被广泛使用。</dd>
<dt>510 Not Extended</dt>
<dd>获取资源所需要的策略并没有没满足。（<a href="http://tools.ietf.org/html/rfc2774">RFC 2774</a>）</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2011/04/04/web-programme-base-http-status-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>博客升级到wordpress3.1</title>
		<link>http://www.helloyi.cn/index.php/2011/03/19/blog-wordpress31/</link>
		<comments>http://www.helloyi.cn/index.php/2011/03/19/blog-wordpress31/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 15:13:35 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[生活随笔]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3332</guid>
		<description><![CDATA[今天抽空把博客从2.8升级到3.1，也正式迈入wordpress3时代.进入后台发现还是增加不少好用的工功能，比如：导航菜单的制定不需要插件就可以很好的完成等等.之后再把模板更换了一下！以后打算把技术文章还是多写点到博客上来.装一装技术牛人. 升级过程中需要注意:最后先备份一份老的代码，然后把所有插件都停用掉，更新完成再去开启自己需要的插件！]]></description>
			<content:encoded><![CDATA[<h3>今天抽空把博客从2.8升级到3.1，也正式迈入wordpress3时代.进入后台发现还是增加不少好用的工功能，比如：导航菜单的制定不需要插件就可以很好的完成等等.之后再把模板更换了一下！以后打算把技术文章还是多写点到博客上来.装一装技术牛人.<br />
升级过程中需要注意:最后先备份一份老的代码，然后把所有插件都停用掉，更新完成再去开启自己需要的插件！</h3>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2011/03/19/blog-wordpress31/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>细说javaScript-document对象</title>
		<link>http://www.helloyi.cn/index.php/2010/11/10/javascript-document-2/</link>
		<comments>http://www.helloyi.cn/index.php/2010/11/10/javascript-document-2/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 12:01:04 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[WEB前端]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3318</guid>
		<description><![CDATA[Document对象内容集合 document 文挡对象 &#8211; JavaScript脚本语言描述 注:页面上元素name属性和JavaScript引用的名称必须一致包括大小写 否则会提示你一个错误信息 “引用的元素为空或者不是对象\\\\\” 对象属性 document.title //设置文档标题等价于HTML的title标签 document.bgColor //设置页面背景色 document.fgColor //设置前景色(文本颜色) document.linkColor //未点击过的链接颜色 document.alinkColor //激活链接(焦点在此链接上)的颜色 document.vlinkColor //已点击过的链接颜色 document.URL //设置URL属性从而在同一窗口打开另一网页 document.fileCreatedDate //文件建立日期，只读属性 document.fileModifiedDate //文件修改日期，只读属性 document.fileSize //文件大小，只读属性 document.cookie //设置和读出cookie document.charset //设置字符集 简体中文:gb2312 ——————————————————————— 常用对象方法 document.write() //动态向页面写入内容 document.createElement(Tag) //创建一个html标签对象 document.getElementById(ID) //获得指定ID值的对象 document.getElementsByName(Name) //获得指定Name值的对象 document.body.appendChild(oTag) ——————————————————————— body-主体子对象 document.body //指定文档主体的开始和结束等价于body&#62;/body&#62; document.body.bgColor //设置或获取对象后面的背景颜色 document.body.link //未点击过的链接颜色 document.body.alink //激活链接(焦点在此链接上)的颜色 [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #0000ff; font-size: large;">Document对象内容集合</span></p>
<div>
<p>document 文挡对象 &#8211; JavaScript脚本语言描述<br />
注:页面上元素name属性和JavaScript引用的名称必须一致包括大小写<br />
否则会提示你一个错误信息 “引用的元素为空或者不是对象\\\\\”</p>
<p><span id="more-3318"></span>对象属性<br />
document.title //设置文档标题等价于HTML的title标签<br />
document.bgColor //设置页面背景色<br />
document.fgColor //设置前景色(文本颜色)<br />
document.linkColor //未点击过的链接颜色<br />
document.alinkColor //激活链接(焦点在此链接上)的颜色<br />
document.vlinkColor //已点击过的链接颜色<br />
document.URL //设置URL属性从而在同一窗口打开另一网页<br />
document.fileCreatedDate //文件建立日期，只读属性<br />
document.fileModifiedDate //文件修改日期，只读属性<br />
document.fileSize //文件大小，只读属性<br />
document.cookie //设置和读出cookie<br />
document.charset //设置字符集 简体中文:gb2312<br />
———————————————————————<br />
常用对象方法<br />
document.write() //动态向页面写入内容<br />
document.createElement(Tag) //创建一个html标签对象<br />
document.getElementById(ID) //获得指定ID值的对象<br />
document.getElementsByName(Name) //获得指定Name值的对象<br />
document.body.appendChild(oTag)<br />
———————————————————————</p>
<p><span id="more-80"> </span></p>
<p>body-主体子对象<br />
document.body //指定文档主体的开始和结束等价于body&gt;/body&gt;<br />
document.body.bgColor //设置或获取对象后面的背景颜色<br />
document.body.link //未点击过的链接颜色<br />
document.body.alink //激活链接(焦点在此链接上)的颜色<br />
document.body.vlink //已点击过的链接颜色<br />
document.body.text //文本色<br />
document.body.innerText //设置body&gt;…/body&gt;之间的文本<br />
document.body.innerHTML //设置body&gt;…/body&gt;之间的HTML代码<br />
document.body.topMargin //页面上边距<br />
document.body.leftMargin //页面左边距<br />
document.body.rightMargin //页面右边距<br />
document.body.bottomMargin //页面下边距<br />
document.body.background //背景图片</p>
<p>document.body.appendChild(oTag) //动态生成一个HTML对象</p>
<p>常用对象事件<br />
document.body.onclick=”func()” //鼠标指针单击对象是触发<br />
document.body.onmouseover=”func()” //鼠标指针移到对象时触发<br />
document.body.onmouseout=”func()” //鼠标指针移出对象时触发<br />
———————————————————————<br />
location-位置子对象</p>
<p>document.location.hash // #号后的部分<br />
document.location.host // 域名+端口号<br />
document.location.hostname // 域名<br />
document.location.href // 完整URL<br />
document.location.pathname // 目录部分<br />
document.location.port // 端口号<br />
document.location.protocol // 网络协议(http:)<br />
document.location.search // ?号后的部分</p>
<p>documeny.location.reload() //刷新网页<br />
document.location.reload(URL) //打开新的网页<br />
document.location.assign(URL) //打开新的网页<br />
document.location.replace(URL) //打开新的网页<br />
———————————————————————<br />
selection-选区子对象<br />
document.selection</p>
<p>images集合(页面中的图象)</p>
<p>a)通过集合引用<br />
document.images //对应页面上的img标签<br />
document.images.length //对应页面上img标签的个数<br />
document.images[0] //第1个img标签<br />
document.images[i] //第i-1个img标签</p>
<p>b)通过nane属性直接引用<br />
img name=”oImage”<br />
document.images.oImage //document.images.name属性</p>
<p>c)引用图片的src属性<br />
document.images.oImage.src //document.images.name属性.src</p>
<p>d)创建一个图象<br />
var oImage<br />
oImage = new Image()<br />
document.images.oImage.src=”1.jpg”<br />
同时在页面上建立一个img /标签与之对应就可以显示</p>
<p>———————————————————————-</p>
<p>forms集合(页面中的表单)</p>
<p>a)通过集合引用<br />
document.forms //对应页面上的form标签<br />
document.forms.length //对应页面上/formform标签的个数<br />
document.forms[0] //第1个/formform标签<br />
document.forms[i] //第i-1个/formform标签<br />
document.forms[i].length //第i-1个/formform中的控件数<br />
document.forms[i].elements[j] //第i-1个/formform中第j-1个控件</p>
<p>b)通过标签name属性直接引用<br />
/formform name=”Myform”&gt;input name=”myctrl”/&gt;/form<br />
document.Myform.myctrl //document.表单名.控件名</p>
<p>c)访问表单的属性<br />
document.forms[i].name //对应form name&gt;属性<br />
document.forms[i].action //对应/formform action&gt;属性<br />
document.forms[i].encoding //对应/formform enctype&gt;属性<br />
document.forms[i].target //对应/formform target&gt;属性</p>
<p>document.forms[i].appendChild(oTag) //动态插入一个控件<br />
document.all.oDiv //引用图层oDiv<br />
document.all.oDiv.style.display=” //图层设置为可视<br />
document.all.oDiv.style.display=”none” //图层设置为隐藏<br />
document.getElementId(”oDiv”) //通过getElementId引用对象<br />
document.getElementId(”oDiv”).style=”<br />
document.getElementId(”oDiv”).display=”none”<br />
/*document.all表示document中所有对象的集合<br />
只有ie支持此属性，因此也用来判断浏览器的种类*/</p>
<p>图层对象的4个属性<br />
document.getElementById(”ID”).innerText //动态输出文本<br />
document.getElementById(”ID”).innerHTML //动态输出HTML<br />
document.getElementById(”ID”).outerText //同innerText<br />
document.getElementById(”ID”).outerHTML //同innerHTML</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2010/11/10/javascript-document-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>android手机上网翻墙利器-EVOVPN</title>
		<link>http://www.helloyi.cn/index.php/2010/11/09/android-evovpn/</link>
		<comments>http://www.helloyi.cn/index.php/2010/11/09/android-evovpn/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 06:20:23 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[酷软推荐]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3314</guid>
		<description><![CDATA[EVOVPN这款软件其实原理非常简单，就是内置了几个可用的VPN服务器，并且调用并封装了Android系统的VPN连接和管理功能，所有操作都在EVOVPN程序主界面完成，使用起来非常方便。程序内置了4个可用的VPN服务器，分别是欧洲，香港，美国东部和西部的服务器。并且默认都提供了免费连接的账户 www.evovpn.com 和密码 evovpn。必须得推荐给广大Android用户共享。 EVOVPN软件安装方法和使用介绍 EVOVPN目前已经在Android Market推出，可以直接在Market搜索evovpn关键字搜索安装。另外EVOVPN网站 www.evovpn.com也提供apk安装文件的下载，最新的软件下载地址是：http://www.evovpn.com/download/android/evovpn_1.0_beta5.apk 目前有中文版的，安装好后只要点击连接即可成功! 接成功后Android手机提醒栏会跳出VPN连接成功的提示，现在就可以无限制的浏览所有网站了，EVOVPN程序连接后列出了twitter,facebook，youtube等常见的在国内访问异常的网站。]]></description>
			<content:encoded><![CDATA[<p style="padding-top: 12px; padding-right: 0px; padding-bottom: 8px; padding-left: 0px; margin: 0px;">EVOVPN这款软件其实原理非常简单，就是内置了几个可用的VPN服务器，并且调用并封装了Android系统的VPN连接和管理功能，所有操作都在EVOVPN程序主界面完成，使用起来非常方便。程序内置了4个可用的VPN服务器，分别是欧洲，香港，美国东部和西部的服务器。并且默认都提供了免费连接的账户 www.evovpn.com 和密码 evovpn。必须得推荐给广大Android用户共享。</p>
<p style="padding-top: 12px; padding-right: 0px; padding-bottom: 8px; padding-left: 0px; margin: 0px;"><span id="more-3314"></span></p>
<p style="padding-top: 12px; padding-right: 0px; padding-bottom: 8px; padding-left: 0px; margin: 0px;"><img class="alignnone size-full wp-image-3315" title="21_101109102425_1_lit" src="http://www.helloyi.cn/wp-content/uploads/2010/11/21_101109102425_1_lit.png" alt="21_101109102425_1_lit" width="280" height="466" /></p>
<ul style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding: 0px; margin: 0px;">
<li style="padding: 0px; margin: 0px;"> <span style="color: #ff0000;"><strong>EVOVPN软件安装方法和使用介绍</strong></span></li>
</ul>
<p style="padding-top: 12px; padding-right: 0px; padding-bottom: 8px; padding-left: 0px; margin: 0px;">EVOVPN目前已经在Android Market推出，可以直接在Market搜索evovpn关键字搜索安装。另外EVOVPN网站 www.evovpn.com也提供apk安装文件的下载，最新的软件下载地址是：http://www.evovpn.com/download/android/evovpn_1.0_beta5.apk</p>
<p style="padding-top: 12px; padding-right: 0px; padding-bottom: 8px; padding-left: 0px; margin: 0px;">目前有中文版的，安装好后只要点击连接即可成功! 接成功后Android手机提醒栏会跳出VPN连接成功的提示，现在就可以无限制的浏览所有网站了，EVOVPN程序连接后列出了twitter,facebook，youtube等常见的在国内访问异常的网站。</p>
<p style="padding-top: 12px; padding-right: 0px; padding-bottom: 8px; padding-left: 0px; margin: 0px;">
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2010/11/09/android-evovpn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Godaddy的域名注册风险分析</title>
		<link>http://www.helloyi.cn/index.php/2010/11/08/godaddy-domain-name-risk/</link>
		<comments>http://www.helloyi.cn/index.php/2010/11/08/godaddy-domain-name-risk/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 11:17:40 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[互联网观察]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3310</guid>
		<description><![CDATA[据南方都市报的报道，国内知名的电影资料库网站时光网被关的原因终于有了答案，时光网关闭据称与涉黄有关，万网的工作人员称，万网是接北京市通信管理局的通知，称时光网“传播色情、淫秽”，因而停止了对该域名的解析，该工作人员还说，该通知并没有明确恢复解析的期限，“如果想恢复，必须找北京市通信管理局或者工信部。” 2010年10月15日，时光网是因为其域名提供商万网停止了对其域名的解析而被迫关闭，其域名状态经查询显示为“ClientHold”（暂停解析），导致时光网至今依旧无法访问。 这里牵涉到一个问题，就是使用国外域名注册商Godaddy进行域名注册能不能规避这种ClientHold风险。我们知道，购买Godaddy上的域名目前的确可以避开国内繁琐域名审核机制，监管者无法通过域名注册商来管理，只能找到网站的主机服务商来管理，这从一定程度上能避免长时间的网站中断，网站管理员可以在短时间内处理需要删除的内容。但有人会担心，Godaddy注册的域名都可以不用备案，这与国家管理域名要求实名制相违背，监管部门会不会为了国内市场不被扰乱和域名实名制的正常运作，屏蔽Godaddy的服务器，阻止Godaddy在国内的发展。 据我看来，这种可能性并不大，Godaddy是全球域名注册排名第一的服务商，全球市场占有率达18%，如果屏蔽了Godaddy，直接导致全球五分之一的网站无法访问，从而引发国内舆论压力，这方面的利害关系相关监管部门不可能不考虑。 另外，根据我的观察，Godaddy的DNS服务器数量非常庞大，如果屏蔽DNS服务器，难免会有漏网，某一个DNS服务器被屏蔽，可以更换为另外一个DNS服务器，更甚至，我们可以设置使用第三方的DNS服务器，例如ZoneEdit、DNSPod等，除非能够使用一种手段，屏蔽所有境外DNS服务器，否则DNS服务器的屏蔽基本上没有什么可行性。 那么屏蔽所有境外服务器是否可行呢？如果这么实行的话，基本上全部的国外网站均无法访问，等于自建了一个局域网，这种可能性极低。 目前，国内各大门户网站，如百度、网易、搜狐等均使用国外的域名服务商进行域名管理，这也说明国外的域名服务器的稳定和可靠性要强于国内，虽然曾经出现过百度域名被黑的案例，但万网也曾经出现过劫持谷歌域名的恶劣先例，说明其安全技术也不过关，整体来讲，国外域名服务商的安全性比国内要好一些，国内商业网站为了规避万网不确定的ClientHold风险，使用国外的域名服务是一种较为稳妥的方案。  转载自月光博客 [ http://www.williamlong.info/ ]]]></description>
			<content:encoded><![CDATA[<div id="artibody">
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; word-break: break-all; padding: 0px;">据南方都市报的报道，国内知名的电影资料库网站<a style="text-decoration: underline; color: #4e0a13;" href="http://www.williamlong.info/blog/archives/573.html" target="_blank">时光网被关</a>的原因终于有了答案，时光网关闭据称与涉黄有关，万网的工作人员称，万网是接北京市通信管理局的通知，称时光网“传播色情、淫秽”，因而停止了对该域名的解析，该工作人员还说，该通知并没有明确恢复解析的期限，“如果想恢复，必须找北京市通信管理局或者工信部。”<span id="more-3310"></span> 2010年10月15日，时光网是因为其域名提供商万网停止了对其域名的解析而被迫关闭，其域名状态经查询显示为“ClientHold”（暂停解析），导致时光网至今依旧无法访问。</p>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; word-break: break-all; padding: 0px;">这里牵涉到一个问题，就是使用国外域名注册商Godaddy进行域名注册能不能规避这种ClientHold风险。我们知道，购买Godaddy上的域名目前的确可以避开国内繁琐域名审核机制，监管者无法通过域名注册商来管理，只能找到网站的主机服务商来管理，这从一定程度上能避免长时间的网站中断，网站管理员可以在短时间内处理需要删除的内容。但有人会担心，Godaddy注册的域名都可以不用备案，这与国家管理域名要求实名制相违背，监管部门会不会为了国内市场不被扰乱和域名实名制的正常运作，屏蔽Godaddy的服务器，阻止Godaddy在国内的发展。</p>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; word-break: break-all; padding: 0px;">据我看来，这种可能性并不大，Godaddy是全球域名注册排名第一的服务商，全球市场占有率达18%，如果屏蔽了Godaddy，直接导致全球五分之一的网站无法访问，从而引发国内舆论压力，这方面的利害关系相关监管部门不可能不考虑。</p>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; word-break: break-all; padding: 0px;">另外，根据我的观察，Godaddy的DNS服务器数量非常庞大，如果屏蔽DNS服务器，难免会有漏网，某一个DNS服务器被屏蔽，可以更换为另外一个DNS服务器，更甚至，我们可以设置使用第三方的DNS服务器，例如ZoneEdit、DNSPod等，除非能够使用一种手段，屏蔽所有境外DNS服务器，否则DNS服务器的屏蔽基本上没有什么可行性。</p>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; word-break: break-all; padding: 0px;">那么屏蔽所有境外服务器是否可行呢？如果这么实行的话，基本上全部的国外网站均无法访问，等于自建了一个局域网，这种可能性极低。</p>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; word-break: break-all; padding: 0px;">目前，国内各大门户网站，如百度、网易、搜狐等均使用国外的域名服务商进行域名管理，这也说明国外的域名服务器的稳定和可靠性要强于国内，虽然曾经出现过<a style="text-decoration: underline; color: #4e0a13;" href="http://www.williamlong.info/archives/2052.html" target="_blank">百度域名被黑</a>的案例，但万网也曾经出现过劫持谷歌域名的<a style="text-decoration: underline; color: #4e0a13;" href="http://www.williamlong.info/archives/542.html" target="_blank">恶劣先例</a>，说明其<a style="text-decoration: underline; color: #4e0a13;" href="http://www.williamlong.info/archives/545.html" target="_blank">安全技术也不过关</a>，整体来讲，国外域名服务商的安全性比国内要好一些，国内商业网站为了规避万网不确定的ClientHold风险，使用国外的域名服务是一种较为稳妥的方案。  转载自<a style="text-decoration: underline; color: #4e0a13;" href="http://www.williamlong.info/">月光博客</a> [ <a style="text-decoration: underline; color: #4e0a13;" href="http://www.williamlong.info/">http://www.williamlong.info/</a> ]</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2010/11/08/godaddy-domain-name-risk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>常用的PHP正则表达式收集整理</title>
		<link>http://www.helloyi.cn/index.php/2010/10/14/common-php-preg/</link>
		<comments>http://www.helloyi.cn/index.php/2010/10/14/common-php-preg/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 02:25:50 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[WEB编程]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3306</guid>
		<description><![CDATA[$str = preg_replace(&#8220;/(&#60;a.*?&#62;)(.*?)(&#60;\/a&#62;)/&#8221;, &#8216;\1&#60;span&#62;\2&#60;/span&#62;\3&#8242;, $str); 其中用了三个子模式（每个圆括号中内容为一个子模式），第一个是链接开始标签，第二个是链接文本，第三个是&#60;/a&#62; 然后第二个参数中\1、\2、\3就表示这三个部分，要替换成什么样子还不简单？ 获取页面中的所有链接地址的PHP函数 下面这个用PHP写的函数,可以获取任意的字符串$string中的所有链接地址($string可以是从一个HTML页面文件直接读取出来的字符串),结果保存在一个数组中返回.该函数自动把电子邮件地址排除在外,而且返回的数组中不会有重复元素. 复制代码 代码如下: function GetAllLink($string) { $string = str_replace(&#8220;\r&#8221;,&#8221;",$string); $string = str_replace(&#8220;\n&#8221;,&#8221;",$string); $regex[url] = &#8220;((http&#124;https&#124;ftp&#124;telnet&#124;news):\/\/)?([a-z0-9_\-\/\.]+\.[][a-z0-9:;&#38;#@=_~%\?\/\.\,\+\-]+)&#8221;; $regex[email] = &#8220;([a-z0-9_\-]+)@([a-z0-9_\-]+\.[a-z0-9\-\._\-]+)&#8221;; //去掉标签之间的文字 $string = eregi_replace(&#8220;&#62;[^&#60;&#62;]+&#60;&#8221;,&#8221;&#62;&#60;&#8221;, $string); //去掉JAVASCRIPT代码 $string = eregi_replace(&#8220;&#60;!&#8211;.*//&#8211;&#62;&#8221;,&#8221;", $string); //去掉非&#60;a&#62;的HTML标签 $string = eregi_replace(&#8220;&#60;[^a][^&#60;&#62;]*&#62;&#8221;,&#8221;", $string); //去掉EMAIL链接 $string = eregi_replace(&#8220;&#60;a([ ]+)href=([\"']*)mailto:($regex[email])([\"']*)[^&#62;]*&#62;&#8221;,&#8221;", $string); //替换需要的网页链接 $string = eregi_replace(&#8220;&#60;a([ ]+)href=([\"']*)($regex[url])([\"']*)[^&#62;]*&#62;&#8221;,&#8221;\\3\t&#8221;, $string); $output[0] = [...]]]></description>
			<content:encoded><![CDATA[<p>$str = preg_replace(&#8220;/(&lt;a.*?&gt;)(.*?)(&lt;\/a&gt;)/&#8221;, &#8216;\1&lt;span&gt;\2&lt;/span&gt;\3&#8242;, $str);<br />
其中用了三个子模式（每个圆括号中内容为一个子模式），第一个是链接开始标签，第二个是链接文本，第三个是&lt;/a&gt;</p>
<p>然后第二个参数中\1、\2、\3就表示这三个部分，要替换成什么样子还不简单？</p>
<p><span id="more-3306"></span></p>
<p>获取页面中的所有链接地址的PHP函数</p>
<p>下面这个用PHP写的函数,可以获取任意的字符串$string中的所有链接地址($string可以是从一个HTML页面文件直接读取出来的字符串),结果保存在一个数组中返回.该函数自动把电子邮件地址排除在外,而且返回的数组中不会有重复元素.</p>
<p>复制代码 代码如下:<br />
function GetAllLink($string)<br />
{<br />
$string = str_replace(&#8220;\r&#8221;,&#8221;",$string);<br />
$string = str_replace(&#8220;\n&#8221;,&#8221;",$string);</p>
<p>$regex[url] = &#8220;((http|https|ftp|telnet|news):\/\/)?([a-z0-9_\-\/\.]+\.[][a-z0-9:;&amp;#@=_~%\?\/\.\,\+\-]+)&#8221;;<br />
$regex[email] = &#8220;([a-z0-9_\-]+)@([a-z0-9_\-]+\.[a-z0-9\-\._\-]+)&#8221;;</p>
<p>//去掉标签之间的文字<br />
$string = eregi_replace(&#8220;&gt;[^&lt;&gt;]+&lt;&#8221;,&#8221;&gt;&lt;&#8221;, $string);</p>
<p>//去掉JAVASCRIPT代码<br />
$string = eregi_replace(&#8220;&lt;!&#8211;.*//&#8211;&gt;&#8221;,&#8221;", $string);</p>
<p>//去掉非&lt;a&gt;的HTML标签<br />
$string = eregi_replace(&#8220;&lt;[^a][^&lt;&gt;]*&gt;&#8221;,&#8221;", $string);</p>
<p>//去掉EMAIL链接<br />
$string = eregi_replace(&#8220;&lt;a([ ]+)href=([\"']*)mailto:($regex[email])([\"']*)[^&gt;]*&gt;&#8221;,&#8221;", $string);</p>
<p>//替换需要的网页链接<br />
$string = eregi_replace(&#8220;&lt;a([ ]+)href=([\"']*)($regex[url])([\"']*)[^&gt;]*&gt;&#8221;,&#8221;\\3\t&#8221;, $string);</p>
<p>$output[0] = strtok($string, &#8220;\t&#8221;);<br />
while(($temp = strtok(&#8220;\t&#8221;)))<br />
{<br />
if($temp &amp;&amp; !in_array($temp, $output))<br />
$output[++$i] = $temp;<br />
}</p>
<p>return $output;<br />
}</p>
<p>以下是以PHP的语法所写的示例<br />
验证字符串是否只含数字与英文，字符串长度并在4~16个字符之间<br />
复制代码 代码如下:<br />
&lt;?php<br />
$str = &#8216;a1234&#8242;;<br />
if (preg_match(&#8220;^[a-zA-Z0-9]{4,16}$&#8221;, $str)) {<br />
echo &#8220;验证成功&#8221;;} else {<br />
echo &#8220;验证失敗&#8221;;}?&gt;</p>
<p>简易的台湾身分证字号验证<br />
复制代码 代码如下:<br />
&lt;?php<br />
$str = &#8216;a1234&#8242;;<br />
if (preg_match(&#8220;^(?:\d{15}|\d{18})$&#8221;, $str)) {<br />
echo &#8220;验证成功&#8221;;<br />
} else {<br />
echo &#8220;验证失敗&#8221;;}<br />
?&gt;</p>
<p>下面的代码实现文字中的代码块，功能就如你在脚本之家看到的代码一样。<br />
复制代码 代码如下:<br />
function codedisp($code) {<br />
global $discuzcodes;<br />
$discuzcodes['pcodecount']++;<br />
$code = htmlspecialchars(str_replace(&#8216;\\&#8221;&#8216;, &#8216;&#8221;&#8216;, preg_replace(&#8220;/^[\n\r]*(.+?)[\n\r]*$/is&#8221;, &#8220;\\1&#8243;, $code)));<br />
$discuzcodes['codehtml'][$discuzcodes['pcodecount']] = &#8220;&lt;br&gt;&lt;div class=\&#8221;msgheader\&#8221;&gt;&lt;div class=\&#8221;right\&#8221;&gt;&lt;a href=\&#8221;###\&#8221; class=\&#8221;smalltxt\&#8221; onclick=\&#8221;copycode($(&#8216;phpcode$discuzcodes[codecount]&#8216;));\&#8221;&gt;[复制此代码]&lt;/a&gt;&lt;/div&gt;代码如下:&lt;/div&gt;&lt;div class=\&#8221;msgborder\&#8221; id=\&#8221;phpcode$discuzcodes[codecount]\&#8221;&gt;&#8221;.fhtml2($code).&#8221;&lt;/div&gt;&lt;br&gt;&#8221;;<br />
$discuzcodes['codecount']++;<br />
return &#8220;[\tDISCUZ_CODE_$discuzcodes[pcodecount]\t]&#8221;;<br />
}<br />
$message = preg_replace(&#8220;/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);<br />
$message = preg_replace("/\s*\[html\](.+?)\[\/html\]\s*/ies", "htmldisp('\\1')", $message);</p>
<p>匹配中文字符的正则表达式： [\u4e00-\u9fa5]<br />
评注：匹配中文还真是个头疼的事，有了这个表达式就好办了<br />
匹配双字节字符(包括汉字在内)：[^\x00-\xff]<br />
评注：可以用来计算字符串的长度（一个双字节字符长度计2，ASCII字符计1）<br />
匹配空白行的正则表达式：\n\s*\r<br />
评注：可以用来删除空白行<br />
匹配HTML标记的正则表达式：&lt;(\S*?)[^&gt;]*&gt;.*?&lt;/\1&gt;|&lt;.*? /&gt;<br />
评注：网上流传的版本太糟糕，上面这个也仅仅能匹配部分，对于复杂的嵌套标记依旧无能为力<br />
匹配首尾空白字符的正则表达式：^\s*|\s*$<br />
评注：可以用来删除行首行尾的空白字符(包括空格、制表符、换页符等等)，非常有用的表达式<br />
匹配Email地址的正则表达式：\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*<br />
评注：表单验证时很实用<br />
匹配网址URL的正则表达式：[a-zA-z]+://[^\s]*<br />
评注：网上流传的版本功能很有限，上面这个基本可以满足需求<br />
匹配帐号是否合法(字母开头，允许5-16字节，允许字母数字下划线)：^[a-zA-Z][a-zA-Z0-9_]{4,15}$<br />
评注：表单验证时很实用<br />
匹配国内电话号码：\d{3}-\d{8}|\d{4}-\d{7}<br />
评注：匹配形式如 0511-4405222 或 021-87888822<br />
匹配腾讯QQ号：[1-9][0-9]{4,}<br />
评注：腾讯QQ号从10000开始<br />
匹配中国邮政编码：[1-9]\d{5}(?!\d)<br />
评注：中国邮政编码为6位数字<br />
匹配身份证：\d{15}|\d{18}<br />
评注：中国的身份证为15位或18位<br />
匹配ip地址：\d+\.\d+\.\d+\.\d+<br />
评注：提取ip地址时有用<br />
匹配特定数字：<br />
^[1-9]\d*$　 　 //匹配正整数<br />
^-[1-9]\d*$ 　 //匹配负整数<br />
^-?[1-9]\d*$　　 //匹配整数<br />
^[1-9]\d*|0$　 //匹配非负整数（正整数 + 0）<br />
^-[1-9]\d*|0$　　 //匹配非正整数（负整数 + 0）<br />
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$　　 //匹配正浮点数<br />
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$　 //匹配负浮点数<br />
^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$　 //匹配浮点数<br />
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$　　 //匹配非负浮点数（正浮点数 + 0）<br />
^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$　　//匹配非正浮点数（负浮点数 + 0）<br />
评注：处理大量数据时有用，具体应用时注意修正<br />
匹配特定字符串：<br />
^[A-Za-z]+$　　//匹配由26个英文字母组成的字符串<br />
^[A-Z]+$　　//匹配由26个英文字母的大写组成的字符串<br />
^[a-z]+$　　//匹配由26个英文字母的小写组成的字符串<br />
^[A-Za-z0-9]+$　　//匹配由数字和26个英文字母组成的字符串<br />
^\w+$　　//匹配由数字、26个英文字母或者下划线组成的字符串</p>
<p>下面是一些特殊字符：<br />
正则表达式中的特殊字符： （学习参考书－＜＜精通正则表达式＞＞）<br />
字符<br />
意义：对于字符，通常表示按字面意义，指出接着的字符为特殊字符，不作解释。<br />
例如：/b/匹配字符'b',通过在b 前面加一个反斜杠，也就是/b/，则该字符变成特殊字符，表示<br />
匹配一个单词的分界线。<br />
或者：<br />
对于几个字符，通常说明是特殊的，指出紧接着的字符不是特殊的，而应该按字面解释。<br />
例如：*是一个特殊字符，匹配任意个字符(包括0个字符)；例如：/a*/意味匹配0个或多个a。<br />
为了匹配字面上的*，在a前面加一个反斜杠；例如：/a*/匹配'a*'。</p>
<p>字符^<br />
意义：表示匹配的字符必须在最前边。<br />
例如：/^A/不匹配"an A,"中的'A'，但匹配"An A."中最前面的'A'。</p>
<p>字符$<br />
意义：与^类似，匹配最末的字符。<br />
例如：/t$/不匹配"eater"中的't'，但匹配"eat"中的't'。</p>
<p>字符*<br />
意义：匹配*前面的字符0次或n次。<br />
例如:/bo*/匹配"A ghost booooed"中的'boooo'或"A bird warbled"中的'b'，但不匹配"A goat g<br />
runted"中的任何字符。</p>
<p>字符+<br />
意义：匹配+号前面的字符1次或n次。等价于{1,}。<br />
例如：/a+/匹配"candy"中的'a'和"caaaaaaandy."中的所有'a'。</p>
<p>字符?<br />
意义：匹配?前面的字符0次或1次。<br />
例如：/e?le?/匹配"angel"中的'el'和"angle."中的'le'。</p>
<p>字符.<br />
意义：(小数点)匹配除换行符外的所有单个的字符。<br />
例如：/.n/匹配"nay, an apple is on the tree"中的'an'和'on'，但不匹配'nay'。</p>
<p>字符(x)<br />
意义：匹配'x'并记录匹配的值。<br />
例如：/(foo)/匹配和记录"foo bar."中的'foo'。匹配子串能被结果数组中的素[1], ..., [n] 返<br />
回，或被RegExp对象的属性$1, ..., $9返回。</p>
<p>字符x|y<br />
意义：匹配'x'或者'y'。<br />
例如：/green|red/匹配"green apple"中的'green'和"red apple."中的'red'。</p>
<p>字符{n}<br />
意义：这里的n是一个正整数。匹配前面的n个字符。<br />
例如：/a{2}/不匹配"candy,"中的'a'，但匹配"caandy," 中的所有'a'和"caaandy."中前面的两个<br />
'a'。</p>
<p>字符{n,}<br />
意义：这里的n是一个正整数。匹配至少n个前面的字符。<br />
例如：/a{2,}不匹配"candy"中的'a'，但匹配"caandy"中的所有'a'和"caaaaaaandy."中的所有'a'</p>
<p>字符{n,m}<br />
意义：这里的n和m都是正整数。匹配至少n个最多m个前面的字符。<br />
例如：/a{1,3}/不匹配"cndy"中的任何字符，但匹配 "candy,"中的'a'，"caandy," 中的前面两个<br />
'a'和"caaaaaaandy"中前面的三个'a'，注意：即使"caaaaaaandy" 中有很多个'a'，但只匹配前面的三<br />
个'a'即"aaa"。</p>
<p>字符[xyz]<br />
意义：一字符列表，匹配列出中的任一字符。你可以通过连字符-指出一个字符范围。<br />
例如：[abcd]跟[a-c]一样。它们匹配"brisket"中的'b'和"ache"中的'c'。</p>
<p>字符[^xyz]<br />
意义：一字符补集，也就是说，它匹配除了列出的字符外的所有东西。 你可以使用连字符-指出一<br />
字符范围。<br />
例如：[^abc]和[^a-c]等价，它们最早匹配"brisket"中的'r'和"chop."中的'h'。</p>
<p>字符<br />
意义：匹配一个空格(不要与b混淆)</p>
<p>字符b<br />
意义：匹配一个单词的分界线，比如一个空格(不要与混淆)<br />
例如：/bnw/匹配"noonday"中的'no'，/wyb/匹配"possibly yesterday."中的'ly'。</p>
<p>字符B<br />
意义：匹配一个单词的非分界线<br />
例如：/wBn/匹配"noonday"中的'on'，/yBw/匹配"possibly yesterday."中的'ye'。</p>
<p>字符cX<br />
意义：这里的X是一个控制字符。匹配一个字符串的控制字符。<br />
例如：/cM/匹配一个字符串中的control-M。</p>
<p>字符d<br />
意义：匹配一个数字，等价于[0-9]。<br />
例如：/d/或/[0-9]/匹配"B2 is the suite number."中的'2'。</p>
<p>字符D<br />
意义：匹配任何的非数字，等价于[^0-9]。<br />
例如：/D/或/[^0-9]/匹配"B2 is the suite number."中的'B'。</p>
<p>字符f<br />
意义：匹配一个表单符</p>
<p>字符n<br />
意义：匹配一个换行符</p>
<p>字符r<br />
意义：匹配一个回车符</p>
<p>字符s<br />
意义：匹配一个单个white空格符，包括空格，tab，form feed，换行符，等价于[ fnrtv]。<br />
例如：/sw*/匹配"foo bar."中的' bar'。</p>
<p>字符S<br />
意义：匹配除white空格符以外的一个单个的字符，等价于[^ fnrtv]。<br />
例如：/S/w*匹配"foo bar."中的'foo'。</p>
<p>字符t<br />
意义：匹配一个制表符</p>
<p>字符v<br />
意义：匹配一个顶头制表符</p>
<p>字符w<br />
意义：匹配所有的数字和字母以及下划线，等价于[A-Za-z0-9_]。<br />
例如：/w/匹配"apple,"中的'a'，"$5.28,"中的'5'和"3D."中的'3'。</p>
<p>字符W<br />
意义：匹配除数字、字母外及下划线外的其它字符，等价于[^A-Za-z0-9_]。<br />
例如：/W/或者/[^$A-Za-z0-9_]/匹配"50%."中的'%'。</p>
<p>字符n<br />
意义：这里的n是一个正整数。匹配一个正则表达式的最后一个子串的n的值(计数左圆括号)。</p>
<p>例如：/apple(,)sorange1/匹配"apple, orange, cherry, peach."中的'apple, orange'，下面<br />
有一个更加完整的例子。<br />
注意：如果左圆括号中的数字比n指定的数字还小，则n取下一行的八进制escape作为描述。</p>
<p>字符ooctal和xhex<br />
意义：这里的ooctal是一个八进制的escape值，而xhex是一个十六进制的escape值，允许在一个正则表达式中嵌入ASCII码。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2010/10/14/common-php-preg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LNMP一键安装包 0.5 正式发布</title>
		<link>http://www.helloyi.cn/index.php/2010/10/11/lnmp-0-5/</link>
		<comments>http://www.helloyi.cn/index.php/2010/10/11/lnmp-0-5/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 02:05:18 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[linux系统]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3302</guid>
		<description><![CDATA[LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RadHat、Debian VPS(VDS)或独立主机安装LNMP(Nginx、MySQL、PHP、phpMyAdmin)生产环境的Shell程序。主要针对LNMP安装脚本进行了优化，减少因为环境差异引起的安装错误，其次对Nginx、PHP、MySQL等主要程序进行了版本升级。同时优化了eAccelerator和增加ionCube安装程序，Zend Optimizer、eAccelerator和、ionCube可以完美共存。LNMP一键安装包 0.5已经在DiaHosting、BuyVM、Linode等几家美国VPS的CentOS、Debian的32位和64位系统上测试通过。 安装方法：http://lnmp.org/install.html LNMP相关软件版本： Nginx 0.7.67 MySQL 5.1.48 PHP 5.2.14 PHPMyAdmin 3.3.7 其他更新： 1、为安全将Nginx日志移动到/home/wwwlogs/下面； 2、更改32位64位判别方式； 3、增加系统时间调整，防止时间错误造成编译出错； 4、优化eAccelerator安装程序； 5、增加ionCube安装程序； LNMP相关目录： mysql :   /usr/local/mysql php :     /usr/local/php nginx :   /usr/local/nginx 网站目录 :     /home/wwwroot/ 技术支持： LNMP官网：http://www.lnmp.org/ 作者技术支持邮箱：www@lnmp.org 技术支持论坛：http://bbs.vpser.net/forum-25-1.html （注册需注明：LNMP，人工审核，请尽量通过论坛反馈，以便其他用户参考。）]]></description>
			<content:encoded><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RadHat、Debian VPS(VDS)或独立主机安装LNMP(Nginx、MySQL、PHP、phpMyAdmin)生产环境的Shell程序。主要针对LNMP安装脚本进行了优化，减少因为环境差异引起的安装错误，其次对Nginx、PHP、MySQL等主要程序进行了版本升级。同时优化了eAccelerator和增加ionCube安装程序，Zend Optimizer、eAccelerator和、ionCube可以完美共存。<span id="more-3302"></span>LNMP一键安装包 0.5已经在<a href="http://www.vpser.net/go/diahosting" target="_blank">DiaHosting</a>、<a href="http://www.vpser.net/go/buyvm" target="_blank">BuyVM</a>、<a href="http://www.vpser.net/go/linode" target="_blank">Linode</a>等几家美国VPS的CentOS、Debian的32位和64位系统上测试通过。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">安装方法：<a href="http://lnmp.org/install.html" target="_blank">http://lnmp.org/install.html</a></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">LNMP相关软件版本：</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">Nginx 0.7.67<br />
MySQL 5.1.48<br />
PHP 5.2.14<br />
PHPMyAdmin 3.3.7</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">其他更新：<br />
1、为安全将Nginx日志移动到/home/wwwlogs/下面；<br />
2、更改32位64位判别方式；<br />
3、增加系统时间调整，防止时间错误造成编译出错；<br />
4、优化eAccelerator安装程序；<br />
5、增加ionCube安装程序；</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">LNMP相关目录：<br />
mysql :   /usr/local/mysql<br />
php :     /usr/local/php<br />
nginx :   /usr/local/nginx<br />
网站目录 :     /home/wwwroot/
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">技术支持：</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">LNMP官网：<a href="http://www.lnmp.org/" target="_blank">http://www.lnmp.org/</a><br />
作者技术支持邮箱：<a href="mailto:www@lnmp.org">www@lnmp.org</a><br />
技术支持论坛：<a href="http://bbs.vpser.net/forum-25-1.html" target="_blank">http://bbs.vpser.net/forum-25-1.html</a> （注册需注明：LNMP，人工审核，请尽量通过论坛反馈，以便其他用户参考。）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2010/10/11/lnmp-0-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>键值数据库redis安装和使用</title>
		<link>http://www.helloyi.cn/index.php/2010/10/08/redis-make/</link>
		<comments>http://www.helloyi.cn/index.php/2010/10/08/redis-make/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 08:10:50 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[数据库应用]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3298</guid>
		<description><![CDATA[redis是一个带存储功能的键值数据库,其代表主要有MemcacheDB，Tokyo Cabinet,mongodb等等.2.0中一些主要的新功能： MULTI/EXEC: 支持原子性的支持多条语句，但注意，这和我们传统意义上的事物操作还是有差别的。 Publish/Subscribe: Pub相当于发布消息，Sub相当于订阅消息，在微博客如此盛行的今天，相信这一功能不会太难理解。 Hashes (or dicts): Redis又支持了一种新的数据类型，其内存使用效率更高。 Virtual Memory: 虚拟内存。在Redis2.0之前，所有数据都是存在内存中的，而按时间条件进行的定时dump到磁盘的操作，也仅仅是个备份作用。而2.0中的虚拟内存，使得你可以自由分配Redis可耗用的内存，当数据超出指定内存限制时，不常用数据会被交换到磁盘。 下载地址：http://redis.googlecode.com/files/redis-2.0.0.tar.gz这里有篇国外的人对redis,memcached,tokyo tyrant等做的对测试：http://www.ruturaj.net/redis-memcached-tokyo-tyrant-mysql-comparison可以看出redis的性测非常出色。另外redis的数据类似也非常出色，比memcached丰富很多。官方站点为：http://redis.googlecode.com/ 下面安装是以1.2版本为例进行： 安装：wget http://redis.googlecode.com/files/redis-1.2.1.tar.gztar -xvzf redis-1.2.1.tar.gzcd redis-1.2.1make不要想make install，他们还没做，呵呵。cp redis-cli redis-benchmark redis-server /usr/bincp redis.conf /etc/数据库文件保存在 /var/lib/redis：mkdir /var/lib/redisvi /etc/redis.confdaemonize yespidfile /var/run/redis.pidport 6379timeout 300loglevel debuglogfile /var/log/redis.logdatabases 16save 900 1save 300 10save 60 10000rdbcompression yesdbfilename dump.rdbdir /var/lib/redisappendonly yesappendfsync alwaysglueoutputbuf yesshareobjects noshareobjectspoolsize 1024save 900 1save 300 10save 60 [...]]]></description>
			<content:encoded><![CDATA[<p>redis是一个带存储功能的键值数据库,其代表主要有<a style="color: #000000; line-height: normal;" href="http://memcachedb.org/" target="_blank">MemcacheDB</a>，<a style="color: #000000; line-height: normal;" href="http://tokyocabinet.sourceforge.net/" target="_blank">Tokyo Cabinet</a>,mongodb等等.2.0中一些主要的新功能： MULTI/EXEC: 支持原子性的支持多条语句，但注意，这和我们传统意义上的事物操作还是有差别的。 Publish/Subscribe: Pub相当于发布消息，Sub相当于订阅消息，在微博客如此盛行的今天，相信这一功能不会太难理解。</p>
<p><span id="more-3298"></span>Hashes (or dicts): Redis又支持了一种新的数据类型，其内存使用效率更高。</p>
<p>Virtual Memory: 虚拟内存。在Redis2.0之前，所有数据都是存在内存中的，而按时间条件进行的定时dump到磁盘的操作，也仅仅是个备份作用。而2.0中的虚拟内存，使得你可以自由分配Redis可耗用的内存，当数据超出指定内存限制时，不常用数据会被交换到磁盘。</p>
<p>下载地址：http://redis.googlecode.com/files/redis-2.0.0.tar.gz<br style="line-height: normal;" /><br style="line-height: normal;" />这里有篇国外的人对redis,memcached,tokyo tyrant等做的对测试：<br style="line-height: normal;" /><a style="color: #99d100; text-decoration: underline; line-height: normal;" href="http://www.ruturaj.net/redis-memcached-tokyo-tyrant-mysql-comparison" target="_blank">http://www.ruturaj.net/redis-memcached-tokyo-tyrant-mysql-comparison</a><br style="line-height: normal;" /><br style="line-height: normal;" />可以看出redis的性测非常出色。<br style="line-height: normal;" /><br style="line-height: normal;" />另外redis的数据类似也非常出色，比memcached丰富很多。<br style="line-height: normal;" /><br style="line-height: normal;" />官方站点为：http://redis.googlecode.com/</p>
<p>下面安装是以1.2版本为例进行：</p>
<p>安装：wget http://redis.googlecode.com/files/redis-1.2.1.tar.gz<br style="line-height: normal;" /><br style="line-height: normal;" />tar -xvzf redis-1.2.1.tar.gz<br style="line-height: normal;" /><br style="line-height: normal;" />cd redis-1.2.1<br style="line-height: normal;" /><br style="line-height: normal;" />make<br style="line-height: normal;" /><br style="line-height: normal;" />不要想make install，他们还没做，呵呵。<br style="line-height: normal;" /><br style="line-height: normal;" />cp redis-cli redis-benchmark redis-server /usr/bin<br style="line-height: normal;" />cp redis.conf /etc/<br style="line-height: normal;" /><br style="line-height: normal;" />数据库文件保存在 /var/lib/redis：<br style="line-height: normal;" />mkdir /var/lib/redis<br style="line-height: normal;" /><br style="line-height: normal;" />vi /etc/redis.conf<br style="line-height: normal;" />daemonize yes<br style="line-height: normal;" />pidfile /var/run/redis.pid<br style="line-height: normal;" />port 6379<br style="line-height: normal;" />timeout 300<br style="line-height: normal;" />loglevel debug<br style="line-height: normal;" />logfile /var/log/redis.log<br style="line-height: normal;" />databases 16<br style="line-height: normal;" />save 900 1<br style="line-height: normal;" />save 300 10<br style="line-height: normal;" />save 60 10000<br style="line-height: normal;" />rdbcompression yes<br style="line-height: normal;" />dbfilename dump.rdb<br style="line-height: normal;" />dir /var/lib/redis<br style="line-height: normal;" />appendonly yes<br style="line-height: normal;" />appendfsync always<br style="line-height: normal;" />glueoutputbuf yes<br style="line-height: normal;" />shareobjects no<br style="line-height: normal;" />shareobjectspoolsize 1024<br style="line-height: normal;" /><br style="line-height: normal;" /><br style="line-height: normal;" />save 900 1<br style="line-height: normal;" />save 300 10<br style="line-height: normal;" />save 60 10000<br style="line-height: normal;" /><br style="line-height: normal;" />这里的意思是900秒内有1个改变，300秒内有10个改变，60秒内有10000个改变，redis就会内存中的key保存到数据库文件中去。<br style="line-height: normal;" /><br style="line-height: normal;" />开机启动：<br style="line-height: normal;" />vi /etc/rc.local <br style="line-height: normal;" /><br style="line-height: normal;" />/usr/bin/redis-server /etc/redis.conf<br style="line-height: normal;" /><br style="line-height: normal;" />测试：<br style="line-height: normal;" /><br style="line-height: normal;" />新建一个key<br style="line-height: normal;" />[root@mysqltest ~]# redis-cli set testkey keyv<br style="line-height: normal;" />OK<br style="line-height: normal;" /><br style="line-height: normal;" />取一个key<br style="line-height: normal;" />[root@mysqltest ~]# redis-cli get testkey<br style="line-height: normal;" />keyv<br style="line-height: normal;" />查看redis内的所有key<br style="line-height: normal;" />[root@mysqltest ~]# redis-cli keys \*         <br style="line-height: normal;" />testkey<br style="line-height: normal;" />查看redis状态<br style="line-height: normal;" />[root@mysqltest ~]# redis-cli info<br style="line-height: normal;" />redis_version:1.2.1<br style="line-height: normal;" />arch_bits:64<br style="line-height: normal;" />multiplexing_api:epoll<br style="line-height: normal;" />uptime_in_seconds:144<br style="line-height: normal;" />uptime_in_days:0<br style="line-height: normal;" />connected_clients:1<br style="line-height: normal;" />connected_slaves:0<br style="line-height: normal;" />used_memory:619250<br style="line-height: normal;" />changes_since_last_save:1<br style="line-height: normal;" />bgsave_in_progress:0<br style="line-height: normal;" />last_save_time:1265165103<br style="line-height: normal;" />bgrewriteaof_in_progress:0<br style="line-height: normal;" />total_connections_received:5<br style="line-height: normal;" />total_commands_processed:4<br style="line-height: normal;" />role:master<br style="line-height: normal;" />db0:keys=1,expires=0</p>
<p>redis命令中文手册</p>
<p>DEL :删除某个key,或是一系列key;DEL key1 key2 key3 key4</p>
<p>TYPE : 返回某个key元素的数据类型 ( none:不存在,string:字符,list,set,zset,hash)</p>
<p>KEYS : 返回匹配的key列表 (KEYS foo*:查找foo开头的keys)</p>
<p>RANDOMKEY : 随机获得已经存在的key</p>
<p>RENAME : 更改key的名字，如果名字存在则更改失败</p>
<p>DBSIZE : 返回当前数据库的key的总数</p>
<p>EXPIRE : 设置某个key的过期时间（秒）,(EXPIRE bruce 1000：设置bruce这个key1000秒后系统自动删除)</p>
<p>TTL : 查找某个key还有多长时间过期,返回时间秒</p>
<p>SELECT : 选择数据库</p>
<p>MOVE : 把key从一个数据库转移到另外一个库</p>
<p>FLUSHDB : 清空当前数据库数据</p>
<p>FLUSHALL :清空所有数据库数据</p>
<p>SET 存一个数据到数据库 SET keyname datalength data (SET bruce 10 paitoubing:保存key为burce,字符串长度为10的一个字符串paitoubing到数据库)</p>
<p>GET :获取某个key 的value值</p>
<p>GETSET GETSET可以理解成获得的key的值然后SET这个值，更加方便的操作 (SET bruce 10 paitoubing,这个时候需要修改bruce变成1234567890并获取这个</p>
<p>以前的数据paitoubing,GETSET bruce 10 1234567890)</p>
<p>MGET 一次性获得多个key的数据 (MGET uid:1:name uid:1:email uid:1:ciy)</p>
<p>SETNX SETNX与SET的区别是SET可以创建与更新key的value，而SETNX是如果key不存在，则创建key与value数据</p>
<p>SETEX SETEX = SET + EXPIRE,貌似我的这个版本没有办法测试</p>
<p>MSET 一次性设置多个参数的值(MSET uid:1:name shjuto uid:1:email shjuto@gmail.com uid:1:city 8 回车 nanchang)最后一个值需要回车输入，和SET一样，不知为啥。</p>
<p>MSETNX 如果设置的key不存在的话,或是叫做新key的话；一次性设置多个参数的值(MSET uid:1:name shjuto uid:1:email shjuto@gmail.com uid:1:city 8</p>
<p>回车 nanchang)最后一个值需要回车输入，和SET一样，不知为啥。</p>
<p>INCR 自增，有点类是mysql incr.(INCR global:uid)</p>
<p>INCRBY 自增 +length ,(INCRBY uid 5)原来的基础+5=result</p>
<p>DECR 自减</p>
<p>* DECRBY 自减 -lenght</p>
<p>LISTS （无索引序列,head位置是0,……）</p>
<p># RPUSH 追加数据到系列的尾部 (RPUSH listtest 10 \n 1111111122)</p>
<p># LPUSH 追加数据到序列的头部 (LPUSH listtest 10 \n 2222222222)</p>
<p># LLEN 一个序列的长度；（LLEN listtest）</p>
<p># LRANGE 从自定的范围内返回序列的元素 (LRANGE testlist 0 2;返回序列testlist前0 1 2元素)</p>
<p># LTRIM 修剪某个范围之外的数据 (LTRIM testlist 0 2;保留0 1 2元素，其余的删除)</p>
<p># LINDEX 返回某个位置的序列值(LINDEX testlist 0;返回序列testlist位置为零的元素)</p>
<p># LSET 更新某个位置元素的值 (LSET testlist 0 5 \n 55555;)</p>
<p># LPOP key Return and remove (atomically) the first element of the List at key</p>
<p># RPOP key Return and remove (atomically) the last element of the List at key</p>
<p># LREM 根据值删除序列元素 (LREM testlist 0 5 \n 33333;删除序列中所有的等于33333的元素,为何不是REMOVE BY KEY?不知道何故，可能对删除重复数</p>
<p>据有用吧)</p>
<p># BLPOP key1 key2 … keyN timeout Blocking LPOP &gt;1.31，后续更新</p>
<p># BRPOP key1 key2 … keyN timeout Blocking RPOP &gt;1.31</p>
<p># RPOPLPUSH srckey dstkey Return and remove (atomically) the last element of the source List stored at _srckey_ and push the same element</p>
<p>to the destination List stored at _dstkey_</p>
<p>SETS （有索引无序序列）</p>
<p># SADD 增加元素到SETS序列,如果元素不存在则添加成功 1，否则失败 0;(SADD testlist 3 \n one)</p>
<p># SREM 删除SETS序列的某个元素，如果元素不存则失败0，否则成功 1(SREM testlist 3 \N one)</p>
<p># SPOP 随机删除某个元素 （SPOP testlist）</p>
<p># SMOVE 把一个SETS序列的某个元素 移动到 另外一个SETS序列 (SMOVE testlist test 3\n two;从序列testlist移动元素two到 test中，—testlist中将</p>
<p>不存在two元素)</p>
<p># SCARD 统计某个SETS的序列的元素数量 (SCARD testlist)</p>
<p># SISMEMBER 产看某个数据是否在序列中,(SISMEMBER testlist 3 \n two)</p>
<p># SINTER 几个SETS序列的交集 SINTER key1 key2 … keyN (SINTER test testlist),牛B呀</p>
<p># SINTERSTORE 把计算出来的交集 记录到一个新的序列 SINTERSTORE dstkey key1 key2 … keyN (SINTERSTORE resultlist testlist test;把testlist</p>
<p>test的交集记录到resultlist)</p>
<p># SUNION 几个SETS序列的并集 SUNION key1 key2 … keyN (SUNION test testlist)</p>
<p># SUNIONSTORE 把计算出来的并集 记录到一个新的序列 SUNIONSTORE dstkey key1 key2 … keyN (SUNIONSTORE resultlist testlist test;把testlist</p>
<p>test的交集记录到resultlist)</p>
<p># SDIFF key1 key2 … keyN,求出某几个序列的并集 与 某个序列 求出差集 ，请看官方例子：</p>
<p>key1 = x,a,b,c</p>
<p>key2 = c</p>
<p>key3 = a,d</p>
<p>SDIFF key1,key2,key3 =&gt; x,b</p>
<p># SDIFFSTORE dstkey key1 key2 … keyN ,和前面的SINTERSTORE SUNIONSTORE差不多，对比</p>
<p># SMEMBERS KEY 返回某个序列的所有元素</p>
<p># SRANDMEMBER KEY 随机返回某个序列的元素</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">DEL :删除某个key,或是一系列key;DEL key1 key2 key3 key4</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">TYPE : 返回某个key元素的数据类型 ( none:不存在,string:字符,list,set,zset,hash)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">KEYS : 返回匹配的key列表 (KEYS foo*:查找foo开头的keys)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">RANDOMKEY : 随机获得已经存在的key</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">RENAME : 更改key的名字，如果名字存在则更改失败</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">DBSIZE : 返回当前数据库的key的总数</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">EXPIRE : 设置某个key的过期时间（秒）,(EXPIRE bruce 1000：设置bruce这个key1000秒后系统自动删除)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">TTL : 查找某个key还有多长时间过期,返回时间秒</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SELECT : 选择数据库</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">MOVE : 把key从一个数据库转移到另外一个库</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">FLUSHDB : 清空当前数据库数据</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">FLUSHALL :清空所有数据库数据</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SET 存一个数据到数据库 SET keyname datalength data (SET bruce 10 paitoubing:保存key为burce,字符串长度为10的一个字符串paitoubing到数据库)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">GET :获取某个key 的value值</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">GETSET GETSET可以理解成获得的key的值然后SET这个值，更加方便的操作 (SET bruce 10 paitoubing,这个时候需要修改bruce变成1234567890并获取这个</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">以前的数据paitoubing,GETSET bruce 10 1234567890)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">MGET 一次性获得多个key的数据 (MGET uid:1:name uid:1:email uid:1:ciy)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SETNX SETNX与SET的区别是SET可以创建与更新key的value，而SETNX是如果key不存在，则创建key与value数据</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SETEX SETEX = SET + EXPIRE,貌似我的这个版本没有办法测试</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">MSET 一次性设置多个参数的值(MSET uid:1:name shjuto uid:1:email shjuto@gmail.com uid:1:city 8 回车 nanchang)最后一个值需要回车输入，和SET</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">一样，不知为啥。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">MSETNX 如果设置的key不存在的话,或是叫做新key的话；一次性设置多个参数的值(MSET uid:1:name shjuto uid:1:email shjuto@gmail.com uid:1:city 8</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">回车 nanchang)最后一个值需要回车输入，和SET一样，不知为啥。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">INCR 自增，有点类是mysql incr.(INCR global:uid)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">INCRBY 自增 +length ,(INCRBY uid 5)原来的基础+5=result</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">DECR 自减</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">* DECRBY 自减 -lenght</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">LISTS （无索引序列,head位置是0,……）</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># RPUSH 追加数据到系列的尾部 (RPUSH listtest 10 \n 1111111122)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LPUSH 追加数据到序列的头部 (LPUSH listtest 10 \n 2222222222)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LLEN 一个序列的长度；（LLEN listtest）</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LRANGE 从自定的范围内返回序列的元素 (LRANGE testlist 0 2;返回序列testlist前0 1 2元素)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LTRIM 修剪某个范围之外的数据 (LTRIM testlist 0 2;保留0 1 2元素，其余的删除)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LINDEX 返回某个位置的序列值(LINDEX testlist 0;返回序列testlist位置为零的元素)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LSET 更新某个位置元素的值 (LSET testlist 0 5 \n 55555;)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LPOP key Return and remove (atomically) the first element of the List at key</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># RPOP key Return and remove (atomically) the last element of the List at key</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># LREM 根据值删除序列元素 (LREM testlist 0 5 \n 33333;删除序列中所有的等于33333的元素,为何不是REMOVE BY KEY?不知道何故，可能对删除重复数</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">据有用吧)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># BLPOP key1 key2 … keyN timeout Blocking LPOP &gt;1.31，后续更新</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># BRPOP key1 key2 … keyN timeout Blocking RPOP &gt;1.31</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># RPOPLPUSH srckey dstkey Return and remove (atomically) the last element of the source List stored at _srckey_ and push the same element</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">to the destination List stored at _dstkey_</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SETS （有索引无序序列）</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SADD 增加元素到SETS序列,如果元素不存在则添加成功 1，否则失败 0;(SADD testlist 3 \n one)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SREM 删除SETS序列的某个元素，如果元素不存则失败0，否则成功 1(SREM testlist 3 \N one)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SPOP 随机删除某个元素 （SPOP testlist）</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SMOVE 把一个SETS序列的某个元素 移动到 另外一个SETS序列 (SMOVE testlist test 3\n two;从序列testlist移动元素two到 test中，—testlist中将</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">不存在two元素)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SCARD 统计某个SETS的序列的元素数量 (SCARD testlist)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SISMEMBER 产看某个数据是否在序列中,(SISMEMBER testlist 3 \n two)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SINTER 几个SETS序列的交集 SINTER key1 key2 … keyN (SINTER test testlist),牛B呀</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SINTERSTORE 把计算出来的交集 记录到一个新的序列 SINTERSTORE dstkey key1 key2 … keyN (SINTERSTORE resultlist testlist test;把testlist</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">test的交集记录到resultlist)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SUNION 几个SETS序列的并集 SUNION key1 key2 … keyN (SUNION test testlist)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SUNIONSTORE 把计算出来的并集 记录到一个新的序列 SUNIONSTORE dstkey key1 key2 … keyN (SUNIONSTORE resultlist testlist test;把testlist</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">test的交集记录到resultlist)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SDIFF key1 key2 … keyN,求出某几个序列的并集 与 某个序列 求出差集 ，请看官方例子：</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">key1 = x,a,b,c</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">key2 = c</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">key3 = a,d</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">SDIFF key1,key2,key3 =&gt; x,b</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SDIFFSTORE dstkey key1 key2 … keyN ,和前面的SINTERSTORE SUNIONSTORE差不多，对比</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SMEMBERS KEY 返回某个序列的所有元素</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 928px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># SRANDMEMBER KEY 随机返回某个序列的元素</div>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2010/10/08/redis-make/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux流量监控工具 &#8211; iftop</title>
		<link>http://www.helloyi.cn/index.php/2010/10/03/linux-iftop/</link>
		<comments>http://www.helloyi.cn/index.php/2010/10/03/linux-iftop/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 02:46:58 +0000</pubDate>
		<dc:creator>好易阁</dc:creator>
				<category><![CDATA[linux系统]]></category>

		<guid isPermaLink="false">http://www.helloyi.cn/?p=3294</guid>
		<description><![CDATA[在类Unix系统中可以使用top查看系统资源、进程、内存占用等信息。查看网络状态可以使用netstat、nmap等工具。若要查看实时的网络流量，监控TCP/IP连接等，则可以使用iftop。 一、iftop是什么？ iftop是类似于top的实时流量监控工具。 官方网站：http://www.ex-parrot.com/~pdw/iftop/ 二、iftop有什么用？ iftop可以用来监控网卡的实时流量（可以指定网段）、反向解析IP、显示端口信息等，详细的将会在后面的使用参数中说明。 三、安装iftop 安装方法1、编译安装 如果采用编译安装可以到iftop官网下载最新的源码包。 安装前需要已经安装好基本的编译所需的环境，比如make、gcc、autoconf等。安装iftop还需要安装libpcap和libcurses。 CentOS上安装所需依赖包： yum install flex byacc  libpcap ncurses ncurses-devel libpcap-devel Debian上安装所需依赖包： apt-get install flex byacc  libpcap0.8 libncurses5 下载iftop wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz tar zxvf iftop-0.17.tar.gz cd iftop-0.17 ./configure make &#38;&#38; make install 安装方法2：(懒人办法，最简单) 直接省略上面的步骤 CentOS系统： yum install flex byacc  libpcap ncurses ncurses-devel wget ftp://fr2.rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/iftop-0.17-1.el5.rf.i386.rpm rpm -ivh iftop-0.17-1.el5.rf.i386.rpm Debian系统 [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">在类Unix系统中可以使用top查看系统资源、进程、内存占用等信息。查看网络状态可以使用netstat、nmap等工具。若要查看实时的网络流量，监控TCP/IP连接等，则可以使用<a href="http://www.vpser.net/manage/iftop.html" target="_blank">iftop</a>。<span id="more-3294"></span></p>
<h2>一、iftop是什么？</h2>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><a href="http://www.vpser.net/manage/iftop.html" target="_blank">iftop</a>是类似于top的实时流量监控工具。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">官方网站：<a href="http://www.ex-parrot.com/~pdw/iftop/" target="_blank">http://www.ex-parrot.com/~pdw/iftop/</a></p>
<h2>二、iftop有什么用？</h2>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><a href="http://www.vpser.net/manage/iftop.html" target="_blank">iftop</a>可以用来监控网卡的实时流量（可以指定网段）、反向解析IP、显示端口信息等，详细的将会在后面的使用参数中说明。</p>
<h2>三、安装iftop</h2>
<h3><strong>安装方法1、</strong>编译安装</h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">如果采用编译安装可以到<a href="http://www.ex-parrot.com/~pdw/iftop/" target="_blank">iftop官网</a>下载最新的源码包。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">安装前需要已经安装好基本的编译所需的环境，比如make、gcc、autoconf等。安装iftop还需要安装libpcap和libcurses。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><strong>CentOS上安装所需依赖包：</strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">yum install flex byacc  libpcap ncurses ncurses-devel libpcap-devel</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><strong>Debian上安装所需依赖包：</strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">apt-get install flex byacc  libpcap0.8 libncurses5</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">下载iftop</p>
<blockquote>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><span style="display: inline !important; background-color: #ffffdd; color: #000000; text-decoration: inherit;">wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><span style="display: inline !important; background-color: #ffffdd; color: #000000; text-decoration: inherit;">tar zxvf iftop-0.17.tar.gz</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><span style="display: inline !important; background-color: #ffffdd; color: #000000; text-decoration: inherit;">cd iftop-0.17</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><span style="display: inline !important; background-color: #ffffdd; color: #000000; text-decoration: inherit;">./configure</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">make &amp;&amp; make install</p>
</blockquote>
<h3>安装方法2：(懒人办法，最简单)</h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">直接省略上面的步骤</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">CentOS系统：</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">yum install flex byacc  libpcap ncurses ncurses-devel</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">wget ftp://fr2.rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/iftop-0.17-1.el5.rf.i386.rpm</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">rpm -ivh iftop-0.17-1.el5.rf.i386.rpm</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">Debian系统 运行：apt-get install iftop</p>
<h2>四、运行iftop</h2>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">直接运行： iftop</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">效果如下图：</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><img title="iftop-interface" src="http://www.vpser.net/uploads/2010/07/iftop-interface.jpg" alt="" width="646" height="341" /></p>
<h2>五、相关参数及说明</h2>
<h3>1、iftop界面相关说明</h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">界面上面显示的是类似刻度尺的刻度范围，为显示流量图形的长条作标尺用的。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">中间的&lt;= =&gt;这两个左右箭头，表示的是流量的方向。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">TX：发送流量<br />
RX：接收流量<br />
TOTAL：总流量<br />
Cumm：运行iftop到目前时间的总流量<br />
peak：流量峰值<br />
rates：分别表示过去 2s 10s 40s 的平均流量</p>
<h3>2、iftop相关参数</h3>
<h3>常用的参数</h3>
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-i设定监测的网卡，如：# iftop -i eth1</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-B 以bytes为单位显示流量(默认是bits)，如：# iftop -B</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-n使host信息默认直接都显示IP，如：# iftop -n</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-N使端口信息默认直接都显示端口号，如: # iftop -N</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-F显示特定网段的进出流量，如# iftop -F 10.10.1.0/24或# iftop -F 10.10.1.0/255.255.255.0</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-h（display this message），帮助，显示参数信息</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-p使用这个参数后，中间的列表显示的本地主机信息，出现了本机以外的IP信息;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-b使流量图形条默认就显示;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-f这个暂时还不太会用，过滤计算包用的;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-P使host信息及端口信息默认就都显示;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">-m设置界面最上边的刻度的最大值，刻度分五个大段显示，例：# iftop -m 100M</p>
<h3>进入iftop画面后的一些操作命令(注意大小写)</h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按h切换是否显示帮助;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按n切换显示本机的IP或主机名;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按s切换是否显示本机的host信息;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按d切换是否显示远端目标主机的host信息;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按t切换显示格式为2行/1行/只显示发送流量/只显示接收流量;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按N切换显示端口号或端口服务名称;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按S切换是否显示本机的端口信息;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按D切换是否显示远端目标主机的端口信息;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按p切换是否显示端口信息;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按P切换暂停/继续显示;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按b切换是否显示平均流量图形条;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按B切换计算2秒或10秒或40秒内的平均流量;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按T切换是否显示每个连接的总流量;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按l打开屏幕过滤功能，输入要过滤的字符，比如ip,按回车后，屏幕就只显示这个IP相关的流量信息;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按L切换显示画面上边的刻度;刻度不同，流量图形条会有变化;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按j或按k可以向上或向下滚动屏幕显示的连接记录;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按1或2或3可以根据右侧显示的三列流量数据进行排序;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按&lt;根据左边的本机名或IP排序;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按&gt;根据远端目标主机的主机名或IP排序;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按o切换是否固定只显示当前的连接;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按f可以编辑过滤代码，这是翻译过来的说法，我还没用过这个！</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按!可以使用shell命令，这个没用过！没搞明白啥命令在这好用呢！</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">按q退出监控。</p>
<h2>六、常见问题</h2>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">1、make: yacc: Command not found<br />
make: *** [grammar.c] Error 127
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">解决方法：apt-get install byacc   /   yum install byacc</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">2、configure: error: Curses! Foiled again!<br />
(Can&#8217;t find a curses library supporting mvchgat.)<br />
Consider installing ncurses.
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;">解决方法：apt-get install libncurses5-dev  /    yum  install ncurses-devel</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px;"><strong>来自:VPS侦探 <a href="http://www.vpser.net/">http://www.VPSer.Net</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.helloyi.cn/index.php/2010/10/03/linux-iftop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

