<?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>果果大叔`s Blog &#187; 果果</title>
	<atom:link href="http://www.glyle.net/archives/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.glyle.net</link>
	<description>毫无疑问，你穿越了！你在门口的指示牌上发现了一排小字：“欢迎来到果果怪黍黍的领地”</description>
	<lastBuildDate>Sun, 06 Nov 2011 12:12:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>文件对比工具Beyond Compare BCompare-zh-3.2.3 3.2.4简体中文版+密钥</title>
		<link>http://www.glyle.net/archives/243</link>
		<comments>http://www.glyle.net/archives/243#comments</comments>
		<pubDate>Sun, 06 Nov 2011 12:12:04 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[大叔的唠叨]]></category>

		<guid isPermaLink="false">http://www.glyle.net/archives/243</guid>
		<description><![CDATA[Beyond Compare 是一款不可多得的专业级的文件夹和文件比对工具。使用它可以很方便的比对出两个文件夹或者文件不同之处。并把相差的每一个位元组用颜色加以表示，查看方便。并且支持多种... ]]></description>
			<content:encoded><![CDATA[<p>Beyond Compare 是一款不可多得的专业级的文件夹和文件比对工具。使用它可以很方便的比对出两个文件夹或者文件不同之处。并把相差的每一个位元组用颜色加以表示，查看方便。并且支持多种规则对比。3.0 还将增加以往只使用插件才能实现的功能: 强大的 hex 比较～快速的装载并分析两个二进制文件的差别。是程序破解的重要辅助工具。全新的图片比较～通过像素化的比较找出两幅图片的不同！(大家来找茬自动版；))。比较 Mp3 的标签信息鉴别 Mp3 的不同。全新的向导式界面方便您迅速进入工作状态。总之 Beyond Compare 3 是各位做软件汉化,代码开发,破解必不可缺的辅助工具！</p>
<p>Beyond Compare 3官方网站：<br />
http://www.scootersoftware.com<br />
Beyond Compare 3简体中文版官方下载地址：<br />
http://www.scootersoftware.com/BCompare-zh-3.2.4.13298.exe<br />
Beyond Compare 3密钥：<br />
&#8212; BEGIN LICENSE KEY &#8212;<br />
mv1nPlXAywBDCdhxFc9QOVv6TBcQHLAXBQUAKTh3ie4fqSEOnWrPsnVkF<br />
yt0wAkJHweoExRJWWVwwCniKNROSdJzJXE6YVapYW7f+tRRXRFI4yn4Nj<br />
jZ0RiiqGRCTVzwComUcXB-eiFWRBY6JpSsCNkmIxL5KsRCo442djHhTZE<br />
&#8212; END LICENSE KEY &#8212;&#8211;</p>
<p>以上为转载，以备以后需要。3.2.3 3.2.4版本通用</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/243/feed</wfw:commentRss>
		<slash:comments>482</slash:comments>
		</item>
		<item>
		<title>用iphone、安卓等智能手机打开ecshop可以正常显示，屏蔽wap功能</title>
		<link>http://www.glyle.net/archives/241</link>
		<comments>http://www.glyle.net/archives/241#comments</comments>
		<pubDate>Tue, 27 Sep 2011 02:02:26 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[ecshop]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[安卓]]></category>

		<guid isPermaLink="false">http://www.glyle.net/archives/241</guid>
		<description><![CDATA[用手机打开ecshop网店，就会被重定向到mobile文件夹，如果打开wap功能，就能看到wap版的网站。但现在智能手机横行，iphone、安卓可以跟电脑一样浏览和购物，这个wap功能就有点鸡肋。现在把它... ]]></description>
			<content:encoded><![CDATA[<p>用手机打开ecshop网店，就会被重定向到mobile文件夹，如果打开wap功能，就能看到wap版的网站。但现在智能手机横行，iphone、安卓可以跟电脑一样浏览和购物，这个wap功能就有点鸡肋。现在把它屏蔽掉</p>
<p>编辑index.php，注释或者删除掉以下代码</p>
<pre>$ua = strtolower($_SERVER['HTTP_USER_AGENT']);

$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i";

if(($ua == '' || preg_match($uachar, $ua))&amp;&amp; !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))
{
    $Loaction = 'mobile/';

    if (!empty($Loaction))
    {
        ecs_header("Location: $Loaction\n");

        exit;
    }

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/241/feed</wfw:commentRss>
		<slash:comments>298</slash:comments>
		</item>
		<item>
		<title>Linux/centos减轻/防止DDoS攻击的轻量级小程序，DDoS deflate软件防火墙[转]</title>
		<link>http://www.glyle.net/archives/239</link>
		<comments>http://www.glyle.net/archives/239#comments</comments>
		<pubDate>Wed, 07 Sep 2011 03:06:43 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[For Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ddos]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=239</guid>
		<description><![CDATA[DDoS deflate是一款Linux/centos减轻/防止ddos攻击的一个小程序，相当于软件防火墙。注意，此程序仅仅能抵御较低流量的攻击，大流量攻击连用了上百台高档服务器做了负载均衡的新浪都扛不住，何... ]]></description>
			<content:encoded><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">DDoS deflate</strong>是一款Linux/centos减轻/防止ddos攻击的一个小程序，相当于软件防火墙。注意，此程序仅仅能抵御较低流量的攻击，大流量攻击连用了上百台高档服务器做了负载均衡的新浪都扛不住，何况一个小小的普通服务器或vps。对此程序不要期望过高。这里仅仅介绍一下，对于一些简单的软件攻击可能还有点作用。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><span style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; color: #ff0000; padding: 0px; margin: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">CTOHOM制作的</strong><strong style="font-weight: bold;">DDoS deflate</strong><strong style="font-weight: bold;">一键安装脚本：</strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><span style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; color: #008080; padding: 0px; margin: 0px; border: 0px initial initial;">wget http://www.ctohome.com/linux-vps-pack/soft/ddos/ddos.sh;sh ddos.sh;</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">脚本做了什么？</strong></p>
<ol style="margin-top: 0px; margin-right: 1.5em; margin-bottom: 8px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 30px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; list-style-type: decimal; border: 0px initial initial;">
<li style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; line-height: 25px; padding: 0px; margin: 0px; border: 0px initial initial;">默认将iptables防火墙作为拦截工具，并将并发数改成了60/秒就触发屏蔽IP</li>
<li style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; line-height: 25px; padding: 0px; margin: 0px; border: 0px initial initial;">将本机IP都加入了IP白名单，然后强行不允许自动更新白名单列表。如果你需要修改IP白名单列表，请先执行 chattr -i /usr/local/ddos/ignore.ip.list   然后再vi进行修改</li>
<li style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; line-height: 25px; padding: 0px; margin: 0px; border: 0px initial initial;">卸载：wget http://www.ctohome.com/linux-vps-pack/soft/ddos/uninstall.ddos;sh uninstall.ddos;</li>
</ol>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">安装后，可以手工运行脚本</strong><span style="font-weight: normal; font-style: normal; font-size: medium; font-family: Simsun; vertical-align: baseline; border-collapse: separate; color: #000000; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px initial initial;"><span style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, Arial, sans-serif; vertical-align: baseline; line-height: 20px; text-align: left; padding: 0px; margin: 0px; border: 0px initial initial;"> </span></span></p>
<pre style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; padding: 0px; border: 0px initial initial;">/usr/local/ddos/ddos.sh -k 30 强行屏蔽连接数大于30的IP
更多使用说明，请直接 more /usr/local/ddos/ddos.sh 查看</pre>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><span style="font-weight: normal; font-style: normal; font-size: medium; font-family: Simsun; vertical-align: baseline; border-collapse: separate; color: #000000; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px initial initial;"><span style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, Arial, sans-serif; vertical-align: baseline; line-height: 20px; text-align: left; padding: 0px; margin: 0px; border: 0px initial initial;"> </span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">DDoS deflate介绍</strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">DDoS deflate是一款免费的用来防御和减轻DDoS攻击的脚本。它通过netstat监测跟踪创建大量网络连接的IP地址，在检测到某个结点超过预设的限 制时，该程序会通过APF或IPTABLES禁止或阻挡这些IP.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">DDoS deflate官方网站：<a style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; color: #000388; text-decoration: none; padding: 0px; margin: 0px; border: 0px initial initial;" href="http://www.ctohome.com/hbcms/php/r.php?url=http%3A%2F%2Fdeflate.medialayer.com%2F" target="_blank">http://deflate.medialayer.com/</a></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">如何确认是否受到DDOS攻击？</strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">执行：</p>
<pre style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; padding: 0px; border: 0px initial initial;">netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n</pre>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">执行后，将会显示服务器上所有的每个IP多少个连接数。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">以下是我自己用VPS测试的结果：</p>
<pre style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; padding: 0px; border: 0px initial initial;">li88-99:~# netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
1 114.226.9.132
1 174.129.237.157
1 58.60.118.142
1 Address
1 servers)
2 118.26.131.78
3 123.125.1.202
3 220.248.43.119
4 117.36.231.253
4 119.162.46.124
6 219.140.232.128
8 220.181.61.31    <span style="font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; color: #ffffff; padding: 0px; margin: 0px; border: 0px initial initial;">VPS侦探 http://www.vpser.net/</span>
2311 67.215.242.196 （这个看起来像攻击）</pre>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">每个IP几个、十几个或几十个连接数都还算比较正常，如果像上面成百上千肯定就不正常了。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">1、安装DDoS deflate</strong></p>
<pre style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; padding: 0px; border: 0px initial initial;">wget http://www.inetbase.com/scripts/ddos/install.sh   //下载DDoS  deflate
chmod 0700 install.sh    //添加权限
./install.sh             //执行</pre>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><strong style="font-weight: bold;">2、配置DDoS deflate</strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">下面是DDoS deflate的默认配置位于/usr/local/ddos/ddos.conf ，内容如下：</p>
<pre style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; padding: 0px; border: 0px initial initial;">##### Paths of the script and other files
PROGDIR="/usr/local/ddos"
PROG="/usr/local/ddos/ddos.sh"
IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list"  //IP地址白名单
CRON="/etc/cron.d/ddos.cron"    //定时执行程序
APF="/etc/apf/apf"
IPT="/sbin/iptables"

##### frequency in minutes for running the script
##### Caution: Every time this setting is changed, run the script with --cron
#####          option so that the new frequency takes effect
FREQ=1   //检查时间间隔，默认1分钟

##### How many connections define a bad IP? Indicate that below.
NO_OF_CONNECTIONS=150     //最大连接数，超过这个数IP就会被屏蔽，一般默认即可

##### APF_BAN=1 (Make sure your APF version is atleast 0.96)
##### APF_BAN=0 (Uses iptables for banning ips instead of APF)
APF_BAN=1        //使用APF还是iptables。推荐使用iptables,将APF_BAN的值改为0即可。

##### KILL=0 (Bad IPs are'nt banned, good for interactive execution of script)
##### KILL=1 (Recommended setting)
KILL=1   //是否屏蔽IP，默认即可

##### An email is sent to the following address when an IP is banned.
##### Blank would suppress sending of mails
EMAIL_TO="root"   //当IP被屏蔽时给指定邮箱发送邮件，推荐使用，换成自己的邮箱即可

##### Number of seconds the banned ip should remain in blacklist.
BAN_PERIOD=600    //禁用IP时间，默认600秒，可根据情况调整</pre>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.8em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">用户可根据给默认配置文件加上的注释提示内容，修改配置文件。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">
<h1 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; font-weight: normal; font-style: inherit; font-size: 3em; font-family: inherit; vertical-align: baseline; color: #111111; line-height: 1; padding: 0px; border: 0px initial initial;">卸载</h1>
<pre style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; padding: 0px; border: 0px initial initial;">wget http://www.inetbase.com/scripts/ddos/uninstall.ddos
chmod 0700 uninstall.ddos
./uninstall.ddos</pre>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">
<h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; font-weight: normal; font-style: inherit; font-size: 1.5em; font-family: inherit; vertical-align: baseline; color: #111111; line-height: 1; padding: 0px; border: 0px initial initial;">白名单设置：</h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">有时候默认的白名单经常有失误，为了避免这个情况，我们可以手工设置白名单的ip，然后强制不允许修改</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">vi /usr/local/ddos/ignore.ip.list</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">手工设置白名单IP</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">
chattr +i /usr/local/ddos/ignore.ip.list</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">强制不允许修改</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">chattr -i /usr/local/ddos/ignore.ip.list</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">解除不允许修改</p>
<h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; font-weight: normal; font-style: inherit; font-size: 1.5em; font-family: inherit; vertical-align: baseline; color: #111111; line-height: 1; padding: 0px; border: 0px initial initial;">手工用iptables屏蔽IP:</h3>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;"><span style="font-weight: normal; font-style: normal; font-size: medium; font-family: Simsun; vertical-align: baseline; border-collapse: separate; color: #000000; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px initial initial;"><span style="font-weight: inherit; font-style: inherit; font-size: 14px; font-family: Arial; vertical-align: baseline; line-height: 20px; padding: 0px; margin: 0px; border: 0px initial initial;"> </span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; line-height: normal; padding: 0px; border: 0px initial initial;">单个IP的命令是<br />
iptables -I INPUT -s 124.115.0.199 -j DROP</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; line-height: normal; padding: 0px; border: 0px initial initial;">恢复单个IP：</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; line-height: normal; padding: 0px; border: 0px initial initial;">iptables -D INPUT -s <span style="font-weight: normal; font-style: normal; font-size: medium; font-family: Simsun; vertical-align: baseline; border-collapse: separate; color: #000000; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px initial initial;"><span style="font-weight: inherit; font-style: inherit; font-size: 14px; font-family: Arial; vertical-align: baseline; line-height: 20px; padding: 0px; margin: 0px; border: 0px initial initial;">124.115.0.199</span></span> -j DROP</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">封IP段的命令是<br />
iptables -I INPUT -s 124.115.0.0/16 -j DROP<br />
iptables -I INPUT -s 124.115.3.0/16 -j DROP<br />
iptables -I INPUT -s 124.115.4.0/16 -j DROP</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">封整个段的命令是<br />
iptables -I INPUT -s 124.115.0.0/8 -j DROP</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; padding: 0px; border: 0px initial initial;">封几个段的命令是<br />
iptables -I INPUT -s 61.37.80.0/24 -j DROP<br />
iptables -I INPUT -s 61.37.81.0/24 -j DROP</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/239/feed</wfw:commentRss>
		<slash:comments>103</slash:comments>
		</item>
		<item>
		<title>ecshop把搜索页面url的乱码修改为正常链接</title>
		<link>http://www.glyle.net/archives/236</link>
		<comments>http://www.glyle.net/archives/236#comments</comments>
		<pubDate>Mon, 20 Jun 2011 00:31:28 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[ecshop]]></category>
		<category><![CDATA[Analytics]]></category>
		<category><![CDATA[搜索页面url]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=236</guid>
		<description><![CDATA[由于要在Google Analytics里面跟踪用户搜索，但ecshop的搜索url都是转义过的一些乱码，修改search.php使用原本的搜索链接
有兴趣能力的朋友还可以直接做成伪静态，参考文章
http://www.phpsir.com/tag/ecsho... ]]></description>
			<content:encoded><![CDATA[<p>由于要在Google Analytics里面跟踪用户搜索，但ecshop的搜索url都是转义过的一些乱码，修改search.php使用原本的搜索链接<br />
有兴趣能力的朋友还可以直接做成伪静态，参考文章<br />
http://www.phpsir.com/tag/ecshop-search-%E6%90%9C%E7%B4%A2</p>
<p>我这里不做伪静态，只需要修改search.php即可<br />
注释掉search.php行18-行66<br />
然后加入</p>
<div id="highlighter_249183" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 1px; padding-right: 0px; padding-bottom: 1px; padding-left: 0px; font-weight: inherit; font-style: inherit; font-size: 1em !important; font-family: inherit; vertical-align: baseline; width: 588px; position: relative !important; overflow-x: auto !important; overflow-y: auto !important; background-color: white !important; border: 0px initial initial;">
<table style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; width: 588px; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; min-height: inherit !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;" border="0" cellspacing="0" cellpadding="0">
<tbody style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">
<tr style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">
<td style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; text-align: left !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #afafaf !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">
<div style="padding-top: 0px !important; padding-right: 0.5em !important; padding-bottom: 0px !important; padding-left: 1em !important; border-top-width: 0px !important; border-right-width: 3px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: white !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; width: auto !important; min-height: inherit !important; white-space: pre !important; border-right-style: solid !important; border-right-color: #6ce26c !important; background-position: initial initial !important; background-repeat: initial initial !important; margin: 0px !important;">1</div>
<div style="padding-top: 0px !important; padding-right: 0.5em !important; padding-bottom: 0px !important; padding-left: 1em !important; border-top-width: 0px !important; border-right-width: 3px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: white !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; width: auto !important; min-height: inherit !important; white-space: pre !important; border-right-style: solid !important; border-right-color: #6ce26c !important; background-position: initial initial !important; background-repeat: initial initial !important; margin: 0px !important;">2</div>
<div style="padding-top: 0px !important; padding-right: 0.5em !important; padding-bottom: 0px !important; padding-left: 1em !important; border-top-width: 0px !important; border-right-width: 3px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: white !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; width: auto !important; min-height: inherit !important; white-space: pre !important; border-right-style: solid !important; border-right-color: #6ce26c !important; background-position: initial initial !important; background-repeat: initial initial !important; margin: 0px !important;">3</div>
</td>
<td style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; text-align: left !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; top: auto !important; width: 560px; min-height: inherit !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">
<div style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; width: auto !important; display: block; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; min-height: inherit !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">
<div style="padding-top: 0px !important; padding-right: 1em !important; padding-bottom: 0px !important; padding-left: 1em !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: white !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; white-space: pre !important; background-position: initial initial !important; background-repeat: initial initial !important; margin: 0px !important; border: 0px !important initial !important initial !important;"><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #aa7700 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">$string</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">[</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"keywords"</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">]=</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #ff1493 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">addslashes</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">(</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #aa7700 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">$_GET</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">[</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"keywords"</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">]); </code></div>
<div style="padding-top: 0px !important; padding-right: 1em !important; padding-bottom: 0px !important; padding-left: 1em !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: white !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; white-space: pre !important; background-position: initial initial !important; background-repeat: initial initial !important; margin: 0px !important; border: 0px !important initial !important initial !important;"><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #aa7700 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">$string</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">[</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"page"</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">]=</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #ff1493 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">addslashes</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">(</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #aa7700 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">$_GET</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">[</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"page"</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">]); </code></div>
<div style="padding-top: 0px !important; padding-right: 1em !important; padding-bottom: 0px !important; padding-left: 1em !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: white !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; white-space: pre !important; background-position: initial initial !important; background-repeat: initial initial !important; margin: 0px !important; border: 0px !important initial !important initial !important;"><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #aa7700 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">$string</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">[</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"search_encode_time"</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">] = </code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: #aa7700 !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">$_SERVER</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">[</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: blue !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">"REQUEST_TIME"</code><code style="font-weight: normal !important; font-style: normal !important; font-size: 1em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; vertical-align: baseline !important; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.1em !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-left-radius: 0px 0px !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; width: auto !important; min-height: inherit !important; color: black !important; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important; border: 0px !important initial !important initial !important;">];</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/236/feed</wfw:commentRss>
		<slash:comments>692</slash:comments>
		</item>
		<item>
		<title>[转]centos上VNC的安装与使用</title>
		<link>http://www.glyle.net/archives/234</link>
		<comments>http://www.glyle.net/archives/234#comments</comments>
		<pubDate>Tue, 14 Jun 2011 03:24:55 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[For Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=234</guid>
		<description><![CDATA[安装前请先确保已经安装gnome桌面程序，否则即使装完VNC，连接时也只会显示一个纯色的背景加上一个X号的鼠标
VNC的安装与使用。
说明：文章内容比较简单，献给那些初学者作为参考。
      ... ]]></description>
			<content:encoded><![CDATA[<p>安装前请先确保已经安装gnome桌面程序，否则即使装完VNC，连接时也只会显示一个纯色的背景加上一个X号的鼠标</p>
<p>VNC的安装与使用。<br />
说明：文章内容比较简单，献给那些初学者作为参考。<br />
      文章分为两部分，第一部分为VNC简介，第二部分为VNC的安装与使用。<br />
      文章为小弟结合书籍与小弟的实际操作总结出来的，如有错误与疏漏之处，还请指出。<br />
fish_ys  2003.8.25 </p>
<p>『VNC简介』<br />
  网络遥控技术是指由一部计算机（主控端）去控制另一部计算机（被控端），而且当主控端在控制端时，就如同用户亲自坐在被控端前操作一样，可以执行被控端的应用程序，及使用被控端的系统资源。<br />
  VNC（Virtual Network Computing）是一套由AT&#038;T实验室所开发的可操控远程的计算机的软件，其采用了GPL授权条款，任何人都可免费取得该软件。VNC软件主要由两个部分组成：VNC server及VNC viewer。用户需先将VNC server安装在被控端的计算机上后，才能在主控端执行VNC viewer控制被控端。<br />
（在windows中也由一套著名的网络遥控软件――Symantec公司推出的pcAnywhere。<br />
  VNC server与VNC viewer支持多种操作系统，如Unix系列（Unix，Linux，Solaris等），windows及MacOS，因此可将VNC server 及VNC viewer分别安装在不同的操作系统中进行控制。如果目前操作的主控端计算机没有安装VNC viewer，也可以通过一般的网页浏览器来控制被控端。<br />
  整个VNC运行的工作流程如下：<br />
（1） VNC客户端通过浏览器或VNC Viewer连接至VNC Server。<br />
（2） VNC Server传送一对话窗口至客户端，要求输入连接密码，以及存取的VNC Server显示装置。<br />
（3） 在客户端输入联机密码后，VNC Server验证客户端是否具有存取权限。<br />
（4） 若是客户端通过VNC Server的验证，客户端即要求VNC Server显示桌面环境。<br />
（5） VNC Server通过X Protocol 要求X Server将画面显示控制权交由VNC Server负责。<br />
（6） VNC Server将来由 X Server的桌面环境利用VNC通信协议送至客户端，并且允许客户端控制VNC Server的桌面环境及输入装置。 </p>
<p>『VNC的安装与使用』<br />
本人的操作环境：被控端 Redhat8.0，主控端Windows XP。<br />
1． 载VNC Server与VNC viewer.<br />
VNC Server下载地址：http://www.linuxeden.com/download/softdetail.php?softid=744<br />
VNC viewer下载地址：http://download.pchome.net/php/dl.php?sid=2603<br />
2．安装。<br />
rpm –Uvh vnc-3.3.6-2.i386.rpm (如果是源代码请看包里的说明)<br />
安装winvnc.exe<br />
3.在Linux上启动VNC Server<br />
执行vncserver命令：<br />
[root@linux root]# vncserver<br />
You will require a password to access your desktops.<br />
Password:                       &#8212;-为了不想任何人都可以任意遥控此计算机。因此当第<br />
Verify:                          &#8212;1次启动VNC server时，会要求设置网络遥控的密码。<br />
New ‘X’ desktop is linux:1         &#8212;-一定要记住这一行稍后会用到。<br />
Creating default startup script /root/.vnc/xstartup<br />
Starting applications specified in /root/.vnc/xstartup<br />
Log file is /root/.vnc/linux:1.log<br />
（经上述步骤后，便已启动了VNC Server。如果你想要更改VNC Server的密码，只要执行vncpasswd命令即可。）<br />
4．在Microsoft Windows上运行VNC Viewer<br />
直接运行“vncviewer.exe”,系统会出现”Connection details”对话框。<br />
在“Connection details”对话框中的“VNC server”文本框中输入VNC Server的IP地址（或主机名及显示装置编号，（请看3。在Linux上启动VNC server的这一行，New ‘X’ desktop is linux:1 得到此信息），例如：192.168.0.1：1（冒号后面的1是执行VNC Server生成的显示装置编号），单击“OK”按钮后，VNC Server即会开始检查所输入的信息，若是信息错误，系统会出现“Failed to connect to server”的错误信息：若是信息正确，则会接着出现“VNC Authentication”对话框。<br />
  若是在“VNC Authentication”对话框中输入的密码正确，就可以成功地打开Linux的桌面窗口。<br />
5. 从浏览器远程遥控。<br />
启动VNC Server 后直接打开浏览器，在地址栏中输入被控端的网址或IP地址，并在网址后加上“：5800＋显示编号”的端口号即可操控该计算机。<br />
例如：http://192.168.01.:5801 (如果显示编号为1，一般第一次设置的显示编号都是1，就用5800＋1＝5801。) </p>
<p>6．FAQ<br />
A．为什么连接后，不能显示桌面，而只有一个Terminal窗口？<br />
试着修改/root/.vnc/xstartup,把最后一行 twm&#038; 改成 gnome-session&#038; or  kde&#038;(据说KDE在目前的VNC Viewer上的表现不太稳定) </p>
<p>B． 为什么重新启动VNC Server后，连接不上了？<br />
因为重新启动VNC Server时，系统会指定一个新的显示编号，需使用此新的编号，否则就无法连接。<br />
（以上只是本人遇到的一些问题，而且用VNC也不是很多，很不全面，还望多提宝贵意见）</p>
<p>为什么我设成gnome-session &#038;进去什么也没有啊?灰灰的背景,一个大X鼠标标志,求大虾帮忙!!!!!! </p>
<p>是你没有装gnome</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/234/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Apache启用mod_proxy做正向代理、反向代理</title>
		<link>http://www.glyle.net/archives/231</link>
		<comments>http://www.glyle.net/archives/231#comments</comments>
		<pubDate>Wed, 11 May 2011 09:24:17 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[大叔的唠叨]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[反向代理]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=231</guid>
		<description><![CDATA[如果没有apache没有安装proxy模块，可以不用重新编译添加模块。
cd /home/cpeasyapache/src/httpd-2.2.17/modules/proxy
/usr/local/apache/bin/apxs -c -i mod_proxy.c proxy_util.c (ps 必须2个c一起编译，不然会报错)
/usr/local/a... ]]></description>
			<content:encoded><![CDATA[<p>如果没有apache没有安装proxy模块，可以不用重新编译添加模块。</p>
<p>cd /home/cpeasyapache/src/httpd-2.2.17/modules/proxy<br />
/usr/local/apache/bin/apxs -c -i mod_proxy.c proxy_util.c (ps 必须2个c一起编译，不然会报错)<br />
/usr/local/apache/bin/apxs -c -i mod_proxy_http.c proxy_util.c</p>
<p>apache提供了mod_proxy模块用于提供代理服务，能够支持的包括正向代理、反向代理、透明代理、缓存、负载均衡，HTTP代理、FTP代理、SSL代理等若干强大的功能。</p>
<p>通常我们使用的比较多的，是正向代理。也就是在浏览器的网络连接属性框中，填写上一个代理服务器的ip和端口，即可通过代理服务器中转，去浏览网页。</p>
<p>配置正向代理非常简单：</p>
<p>首先在apache上启用mod_proxy模块，需要注意的是，如果在apache-2.2上，则还需要加载名为mod_proxy_http的模块。因为2.2系列把代理功能都拆分成N个小模块了。</p>
<p>打开apache的conf，加入如下几行：（全局配置）</p>
<p>ProxyRequests On<br />
ProxyVia On</p>
<p>Order deny,allow<br />
Deny from all<br />
Allow from all</p>
<p>然后保存退出，重启加载apache服务：/etc/init.d/httpd restart或者做graceful也可以。 现在即可在浏览器的网络连接属性框中，填写上your_apache_server_ip的ip地址，端口是80，开始用代理了。</p>
<p>使用apache提供的代理，也可以加身份验证，或者设置ACL来限制客户端来源等。这些配置就和普通的apache站点配置一样。</p>
<p>配置反向代理就是个非常有用的功能。例如从某地访问google太慢，但是机房服务器上很快，则可在服务器上设置反向代理连接到google，也就是把google映射到服务器上来访问。</p>
<p>然后新建一个网站，即创建一个标准的配置段。这里我们将站点/google目录设置为google的反向代理。在这段里边，加入下边一内容：</p>
<p>ProxyRequests Off<br />
ProxyPass /google http://www.google.com/<br />
#ProxyPassReverse /google http://www.google.com/</p>
<p>然后保存配置文件重新启动apache。现在即可使用浏览器来访问我的网站的/google目录。当打开这个目录的时候，会发现页面是google。点击google的下级页面，都可以正常的打开访问，而此时浏览器中的代理服务器并未设置任何内容——这就是反向代理。</p>
<p>通过反向代理，我们可以将web服务器放置在防火墙后，在web服务器前端使用mod_proxy配置反向代理，并打开apache的mod_cache缓存模块，更可以极大的提高对静态内容的访问性能。</p>
<p>在RewriteRule指令中使用[P]标记也可以：<br />
RewriteEngine On<br />
RewriteRule ^/google/(.*) http://www.google.com/$1 [P]</p>
<p>首先要做的事情是: 访问域名xxx -> 通过 代理服务器B -> 访问 服务器C</p>
<p>首页把域名 www.morningprincess.com 和morningprincess.com指到自己的vps服务器确认自己的服务器中的Apache已经启用了proxymod和proxyhttp_mod,</p>
<p>sudo /etc/init.d/apache2 restart</p>
<p>然后在apache中增加站点</p>
<p>文件配置如下</p>
<p><VirtualHost *:80><br />
ServerAdmin webmaster@example.com<br />
ServerName morningprincess.com<br />
ServerAlias www.morningprincess.com<br />
 ProxyRequests Off<br />
 <Proxy *><br />
Order deny,allow<br />
 Allow from all<br />
</Proxy><br />
 ProxyPreserveHost on<br />
ProxyPass /   http://ghs.google.com/<br />
ProxyPassReverse / http://ghs.google.com/<br />
</VirtualHost><br />
然后:</p>
<p>sudo /etc/init.d/apache2 reload<br />
这样你就可以使用你的域名访问外面的服务器了</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>apache增加mod_cache模块参考链接：<br />
http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_cache.html<br />
http://hi.baidu.com/houdelei250/blog/item/b0d83145089f428eb2b7dcda.html<br />
apache mod_cache模块的编译<br />
配apache mod_cache 后 /usr/local/apache/bin/apachectl restart<br />
apache出现以下信息：<br />
Cannot load /usr/local/apache/modules/mod_cache.so into server: /usr/local/apache/modules/mod_cache.so: undefined symbol: cache_generate_key_default<br />
正规解决方案:<br />
modules/cache下面有很多的.c文件<br />
mod_cache.c 编译得到mod_cache.so 主要用来控制整个apache的cache功能。<br />
mod_file_cache.c,mod_mem_cache.c,mod_disk_cache.c这个三个文件编译后得到各自的cache支持模块。<br />
[root@zhang2 cache]# find . -name &#8220;*cache*.c&#8221; -print<br />
./cache_storage.c<br />
./cache_pqueue.c<br />
./mod_cache.c<br />
./cache_hash.c<br />
./mod_mem_cache.c<br />
./mod_file_cache.c<br />
./mod_disk_cache.c<br />
./cache_util.c<br />
./cache_cache.c<br />
mod_cache.c还需要其他的程序来进行工作，包括cache_*.c这些文件。因此apxs动态加载一个模块的时候，需要把这些文件和mod_cache.c 一起编译：<br />
编译mod_cache:<br />
/usr/local/apache/bin/apxs -c -i -a mod_cache.c cache_util.c cache_cache.c cache_storage.c cache_pqueue.c cache_hash.c<br />
编译mod_disk_cache：<br />
/usr/local/apache/bin/apxs -c -i -a mod_disk_cache.c cache_util.c cache_cache.c cache_storage.c cache_pqueue.c cache_hash.c<br />
编译mod_mem_cache：<br />
/usr/local/apache/bin/apxs -c -i -a mod_mem_cache.c cache_util.c cache_cache.c cache_storage.c cache_pqueue.c cache_hash.c<br />
至此，apache已经支持缓存了，再加上缓存配置就Ok！！！<br />
1. 修改httpd.conf<br />
示例：<br />
LoadModule cache_module modules/mod_cache.so<br />
<IfModule mod_cache.c><br />
  #LoadModule disk_cache_module modules/mod_disk_cache.so<br />
  #如果你想使用mod_disk_cache代替mod_mem_cache的话，<br />
  #那么就取消上面的注释，并将下面的LoadModule行加上注释<br />
  <IfModule mod_disk_cache.c><br />
    CacheRoot /cacheroot<br />
    CacheEnable disk /<br />
    CacheDirLevels 5<br />
    CacheDirLength 3<br />
  </IfModule><br />
  LoadModule mem_cache_module modules/mod_mem_cache.so<br />
  <IfModule mod_mem_cache.c><br />
    CacheEnable mem /<br />
    MCacheSize 4096<br />
    MCacheMaxObjectCount 100<br />
    MCacheMinObjectSize 1<br />
    MCacheMaxObjectSize 2048<br />
  </IfModule><br />
#在充当代理的时候，不缓存update-list下的内容<br />
CacheDisable http://security.update.server/update-list/<br />
</IfModule><br />
2. 创建缓存目录<br />
#mkdir /var/www/cacheroot<br />
#chown root.apache /var/www/cacheroot<br />
#chmod 775 /var/www/cacheroot<br />
3. 测试<br />
重启apache，访问网站，会在/var/www/cacheroot下看到一堆文件夹。</p>
<p>Apache2缓存压缩模块<br />
Apache2参考文档http://lamp.linux.gov.cn/Apache/ApacheMenu/index.html<br />
编译模块<br />
    cd httpd-2.2.11/modules<br />
    mod_expires.c mod_headers位于metadata目录下<br />
    mod_deflate.c 位于filters目录下<br />
    apxs -ica mod_deflate.c 生成so文件<br />
#vi httpd.conf下添加：<br />
LoadModule deflate_module modules/mod_deflate.so<br />
LoadModule expires_module modules/mod_expires.so<br />
LoadModule headers_module modules/mod_headers.so</p>
<p>modules/cache下面有很多的.c文件，大致用途如：<br />
mod_cache.c 编译得到mod_cache.so 主要用来控制整个apache的cache功能。<br />
mod_file_cache.c,mod_mem_cache.c,mod_disk_cache.c这个三个文件编译后得到各自的cache支持模块。</p>
<p>mod_cache.c还需要其他的程序来进行工作，包括cache_*.c这些文件。因此apxs动态加载一个模块的时候，需要把这些文件和mod_cache.c 一起编译：perl /usr/local/apache2/bin/apxs -cia mod_cache.c cache_util.c cache_cache.c cache_storage.c cache_pqueue.c cache_hash.c</p>
<p>安装时编译：<br />
# tar –zxvf httpd-2.0.49.tar.gz<br />
# cd httpd-2.0.49<br />
#./configure &#8211;enable-cache &#8211;enable-disk-cache &#8211;enable-mem-cache<br />
#mke<br />
#make install</p>
<p>Apache 从2.0开始就已经可以使用缓存模块了，不过在2.0的时候还是实验性的，到了2.2已经完全可以放心的使用。Apache的缓存实现主要依靠 mod_cache、mod_disk_cache、mod_file_cache 及mod_mem_cache。只需在配置编译的时候加上参数：–enable-cache、–enable-disk-cache、–enable- file-cache、 –enable-mem-cache 即可。<br />
关于 Apache 的编译安装本文就不再说了，可以参考以前的文章。这里主要介绍一下如何配置使用 Apache 的缓存功能。<br />
具 体来说，Apache 的缓存方式有两种，一种是基于硬盘文件的缓存，由 mod_disk_cache 实现，另一种是使用内存缓存，由mod_mem_cache 实现，不过它们都是依赖 mod_cache 模块的，mod_cache 模块提供了一些缓存配置的指令供它们使用，而mod_file_cache 模块是搭配 mod_mem_cache 模块使用的，下面分别进行介绍。</p>
<p>1、基于硬盘文件的缓存<br />
基于硬盘文件存储的缓存由 mod_disk_cache 模块实现，先看个简单的配置例子：</p>
<p>CacheDefaultExpire 86400</p>
<p>CacheEnable disk /<br />
CacheRoot /tmp/apacheCache<br />
CacheDirLevels 5<br />
CacheDirLength 5<br />
CacheMaxFileSize 1048576<br />
CacheMinFileSize 10</p>
<p>把上面的配置加到 Apache 的 httpd.conf 文件中，如果缓存相关的模块都已经编译进了 Apache 的核心，则无需加载模块，直接就能使用上面的指令。指令的详细说明如下：<br />
CacheDefaultExpire： 设定缓存过期的时间（秒），默认是1小时，只有当缓存的文档没有设置过期时间或最后修改时间时这个指令才会生效<br />
CacheEnable：启用缓存，第1个参数是缓存类弄，这里当然是 disk了，第2个参数是缓存路径，指的是 url 路径，这里是缓存所有的东西，直接写上“/”即可，如“/docs”则只缓存 /docs 下的所有文件<br />
CacheRoot：缓存文件所在的目录，运行 Apache 的用户（如daemon 或 nobody）要能对其进行读写，如果不清楚的话可以直接设置成 777，请手动建立该目录并设置好访问权限<br />
CacheDirLevels：缓存目录的深度，默认是3，这里设置为5<br />
CacheDirLength：缓存目录名的字符长度，默认是4，这里设置为5<br />
CacheMaxFileSize 和 CacheMaxFileSize：缓存文件的最大值和最小值（byte），当超过这个范围时将不再缓存，这里设置为 1M 和 10bytes<br />
基于硬盘文件存储的文件基本上就这些内容，设置好后重启 Apache 应该就能使用了。一切正常的话，可以在缓存目录下看到 Apache 自动建立的一些目录和缓存的数据文件。</p>
<p>2、基于内存的缓存<br />
基于内存的缓存主要由 mod_mem_cache 模块实现，还是看个简单的配置吧，这样比较直观:-)</p>
<p>CacheEnable mem /<br />
MCacheMaxObjectCount 20000<br />
MCacheMaxObjectSize 1048576<br />
MCacheMaxStreamingBuffer 65536<br />
MCacheMinObjectSize 10<br />
MCacheRemovalAlgorithm GDSF<br />
MCacheSize 131072</p>
<p>简单说一下上面一些指令的意思：<br />
CacheEnable：启用缓存，使用基于内存的方式存储<br />
MCacheMaxObjectCount：在内存中最多能存储缓存对象的个数，默认是1009，这里设置为20000<br />
MCacheMaxObjectSize：单个缓存对象最大为 1M，默认是10000bytes<br />
MCacheMaxStreamingBuffer：在缓冲区最多能够放置多少的将要被缓存对象的尺寸，这里设置为 65536，该值通常小于100000或 MCacheMaxObjectSize 设置的值<br />
MCacheMinObjectSize：单个缓存对象最小为10bytes，默认为1bytes<br />
MCacheRemovalAlgorithm：清除缓存所使用的算法，默认是 GDSF，还有一个是LRU，可以查一下 Apache 的官方文档，上面有些介绍<br />
MCacheSize：缓存数据最多能使用的内存，单位是 kb，默认是100kb，这里设置为128M<br />
保存重启 Apache 基于内存的缓存系统应该就能生效了，根据需要可以使基于内存的存储或硬盘文件的存储方式一起使用，只要指明不同的URL路径即可。</p>
<p>3、注意事项<br />
使用缓存需要注意如下事项：<br />
要使用缓存，必须使用指令 CacheEnable 启用它，目前可用的缓存类型为 disk 或 mem，禁止缓存可以使用 CacheDisable，如 CacheDisable /private<br />
待缓存的 URL 返回的状态值必须为： 200、203、300、301 或 410<br />
URL 的请求方式必须是 GET 方式<br />
发送请求时，头部中包含 “Authorization: ”的字符串时，返回的内容将不会被缓存<br />
URL 包含查询字符串，如问号?后的那些东西，除非返回的内容包含“Expires:”，否则不会被缓存<br />
如果返回的状态值是 200，则返回的头部信息必须包含以下的一种才会被缓存：Etag、Last-Modified、Expires，除非设置了指令 CacheIgnoreNoLastMod On<br />
如果返回内容的头部信息“Cache-Control:”中包含“private”，除非设置了指令 CacheStorePrivate On，否则不会被缓存<br />
如果返回内容的头部信息“Cache-Control:”中包含“no-sotre”，除非设置了指令 CacheStoreNoStore On，否则不会被缓存<br />
如果返回内容的头部信息“Vary:”中包含了“*”，不会被缓存</p>
<p>4、其它一些指令的介绍<br />
如果你的网站有几个文件的访问非常频繁而又不经常变动，则可以在 Apache 启动的时候就把它们的内容缓存到内存中（当然要启用内存缓存系统），使用的是 mod_file_cache 模块，具体如下：<br />
有多个文件可以用空格格开<br />
MMapFile /var/www/html/index.html /var/www/html/articles/index.html<br />
上面是缓存文件的内容到内存中，除此之外，还可以只缓存文件的打开句柄到内存中，当有请求进来的时候，Apache 直接从内存中获取文件的句柄，返回内容，和 MMapFile 指令很像，具体如下：<br />
CacheFile /var/www/html/index.html /var/www/html/articles/index.html<br />
上面两个指令所缓存的文件如果有修改的话，必须重启 Apache 或使用 graceful 之类的方式强制使 Apache 更新缓存数据，否则当用户访问的时候获取的不是最新的数据。<br />
有时候需要根据某些特殊的头部信息来决定是否进行缓存，则可以使用如下指令：<br />
当头部信息中包含 Set-Cookie 时则跳过不进行缓存操作<br />
CacheIgnoreHeaders Set-Cookie<br />
有时候需要缓存的时候跳过 URL 中的查询字符串？使用如下指令：<br />
CacheIgnoreQueryString On<br />
Apache 的缓存系统不仅可以缓存服务器本身的文件，也可以缓存通过代理得到的内容，对了，Apache 可以像 Squid一样做代理，而且做的还不错，下篇文章就介绍一下 Apache 的代理功能吧。善用 Apache的缓存功能，可以让你的网站速度提升不少。做为一个网站来说，虽然可用的各种缓存方案很多，但在 Web 服务器层做缓存的效率还是很值得一试的。</p>
<p>更多信息请参考：http://httpd.apache.org/docs/2.2/caching.html</p>
<p>一个httpd.conf的配置例子:</p>
<p>#一个连接的最大请求数量<br />
MaxKeepAliveRequests 10000<br />
#NT环境，只能配置这个参数来提供性能<br />
<IfModule mpm_winnt.c><br />
#每个进程的线程数，最大1920。NT只启动父子两个进程，不能设置启动多个进程<br />
ThreadsPerChild 1900<br />
#每个子进程能够处理的最大请求数<br />
MaxRequestsPerChild  10000<br />
</IfModule></p>
<p>LoadModule cache_module modules/mod_cache.so<br />
LoadModule disk_cache_module modules/mod_disk_cache.so<br />
LoadModule mem_cache_module modules/mod_mem_cache.so</p>
<p><IfModule mod_cache.c><br />
CacheForceCompletion 100<br />
CacheDefaultExpire 3600<br />
CacheMaxExpire 86400<br />
CacheLastModifiedFactor 0.1</p>
<p><IfModule mod_disk_cache.c><br />
CacheEnable disk /<br />
CacheRoot c:/cacheroot<br />
CacheSize 327680<br />
CacheDirLength 4<br />
CacheDirLevels 5<br />
CacheGcInterval 4<br />
</IfModule><br />
<IfModule mod_mem_cache.c><br />
CacheEnable mem /<br />
MCacheSize 8192<br />
MCacheMaxObjectCount 10000<br />
MCacheMinObjectSize 1<br />
MCacheMaxObjectSize 51200<br />
</IfModule><br />
</IfModule></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; </p>
<p>一、前言<br />
當人們對於網路的需求愈來愈高，網路頻寬的要求也日漸增加，在網路初期，有個文字模式的BBS 或GOPHER 已是非常今人興奮的事情，發展至WINDOW介面時，魔賽克、NETSCAPE等瀏覽器在網路上的應用，讓我們可以取得更豐富的資料，而今，上網看電視、聽廣播都是輕而易舉的事，但是對於網路傳輸流量也愈來愈大，所以，善用網路資源的同時，也更該節省網路資源。</p>
<p>二、Proxy 的概念<br />
在安裝之前我們先釐清一個有關 PROXY 的概念，事實上 PROXY SERVER 有很多種類，如 IP Proxy 、Mail Proxy、Proxy Caching …等，而我們一般所稱的Proxy是指 Proxy Caching。</p>
<p>如果校園網路內有了Proxy伺服器，且所有CLIENT端的電腦都連接到Proxy伺服器上，當網域內有一台機器的瀏覽器透過 Proxy Server瀏覽過某個網站上的網頁後，這個被瀏覽過的網站資料就被複製一份到Proxy Server的cache （快取）空間裡，當其他使用者也要瀏覽這個已瀏覽過的網站時，就不用再透過對外的線路傳輸網頁資料，而是直接從Proxy Server的cache裡讀取網頁資料，所以Proxy Server可以大大的節省頻寬與加快用戶端讀取資料速度。</p>
<p>其實 Apache 也有Proxy 的功能，早期的CERN 也有相同的功能，但是他們主要功能是WWW SERVER，所以使用的人很少。在Unix like 系統中，Squid是使用率最廣的，因為 Squid Proxy Server是專為caching所設計的，Squid有一套自己的Cache階層體系，簡單的說就是Proxy Server間的關係有父（parent）、子（child）、兄弟姊妹（sibling）三種關係存在。善用這種階層的架構可以降低server 的負載和資料傳輸的速度。</p>
<p>三、安裝 Squid<br />
如果我們在安裝RedHat + CLE 時，安裝的選項是[Everything]，那Squid 就已經安裝在系統中，只是還沒被啟動而以。如果我們可以在 /etc/rc.d/init.d的目錄下看到 squid 這個檔案，而且在 /etc/squid 下有 squid.conf 的設定檔，那麼我們可以確定 squid 已經安裝好了，只是尚未被啟動而以，如果不是上述的情形，我們也可以自行安裝或昇級，首先你可能要掛上CD-ROM或者到大一點的FTP 站下載新的套件，再用 RPM 安裝，可以選擇 i386的檔案直接安裝，或者是用 src.rpm 的檔案，先自己 rebuild ，再安裝。</p>
<p># rpm –Uhv squid-2.2*</p>
<p># rpm –rebuild –target i686 squid-2.3.S</p>
<p>安裝完當然可以馬上啟動，或者利用 setup、ntsysv來設定開機時，讓squid啟動。但是我們對cache的目錄還未規劃，所以我們必須對 squid.conf做一些調整再行啟動。</p>
<p>四、squid.conf 的基本設定<br />
1.     規劃 CACHE 目錄</p>
<p>預設值是 cache_dir /var/spool/squid 100 16 256</p>
<p>也就是在 /var/spool/squid 中增加16&#215;256個目錄，而SQUID 就利用這4096個目錄來存放 100MB 的 CACHE 資料。而在實際的應用上，100MB 的空間實在太少了! 所以我們可以依 SERVER 上的空間來調整 CACHE 的大小，另外 16&#215;256 這個目錄大小我們也可依server 上的實體記憶體和 cache 目錄大小來調整，原則上，除非記憶體大於 256 MB，CACHE 的目錄也需要到 10 GB 以上，否則 16&#215;256 或 64&#215;256 就可以了。</p>
<p>2.     記憶體設定</p>
<p>預設值是 #cache_mem  8 MB  </p>
<p>一般來說大概是實際記憶的 1/3 ，如果只是單純做為 PROXY ，則可以調高為1/2 。</p>
<p>3. 開放存取設定 &#8212; 原始設定中只允許localhost本身使用，所以我們可以把 localhost 的 IP 範圍改成允許使用的IP範圍。</p>
<p>原來 => acl localhost src 127.0.0.1/255.255.255.255</p>
<p>改成 => acl localhost src 163.17.169.0/255.255.255.0</p>
<p>或者</p>
<p>原來 => httpd deny all</p>
<p>改成 => httpd allow all (安全性較低，不建議)</p>
<p>五、啟動 Squid<br />
啟動 /etc/rc.d/init.d/squid start  ;(啟動和停止的訊息都在/var/log/squid/cache.log)</p>
<p>停止 /etc/rc.d/init.d/squid stop</p>
<p> 因為是以 rpm 安裝，所以在啟動時，程式(shell script)會自動偵測目錄是否存在，所以要改變 cache 目錄，只要在 squid.conf 設定好，重新啟動 squid 就可以！但要事先建立存放的主目錄，而且要注意目錄的擁有者。</p>
<p>六、進階設定<br />
1. parent 和 sibling</p>
<p>若您要設定擷取上一層的Proxy Server資料，如139.175.159.98 (seed net 提供給本縣的proxy server)   ，請在：</p>
<p>#cache_peer hostname type 3128 3130之下加入：</p>
<p>cache_peer 139.175.159.98 parent 3128 3130 no-query no-netdb-exchange no-digest</p>
<p>若您要設定同層的Proxy Server為Sibling關係，如：163.17.169.50、163.17.169.52，則加入：</p>
<p>cache_peer 163.17.169.50 sibling 3128 3130 proxy-only</p>
<p>cache_peer 163.17.169.52 sibling 3128 3130 proxy-only</p>
<p>[參數說明]</p>
<p>cache_peer：用來指定擷取快取Proxy的主機。</p>
<p>hostname：是指快取Proxy的主機名稱，也可用ip 。</p>
<p>type：用來指定擷取來源快取Proxy主機的型態，有：parent（上一層）、sibling（同一層）兩種。</p>
<p>3128：是http_port。用來取回所需的cache資料。</p>
<p>3130：是icp_port。用來詢問Server有沒有所需要的資料。</p>
<p>no-query：不做詢問動作，直接擷取資料。（用於parent-chile關係）</p>
<p>no-netdb-exchange：proxy server之間彼此部交換訊息。</p>
<p>no-digest：proxy server之間不建立Digest Table。（只用於Sibling）</p>
<p>proxy-only：直接讀取對方cache資料，而不存入本機。</p>
<p>2. 增加服務的速度</p>
<p>Squid Proxy內定的DNS查詢程式的數量是5，</p>
<p># ps aux |grep squid</p>
<p>root      4388  0.0  0.3  3320  840 ?  S    16:29   0:00 squid -D</p>
<p>squid     4390  0.0  1.7  6020 4396 ?   S    16:29   0:00 (squid) -D</p>
<p>squid     4391  0.0  0.2  1476  700 ?   S    16:29   0:00 (dnsserver)</p>
<p>squid     4392  0.0  0.1  1336  496 ?   S    16:29   0:00 (dnsserver)</p>
<p>squid     4393  0.0  0.1  1336  496 ?   S    16:29   0:00 (dnsserver)</p>
<p>squid     4394  0.0  0.1  1336  496 ?   S    16:29   0:00 (dnsserver)</p>
<p>squid     4395  0.0  0.1  1336  496 ?   S    16:29   0:00 (dnsserver)</p>
<p>從上列中您可發現第一個主服務是由root身分啟動，其他六個則是由squid身分啟動。而其中五個是dnsserver，我們可以增加 dnsserver的數目來增加服務的速度。</p>
<p>#dns_children 5，改為</p>
<p>dns_children 24 ；最大DNS查詢程式數量為32</p>
<p>3. LOG 檔案的處理</p>
<p># logfile rotate 0 </p>
<p>logfile_rotate 1  </p>
<p>此設定必須配合 crontab 執行 /usr/sbin/squid -k rotate，例如我但可以設定在每天的零點二分做一次log 檔的備份，再利用 pwebstats 統計。</p>
<p>4.. 阻擋不良網站</p>
<p>#  不想讓學生玩線上遊戲 或者上到有關 sex 字眼的網站，連在搜尋的地方打上 sex 也擋下來喔!!<br />
# 定義 game這個關鍵字所包含的站名，如 sex ，部份即可<br />
acl game   url_regex   www.kuangchuan.com/game  sex  idolink<br />
# 定義 sex 這個關鍵字所包含的網站<br />
acl sex  dstdomain   playboy.com<br />
# 攔下game , sex 所定義的網站<br />
httpd deny game sex</p>
<p>在 squid 中，應用 acl 的參數，我們可以過濾網站內容，設定的方式也很多種，有興趣可以多研究 squid.conf 中的範例。</p>
<p>七、統量統計<br />
下載以下兩個檔案</p>
<p>fly-1.6.5.Linux-2.1.125-i686.tar.gz</p>
<p>pwebstats-1.3.7.tar.gz</p>
<p>以下# 號後是應輸入的指令</p>
<p># tar xzvf  fly-1.6.5.Linux-2.1.125-i686.tar.gz</p>
<p># cd fly-1.6.5</p>
<p># cp fly /usr/sbin ；放置fly到可執行路徑，原位置也可以，</p>
<p># mv pwebstats-1.3.7.tar.gz /home/httpd/html</p>
<p># cd /home/httpd/html</p>
<p># tar zxvf  pwebstats-1.3.7.tar.gz</p>
<p># cd pwebstats/conf</p>
<p># pe2  squid-proxy.conf .</p>
<p>1. 修改squid-proxy.conf檔裡幾項項目： (以下各行中，# 為註解)</p>
<p># pwebstats configuration file for http server</p>
<p>#</p>
<p># Unique nickname for server.</p>
<p># use only a-z, A-Z and _</p>
<p># e.g. server:proxy</p>
<p>server:PROXY.XXXX.TCC.EDU.TW ；填入Server 名稱</p>
<p># Header for index page.</p>
<p># e.g. Server_header:The TelDem Enterprises Proxy Server</p>
<p>Server_header:台中縣XX國小Proxy Server流量分析</p>
<p># Location of latest log file</p>
<p>logfile:/var/log/squid/access.log；如果有輪換檔，就指定輪換檔access.log.0路徑</p>
<p># Location for the output of pwebstats.</p>
<p># e.g. outdir:/home/servers/http/teldem/proxy-usage</p>
<p>outdir:/home/httpd/html/usage；統計結果的輸出網頁路徑，事先 mkdir</p>
<p># directory containing GIF templates</p>
<p># e.g. templates:/home/servers/http/pwebstats/templates</p>
<p>templates:/home/httpd/html/pwebstats/templates </p>
<p># Stats collection interval</p>
<p># can be one of daily, weekly, monthly, quarterly</p>
<p>interval:daily           ; 統計的週期</p>
<p># Location of &#8216;fly&#8217;</p>
<p># e.g. fly_prog:/home/servers/http/pwebstats/fly/fly</p>
<p>fly_prog:/usr/sbin/fly ；指定fly程式路徑</p>
<p>12. 執行 ./pwebstats -c squid-proxy.conf即可產生流量分析網頁及圖表</p>
<p>13. 為了每天能自動對access.log.0進行分析產生流量分析網頁及圖表，您必須修改crontab，請執行 #crontab -u root -e，在原內容上加入敘述：（設定在做完log輪換檔後執行，每日清晨零點十分整做流量分析）</p>
<p>5 0 * * * /usr/sbin/squid -k rotate  ;</p>
<p>10 0 * * * /home/httpd/html/pwebstats/pwebstats -c</p>
<p>/home/httpd /html/pwebstats/conf/squid-proxy.conf；絕對路徑</p>
<p>14. 在瀏覽器的URL位址輸入：http://hostname/usage/，即可顯示流量分析結果，如下圖顯示：</p>
<p>Internet Access Monitor for Squid</p>
<p>Firewall Analyzer</p>
<p>http://www.adventnet.com.cn/manageengine/products/firewall/help/index.html</p>
<p>面向缓存的站点规划1&#8211;mod_proxy</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>一个利用APACHE的mod_proxy对多个站点进行做WEB加速http acceleration方案：</p>
<p>原先一个站点的规划可能是这样的：</p>
<p>*.*.*.1 culture.a.com<br />
*.*.*.2/*.*.*.3/*.*.*.4/*.*.*.5 news.a.com<br />
*.*.*.6 auto.a.com<br />
&#8230; &#8230;</p>
<p>而在面向缓存服务器的设计中：所有站点都通过外部DNS指向到同一个IP（或者2台到3台）：*.*.*.100/101（举例）</p>
<p>工作原理：<br />
外部请求过来时，根据配置文件设置缓存进行转向解析。这样，服务器请求就可以转发到我们指定的内部地址上。<br />
在处理多虚拟主机转向方面：mod_proxy比squid要简单一些：可以把不同服务转向后后台多个IP的不同端口上。</p>
<p>而squid只能通过禁用DNS解析，然后根据本地的/etc/hosts文件根据请求的域名进行地址转发，后台多个服务器必须使用相同的端口。<br />
但是就性能上来说，专业级别的squid要比mod proxy要优秀的多。</p>
<p>今天先做出apache mod_proxy的文档。 明天应该会做出squid对多个站点进行web加速的文档</p>
<p>基于Apache mod_proxy的反向代理缓存加速实现：<br />
Apache包含了mod_proxy模块，可以用来实现代理服务器，针对后台服务器的反向加速<br />
注：Apache 2.x中mod_proxy已经被分离成mod_proxy和mod_cache：同时mod_cache有基于文件和基于内存的不同实现</p>
<p>实战测试1：<br />
环境：一台sun ultra 60 for solaris 8 运行了bind 9 ，在上面添加了几个虚拟ip分别对应的地址是：<br />
www.my.net 10.1.1.201<br />
ftp.my.net 10.1.1.201<br />
china.my.net 10.1.1.202<br />
试验计划：先安装apache1.3.31，用来配置前面的cache server，然后再安装一个apache1.3.31，用来配置后面真正的web server。放些静态页面，然后做测试，得出结论。<br />
1. 编译apache（用来做cache）</p>
<p>./configure &#8211;prefix=/usr/local/apache-front &#8211;enable-shared=max &#8211;enable-module=most &#038;&#038; make &#038;&#038; make install (请注意参考下面再进行操作）</p>
<p>编译时的错误：</p>
<p>1. ld.so.1: ./gen_test_char: fatal: libexpat.so.0: open failed: No such file or directory<br />
解决：<br />
bash-2.03# pkginfo|grep expat<br />
application SMCexpat expat<br />
然后察看/usr/local/lib发觉目录下有libexpat.so.0这个文件因此只要：<br />
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib<br />
编译可以完成但是启动apache的时候却报错：<br />
Syntax error on line 206 of /usr/local/apache-front/conf/httpd.conf:<br />
Cannot load /usr/local/apache-front/libexec/mod_env.so into server: ld.so.1: /usr/local/apache-front/bin/httpd: fatal: relocation error: file /usr/local/apache-front/libexec/mod_env.so: symbol ap_palloc: referenced symbol not found<br />
../bin/apachectl start: httpd could not be started<br />
如果从配置文件把mod_env.so注释掉又会在模块env_module上报同样错误，看来不能用DSO模式编译<br />
重新编译安装：</p>
<p>./configure &#8211;prefix=/usr/local/apache-front &#8211;enable-module=most &#038;&#038; make &#038;&#038; make install</p>
<p>2. 编译安装web server的apache：</p>
<p>./configure &#8211;prefix=/usr/local/apache-back &#038;&#038; make &#038;&#038; make install<br />
3. 进行相应的配置：</p>
<p>创建/var/www/proxy目录，并且将权限设为nobody:nobody</p>
<p>修改apache-front的httpd.conf：<br />
ServerAdmin admin@my.net<br />
ServerName www.my.net</p>
<p>ProxyPass / http://china.my.net:8080/<br />
ProxyPassReverse / http://china.my.net:8080/<br />
# cache dir root<br />
CacheRoot &#8220;/var/www/proxy&#8221;<br />
# max cache storage<br />
CacheSize 500M<br />
# hour: every 4 hour<br />
CacheGcInterval 4<br />
# max page expire time: hour<br />
CacheMaxExpire 240<br />
# Expire time = (now &#8211; last_modified) * CacheLastModifiedFactor<br />
CacheLastModifiedFactor 0.1<br />
# defalt expire tag: hour<br />
CacheDefaultExpire 1<br />
# force complete after precent of content retrived: 60-90%<br />
CacheForceCompletion 80<br />
CustomLog /usr/local/apache-front/logs/access_log combined</p>
<p>修改apache-back的httpd.conf<br />
Listen 10.1.1.202:8080<br />
ServerAdmin root@my.net<br />
ServerName china.my.net</p>
<p>基本配置就这些，如果有其他要求可以根据实际情况调整配置。</p>
<p>测试：<br />
由于不进行压力测试，主要检查log的记录情况是否同原来不用代理情况一致。简单的放了一个小站点的htdocs文件，然后用telnet的方式访问80口，以及在windows客户端用浏览器访问。由于在实验机上做了简单的dns服务器，因此可以指定dns服务器为10.1.1.198，这样有个缺点就是不能访问internet上的网站了，另一种比较方便的方法是修改windows的hosts文件。添加一行10.1.1.202 china.my.net</p>
<p>结论：<br />
除了速度方面没有进行测试以外，有几个很明显的优点就是：配置方便。log记录和原来一样，只是记录在运行mod_proxy的apache上，这样对于公司使用统计pv值的软件来说就没有问题了！</p>
<p>参考文档：</p>
<p>1. http://www.chedong.com/tech/cache.html 车东的文章：基于反向代理的Web缓存加速——可缓存的CMS系统设计（这篇文章的主要参考文档，我主要加了一下实例的操作）</p>
<p>2. http://www.apache.org apache的主页</p>
<p>3. http://www.squid-cache.org squid的主页</p>
<p>面向缓存的站点规划2&#8211;squid 收藏</p>
<p>squid我对它的了解还不够多，下面的测试仅仅是我实战的记录。可以保证按照这样做可以成功，不过squid.conf肯定还有很多地方配置的不完善，还好，这段时间会一直看这方面的文档。</p>
<p>这篇文章是全文的第二部分，第一部分可以参考面向缓存的站点规划1&#8211;mod_proxy</p>
<p>实战测试2：</p>
<p>1．实验计划：安装squid2.5 stable1，然后打squid-2.5.STABLE1-combined-logs.patch，参考http://www.squid-cache.org/mail-archive/squid-dev/200301/0164.html。进行相应配置，结合上次建立的apache-back，进行测试，检验log格式是不是combined的然后写结论。</p>
<p>友情提示：先别忙着做，因为开始是错误的，会推倒重来的^_^！</p>
<p>2．下载：<br />
wget  http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE1.tar.gz<br />
wget  http://www.squid-cache.org/mail-archive/squid-dev/200301/att-0164/squid-2.5.STABLE1-combined-logs.patch   (事实证明这个patch是没有用的）</p>
<p>3. 打patch<br />
bash-2.03# patch -p0 < squid-2.5.STABLE1-combined-logs.patch<br />
Looks like a unified context diff.<br />
Hunk #3 failed at line 808.<br />
Hunk #4 failed at line 31.<br />
Hunk #5 failed at line 1039.<br />
3 out of 5 hunks failed: saving rejects to ./access_log.c.rej<br />
有错误，先不管它，继续走下去试试</p>
<p>4. 编译：<br />
./configure --prefix=/usr/local/squid --enable-useragent-log --enable-referer-log --enable-default-err-language=Simplify_Chinese &#038;&#038; make &#038;&#038; make install</p>
<p>/opt/test/apache/squid-2.5.STABLE1/src/main.c:601: undefined reference to `mallopt'</p>
<p>推倒重来：查看squid官方网站，发觉stable1是在2002年9月25日就推出的，明显太老，索性换上STABLE6，重新编译，编译方式一样！这次没有那个错误了！不过patch还是有问题，最后也证明patch没有效果的！因此不必打。</p>
<p>5. 配置：<br />
配置squid.conf</p>
<p>http_port 10.1.1.202：80<br />
httpd_accel_host 10.1.1.201<br />
acl acceleratedHost dst 10.1.1.201/255.255.255.255<br />
httpd_accel_port 80<br />
acl acceleratedPort port 8000<br />
httpd_accel_with_proxy on<br />
acl all src 0.0.0.0/0.0.0.0<br />
acl my.net src 10.1.1.0/255.255.255.0<br />
http_access allow acceleratedHost acceleratedPort<br />
http_access allow my.net<br />
http_access deny all</p>
<p>配置httpd.conf<br />
Listen 10.1.1.202:8000</p>
<p>启动apache</p>
<p>/usr/local/apache-front/bin/apachectl graceful</p>
<p>配置环境:<br />
mkdir /usr/local/squid1/var/cache<br />
chown -R nobody:nobody /usr/local/squid1/var/cache<br />
chown -R nobody:nobody /usr/local/squid1/var/logs</p>
<p>启动squid<br />
创建缓存目录：<br />
/usr/local/squid/sbin/squid -z<br />
启动squid<br />
/usr/local/squid/sbin/squid<br />
停止squid：<br />
/usr/local/squid/sbin/squid -k shutdown<br />
启用新配置：<br />
/usr/local/squid/sbin/squid -k reconfig</p>
<p>结论：</p>
<p>性能也没有进行测试，不过按照常理来说性能一定要比mod_proxy强不少。不过怎么样才能使它记录apache的combine格式的日志还没有搞定，郁闷！</p>
<p>apache做反向代理服务器</p>
<p>apache做反向代理服务器<br />
apache代理分为正向代理和反向代理:<br />
1 正向代理: 客户端无法直接访问外部的web,需要在客户端所在的网络内架设一台代理服务器,客户端通过代理服务器访问外部的web(需要在客户端的浏览器中设置代理服务器)<br />
适用于: ①局域网的代理服务器(一般是网关,相当于squid的一般用法)<br />
②访问某个受限网络的代理服务器,如教育网访问某些国外网站需要找代理<br />
2 反向代理: 客户端能访问外部的web,但是不能访问目标web,目标web所在的网络内一台机器充当目标web的代理,客户端直接访问代理就像访问目标web一样(此代理对客户端透明,即客户端不用做如何设置,并不知道实际访问的只是代理而已,以为就是访问的目标)<br />
适用于: ①idc的某台目标机器只对内开放web,外部的客户端要访问,就让另一台机器做proxy,外部直接访问proxy即相当于访问目标<br />
②idc的目标机器的某个特殊的web服务跑在非正常端口如9000,而防火墙上只对外开放了80,此时可在80上做proxy映射到9000,外部访问80即相当于9000<br />
简单示意图如下</p>
<p>本例中<br />
机器192.168.0.114是我们的reverse proxy server<br />
apache/2.0.63运行在其80端口<br />
上面有两个域名的虚拟主机<br />
www.a.org<br />
www.b.org<br />
要实现的效果是:<br />
访问 www.a.org 即相当于访问另一台机器192.168.0.115<br />
访问 www.b.org 即相当于访问本机的9000端口</p>
<p>apache的proxy功能由其proxy模块实现.加载模块有两种方式:静态和动态,现分别说明:<br />
一 静态加载<br />
静态加载,在编译apache时候编译进去,编译参数如下:<br />
"./configure" \<br />
"-prefix=/usr/local/apache3" \<br />
"--enable-so" \<br />
"--enable-rewrite" \<br />
"--with-mpm=prefork" \<br />
"--enable-proxy" \ (这个参数即是代理模块启用)<br />
安装完成后查看模块列表<br />
/usr/local/apache3/bin/httpd -l<br />
显示<br />
Compiled in modules:<br />
core.c<br />
mod_access.c<br />
mod_auth.c<br />
mod_include.c<br />
mod_log_config.c<br />
mod_env.c<br />
mod_setenvif.c<br />
mod_proxy.c<br />
proxy_connect.c<br />
proxy_ftp.c<br />
proxy_http.c<br />
prefork.c<br />
http_core.c<br />
.......<br />
编辑配置文件 httpd.conf<br />
在虚拟主机部分<br />
NameVirtualHost *:80<br />
<VirtualHost *:80><br />
ServerAdmin webmaster@dummy-host.example.com<br />
ServerName www.a.org<br />
ProxyRequests Off<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
ProxyPass / http://192.168.0.115/<br />
ProxyPassReverse / http://192.168.0.115/<br />
</VirtualHost></p>
<p><VirtualHost *:80><br />
ServerAdmin webmaster@dummy-host.example.com<br />
ServerName www.b.org<br />
ProxyRequests Off<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
ProxyPass / http://127.0.0.1:9000/<br />
ProxyPassReverse / http://127.0.0.1:9000/<br />
</VirtualHost></p>
<p>二 动态加载<br />
动态加载:编译进一个已经装好了的apache中(编译为dso模块)<br />
已经装好的apache在 /usr/local/apache2<br />
进入apache源码的模块目录进行编译<br />
cd httpd-2.0.63/modules/proxy/<br />
/usr/local/apache2/bin/apxs -c -i -a mod_proxy.c proxy_connect.c proxy_http.c proxy_util.c</p>
<p>从输出里面看到apache的modules目录下已经产生了mod_proxy.so,且已经在httpd.conf中激活了<br />
cd /usr/local/apache2/conf/<br />
ls ../modules/ 看到确实有mod_prxoy.so<br />
编辑配置文件<br />
vi httpd.conf<br />
修改如下</p>
<p>加载模块<br />
LoadModule proxy_module modules/mod_proxy.so (这句是编译激活时产生的)<br />
LoadModule proxy_http_module modules/mod_proxy.so (这句是要手动添加的)</p>
<p>虚拟主机的部分加上<br />
NameVirtualHost *:80<br />
<VirtualHost *:80><br />
ServerAdmin webmaster@dummy-host.example.com<br />
ServerName www.a.org<br />
ProxyRequests Off<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
ProxyPass / http://192.168.0.115/<br />
ProxyPassReverse / http://192.168.0.115/<br />
</VirtualHost></p>
<p><VirtualHost *:80><br />
ServerAdmin webmaster@dummy-host.example.com<br />
ServerName www.b.org<br />
ProxyRequests Off<br />
<Proxy *><br />
Order deny,allow<br />
Allow from all<br />
</Proxy><br />
ProxyPass / http://127.0.0.1:9000/<br />
ProxyPassReverse / http://127.0.0.1:9000/<br />
</VirtualHost><br />
重启apache生效</p>
<p>注:<br />
如果不加LoadModule proxy_http_module modules/mod_proxy.so,则浏览器页面打不开,页面显示<br />
Forbidden<br />
You don&#8217;t have permission to access / on this server.<br />
日志acess_log里面显示<br />
192.168.0.28 &#8211; - [03/Jun/2009:16:16:27 +0800] &#8220;GET /?sessionId=4293567494722637330&#038;rand=1244014624405&#038;CONTEXT=0&#038;page=com.othe<br />
r.AjaxWhoWhatUpdate&#038;xrand=1244016991554&#038;wwRandId=1244014624405&#038;wwBugId=2341&#038;wwType=View HTTP/1.1&#8243; 403 315<br />
或者<br />
192.168.0.28 &#8211; - [03/Jun/2009:17:10:32 +0800] &#8220;GET / HTTP/1.1&#8243; 403 315<br />
即403错误<br />
日志error_log里面显示<br />
[Wed Jun 03 17:08:46 2009] [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_p<br />
roxy, make sure the proxy submodules are included in the configuration using LoadModule.</p>
<p>Memcached官方：http://danga.com/memcached/</p>
<p>关于Memcached的介绍请参考：Memcached深度分析</p>
<p>memcached主要的作用是为减轻大访问量对数据库的冲击，所以一般的逻辑是首先从memcached中读取数据，如果没有就从数据库中读取数据写入 到memcache中，等下一次读取的时候就可以从memcached中读取了。但在项目中的具体应用策略（也就是哪些数据应该缓存？怎么样缓存？过期策 略？）就是个问题了。</p>
<p>Memcached安装比较简单：</p>
<p>wget wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz<br />
wget http://www.monkey.org/~provos/libevent-1.4.6-stable.tar.gz<br />
tar -zxvf libevent-1.4.6-stable.tar.gz<br />
cd libevent-1.4.6-stable<br />
./configure &#038;&#038; make &#038;&#038; make install<br />
vi /etc/ld.so.conf<br />
新增”/usr/local/lib”<br />
tar -zxvf memcached-1.2.6.tar.gz<br />
cd memcached-1.2.6<br />
./configure –prefix=/usr/local/memcache<br />
make &#038;&#038; make install<br />
cd /usr/local/memcache/bin<br />
./memcached -d -m 10 -u root -l 192.168.100.4 -p 12000 -c 256 -P /tmp/memcached.pid</p>
<p>netstat看一下监听端口，以下证明memcached已经起来了<br />
[root@syslog-250-205 bin]# netstat -nlp | grep 12000<br />
tcp 0 0 10.0.250.205:12000 0.0.0.0:* LISTEN 5124/memcached<br />
udp 0 0 10.0.250.205:12000 0.0.0.0:* 5124/memcached</p>
<p>参数说明</p>
<p>-d选项是启动一个守护进程<br />
-m是分配给Memcache使用的内存数量，单位是MB，我这里是10MB<br />
-u是运行Memcache的用户，我这里是root<br />
-l是监听的服务器IP地址<br />
-p是设置Memcache监听的端口,最好是1024以上的端口<br />
-c选项是最大运行的并发连接数，默认是1024，按照你服务器的负载量来设定<br />
-P是设置保存Memcache的pid文件</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/231/feed</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>如何将magento迁移到其他域名或目录</title>
		<link>http://www.glyle.net/archives/229</link>
		<comments>http://www.glyle.net/archives/229#comments</comments>
		<pubDate>Wed, 11 May 2011 01:12:53 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[magento迁移]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=229</guid>
		<description><![CDATA[或者这个题目叫做如何改变MAGENTO的运行目录
第一，我们需要在PHPMYADMIN备份整个MAGENTO的数据。备份数据并且存为.SQL.
在这儿假设你的测试网站在http://dev.site.com，而你准备迁移的正式运行的路径... ]]></description>
			<content:encoded><![CDATA[<p>或者这个题目叫做如何改变MAGENTO的运行目录</p>
<p>第一，我们需要在PHPMYADMIN备份整个MAGENTO的数据。备份数据并且存为.SQL.</p>
<p>在这儿假设你的测试网站在http://dev.site.com，而你准备迁移的正式运行的路径是http://livesite.com.<br />
第二步，你必须打开你的备份文件（.SQL），查找并且替换所有的 “dev.site.com” 到“livesite.com”. Magento将完整的URL存在数据库中。所以你的网站是运行在完全URL基础之上的。我备份文件中的URL大约17000左右，够巨大的。这一步是必须的，而且必须在导入数据之前完成，不然新的MAGENTO将会全部瘫痪。</p>
<p>现在请不要基于导入你的SQL文件，你还有一步必须做，就是必须强制关闭相关的“数据库关键字的关系”。</p>
<p>请将下面的代码放在你的SQL代码的顶部：</p>
<pre>SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;</pre>
<p>请将下面的代码放在你的SQL代码的底部：</p>
<pre>SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
SET SQL_NOTES=@OLD_SQL_NOTES;</pre>
<p>现在你都准备好了，接下来，请压缩你的SQL文件，结尾为ZIP格式。因为我的原SQL文件大约8MB，但是压缩之后只有500KB，这样可以大大加速上传的时间。记住，请用PHPMYADMIN上传。</p>
<p>好了，现在请拷贝所有的文件和文件夹，从测试路径到实际运行的路径。</p>
<p>你的MAGENTO根目录是http://livesite.com，现在你需要打开http://livesite.com/app/etc/local.xml并且修改其中的数据库连接到（对应livesite.com）.保存你的修改。现在你的MAGENTO应该可以工作了。<br />
这个教程应该可以解决在不同主机中的迁移文件。但是，在个别情况下，你需要重新设置文件夹的权限（CHMOD），例如 /app, /app/etc, /var, /var/log, /var/session 等(755, 775, 777).并删除/var下的缓存文件夹内的所有文件</p>
<p>而且这儿还有一样事情你需要做，那就是 .htaccess文件. 如果你迁移是从一个服务器到另外一个服务器，而且所有的绝对路径是相同的，你不需要做任何事情。</p>
<p>但是如果你是从子文件夹http://livesite.com/store/移动出来，你需要修改.htaccess 中 “RewriteBase /products/” 部分。并且搜索替换SQL中相关的部分，例如“http://dev.site.com”换成“http://livesite.com//products/” 。</p>
<p>希望这些能够帮助你。转载请注明MAGENTO.CC。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/229/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>centos系统的VPS如何安装WHM/CPANEL控制面板</title>
		<link>http://www.glyle.net/archives/226</link>
		<comments>http://www.glyle.net/archives/226#comments</comments>
		<pubDate>Thu, 05 May 2011 00:32:42 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[For Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[cpanel license]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=226</guid>
		<description><![CDATA[1，一般VPS买来时的centos系统会自带apache，要先卸载掉
yum remove httpd -y
2，安装cpanel控制面板：
1.cd /home

2.wget -N http://httpupdate.cpanel.net/latest

3.sh latest 

然后等待….反复的++++…….，40分钟左右。

... ]]></description>
			<content:encoded><![CDATA[<p>1，一般VPS买来时的centos系统会自带apache，要先卸载掉</p>
<pre>yum remove httpd -y</pre>
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">2，安装cpanel控制面板：</p>
<pre><span style="line-height: 19px;">1.<code style="padding: 0px; margin: 0px;">cd /home</code></span>

<span style="line-height: 19px;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">2.<code style="padding: 0px; margin: 0px;">wget -N http://httpupdate.cpanel.net/latest</code></span></code></span>

<span style="line-height: 19px;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">3.<code style="padding: 0px; margin: 0px;">sh latest </code></span></code></span></code></span>

<span style="line-height: 19px;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">然后等待….反复的++++…….，40分钟左右。</span></code></span></code></span></code></span>

<span style="line-height: 19px;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><code style="padding: 0px; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">然后提示成功，<a style="color: #888888; text-decoration: none; padding: 0px; margin: 0px;" href="http://ip:2086/">http://IP/whm</a></span></code></span></code></span></code></span></pre>
<pre>进入WHM安装向导进行基础配置，配置完就进入了WHM面板，</pre>
<pre>运行easy apache，选择需要的环境，重新编译apache</pre>
<p style="line-height: 1.4em; padding: 0px; margin: 0px;"><span style="line-height: 19px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><br />
</span></span></span></span></p>
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">3，购买license</p>
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">购买网址：http://www.buycpanel.com。购买15美金的VPS版本的许可即可，下订单后大概需要pending半天的时间，状态变为active时，就可以使用了</p>
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">4，如果进入WHM面板左边还是提示没有许可的错误，就需要重新加载一下许可文件</p>
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">1. 打开 http://www.cpanel.net/apps/verify 输入你的IP地址查看 cPanel license的状态. 确定是 Active的.</p>
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">
<p style="line-height: 1.4em; padding: 0px; margin: 0px;">2. 然后运行 /usr/local/cpanel/cpkeyclt 即可</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/226/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>为ecshop模板添加属性组合搜索～</title>
		<link>http://www.glyle.net/archives/224</link>
		<comments>http://www.glyle.net/archives/224#comments</comments>
		<pubDate>Tue, 03 May 2011 01:23:20 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[ecshop]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=224</guid>
		<description><![CDATA[可以在分类页面根据商品属性进行筛选，打开模板category.dwt，在合适位置添加以下代码

&#60;!--组合搜索 开始--&#62;
&#60;!--{/foreach}--&#62;
  &#60;/div&#62;
 &#60;/div
 &#60;div&#62;&#60;/div
  &#60;!-- {/if} --
  &#6... ]]></description>
			<content:encoded><![CDATA[<p>可以在分类页面根据商品属性进行筛选，打开模板category.dwt，在合适位置添加以下代码</p>
<pre>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;!--组合搜索 开始--&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;!--{/foreach}--&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span> &lt;/div&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>&lt;/div</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>&lt;div&gt;&lt;/div</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span> &lt;!-- {/if} --</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span> &lt;!--组合搜索 结束--&gt;</div>

&lt;!--组合搜索 开始--&gt;
	  &lt;!--{if $brands.1 || $price_grade.1 || $filter_attr_list}--&gt;
	  &lt;div class="box"&gt;
		 &lt;div class="box_1"&gt;
			&lt;h3&gt;&lt;span&gt;{$lang.goods_filter}&lt;/span&gt;&lt;/h3&gt;
			&lt;!--{if $brands.1}--&gt;
			&lt;div class="screeBox"&gt;
			  &lt;strong&gt;{$lang.brand}：&lt;/strong&gt;
				&lt;!--{foreach from=$brands item=brand}--&gt;
					&lt;!-- {if $brand.selected} --&gt;
					&lt;span&gt;{$brand.brand_name}&lt;/span&gt;
					&lt;!-- {else} --&gt;
					&lt;a href="{$brand.url}"&gt;{$brand.brand_name}&lt;/a&gt;&amp;nbsp;
					&lt;!-- {/if} --&gt;
				&lt;!--{/foreach}--&gt;
			&lt;/div&gt;
			&lt;!--{/if}--&gt;
			&lt;!--{if $price_grade.1}--&gt;
			&lt;div class="screeBox"&gt;
			&lt;strong&gt;{$lang.price}：&lt;/strong&gt;
			&lt;!--{foreach from=$price_grade item=grade}--&gt;
				&lt;!-- {if $grade.selected} --&gt;
				&lt;span&gt;{$grade.price_range}&lt;/span&gt;
				&lt;!-- {else} --&gt;
				&lt;a href="{$grade.url}"&gt;{$grade.price_range}&lt;/a&gt;&amp;nbsp;
				&lt;!-- {/if} --&gt;
			&lt;!--{/foreach}--&gt;
			&lt;/div&gt;
			&lt;!--{/if}--&gt;
			&lt;!--{foreach from=$filter_attr_list item=filter_attr}--&gt;
      &lt;div class="screeBox"&gt;
			&lt;strong&gt;{$filter_attr.filter_attr_name|escape:html} :&lt;/strong&gt;
			&lt;!--{foreach from=$filter_attr.attr_list item=attr}--&gt;
				&lt;!-- {if $attr.selected} --&gt;
				&lt;span&gt;{$attr.attr_value}&lt;/span&gt;
				&lt;!-- {else} --&gt;
				&lt;a href="{$attr.url}"&gt;{$attr.attr_value}&lt;/a&gt;&amp;nbsp;
				&lt;!-- {/if} --&gt;
			&lt;!--{/foreach}--&gt;
			&lt;/div&gt;
      &lt;!--{/foreach}--&gt;
		 &lt;/div&gt;
		&lt;/div&gt;
		&lt;div class="blank5"&gt;&lt;/div&gt;
	  &lt;!-- {/if} --&gt;
	 &lt;!--组合搜索 结束--&gt;<!--组合搜索 结束--></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/224/feed</wfw:commentRss>
		<slash:comments>1554</slash:comments>
		</item>
		<item>
		<title>ecshop让用户名、email均可登录</title>
		<link>http://www.glyle.net/archives/222</link>
		<comments>http://www.glyle.net/archives/222#comments</comments>
		<pubDate>Mon, 18 Apr 2011 01:31:27 +0000</pubDate>
		<dc:creator>果果</dc:creator>
				<category><![CDATA[ecshop]]></category>

		<guid isPermaLink="false">http://www.glyle.net/?p=222</guid>
		<description><![CDATA[更改了integrate.php文件里面的login()函数为：
 function login($username, $password, $remember = null) { if(is_email($username)) { $sql = "select ".$this-&#62;field_name." from ".$this-&#62;table($this-&#62;user_table)." where ".$this-&#62;fiel... ]]></description>
			<content:encoded><![CDATA[<p>更改了integrate.php<span style="word-wrap: break-word; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ff0000; white-space: nowrap;">文件</span>里面的login()函数为：</p>
<pre><br style="word-wrap: break-word; line-height: normal;" /> function login($username, $password<span style="word-wrap: break-word; line-height: normal; color: red;">, $remember = null</span>)<br style="word-wrap: break-word; line-height: normal;" /> {<br style="word-wrap: break-word; line-height: normal;" /> if(is_<strong><span style="word-wrap: break-word; line-height: normal; color: #ff0000;">email</span></strong>($username))<br style="word-wrap: break-word; line-height: normal;" /> {<br style="word-wrap: break-word; line-height: normal;" /> $sql = "select ".$this-&gt;field_name." from ".$this-&gt;table($this-&gt;user_table)." where ".$this-&gt;field_<strong><span style="word-wrap: break-word; line-height: normal; color: #ff0000;">email</span></strong>."='".$username."'";<br style="word-wrap: break-word; line-height: normal;" /> $username = $this-&gt;db-&gt;getOne($sql);<br style="word-wrap: break-word; line-height: normal;" /> if(!$username) return false;<br style="word-wrap: break-word; line-height: normal;" /> //echo $sql;exit;<br style="word-wrap: break-word; line-height: normal;" /> }<br style="word-wrap: break-word; line-height: normal;" /> if ($this-&gt;check_user($username, $password) &gt; 0)<br style="word-wrap: break-word; line-height: normal;" /> {<br style="word-wrap: break-word; line-height: normal;" /> if ($this-&gt;need_sync)<br style="word-wrap: break-word; line-height: normal;" /> {<br style="word-wrap: break-word; line-height: normal;" /> $this-&gt;sync($username,$password);<br style="word-wrap: break-word; line-height: normal;" /> }<br style="word-wrap: break-word; line-height: normal;" /> $this-&gt;set_session($username);<br style="word-wrap: break-word; line-height: normal;" /> $this-&gt;set_cookie($username<span style="word-wrap: break-word; line-height: normal; color: red;">, $remember</span>);<br style="word-wrap: break-word; line-height: normal;" /> return true;<br style="word-wrap: break-word; line-height: normal;" /> }<br style="word-wrap: break-word; line-height: normal;" /> else<br style="word-wrap: break-word; line-height: normal;" /> {<br style="word-wrap: break-word; line-height: normal;" /> return false;<br style="word-wrap: break-word; line-height: normal;" /> }<br style="word-wrap: break-word; line-height: normal;" /> }</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.glyle.net/archives/222/feed</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>

