<?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>Li Yue [学习笔记] &#187; web优化</title>
	<atom:link href="http://www.liyue.org/tech/archives/category/seo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.liyue.org/tech</link>
	<description>技术笔记</description>
	<lastBuildDate>Sun, 18 Jul 2010 02:14:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Apache自定义错误信息并跳转到各自网站首页</title>
		<link>http://www.liyue.org/tech/archives/203</link>
		<comments>http://www.liyue.org/tech/archives/203#comments</comments>
		<pubDate>Fri, 08 Jan 2010 06:06:01 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[web优化]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=203</guid>
		<description><![CDATA[一、自定义错误信息页面，并根据所请求的URL所在的域，跳转到所在域名。 二、自定义APACHE错误信息，指定错误信息页面。配置文件里面有例子信息，去掉下面的注释符号#，激活。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Alias /error/ &#34;/usr/local/apache2/error/&#34; &#160; &#60;Directory &#34;/usr/local/apache2/error&#34;&#62; AllowOverride None Options IncludesNoExec AddOutputFilter Includes html AddHandler type-map var Order allow,deny Allow from all LanguagePriority en [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/203/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache性能优化之启用gzip压缩</title>
		<link>http://www.liyue.org/tech/archives/199</link>
		<comments>http://www.liyue.org/tech/archives/199#comments</comments>
		<pubDate>Mon, 30 Nov 2009 13:36:39 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[web优化]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[mod_deflate]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=199</guid>
		<description><![CDATA[首先查看apache是否加载了mod_deflate.so模块，如果没有需要安装加载。 找到并下载和当前apache版本相同的源码文件，解压缩到/home目录下， 在apache安装目录下执行： /usr/local/apache2/bin/apxs -i -c /home/httpd-2.0.63/modules/filters/mod_deflate.c 会自动在 httpd.conf添加 LoadModule deflate_module modules/mod_deflate.so 添加如下设置： &#60;IfModule mod_deflate.c&#62; &#60;Location /&#62; #Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems… BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/199/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache安全性调整</title>
		<link>http://www.liyue.org/tech/archives/197</link>
		<comments>http://www.liyue.org/tech/archives/197#comments</comments>
		<pubDate>Mon, 30 Nov 2009 12:44:00 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[web优化]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=197</guid>
		<description><![CDATA[对 web服务器进行安全性端口扫描，发现一些问题，apache加以调整： 1、HTTP TRACE method 需要关闭HTTP TRACE 方法，检测apache是否打开了trace方法，使用如下方法： telnet 127.0.0.1 80 Trying 127.0.0.1&#8230; Connected to 127.0.0.1. Escape character is &#8216;^]&#8217;. TRACE / HTTP/1.0 Host: foo 然后按两次回车，出现下面的信息，证明方法激活了。 HTTP/1.1 200 OK Date: Sat, 20 Oct 2007 20:39:36 GMT Server: Apache/2.2.6 (Debian) Connection: close Content-Type: message/http TRACE / HTTP/1.0 Host: foo 否则会出现： HTTP/1.1 403 Forbidden 等信息。 解决方法：修改httpd.conf，修改如下数值：TraceEnable Off [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/197/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache配置支持SHTML</title>
		<link>http://www.liyue.org/tech/archives/180</link>
		<comments>http://www.liyue.org/tech/archives/180#comments</comments>
		<pubDate>Sat, 24 Oct 2009 02:37:36 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[web优化]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=180</guid>
		<description><![CDATA[一、前言 CMS中模板用置标嵌套头尾模板的方法，方便快捷，但是存在弊端，当文档数据量庞大时，只要嵌套的头尾模板稍有改动，就得完全发布站点才能更新所有的文档模板。数据量有几十万条，这个就是噩梦。使用SSI技术，将头尾作为独立文件嵌入到页面中，只要更新发布头尾文件就可以了。 二、Apache配置 Apache默认是不支持SSI的，更改httpd.conf来进行配置。 搜索“AddType text/html .shtml”，找到下面两行： # AddType text/html .shtml # AddOutputFilter INCLUDES .shtml 将这两行前面的#注释去掉。 搜索下面的默认页配置： DirectoryIndex index.html index.htm 将index.shtml放到第一个位置 DirectoryIndex index.shtml index.html index.htm 接下来修改虚拟主机配置来支持shtml 例如下面的虚拟主机配置： &#60;VirtualHost *:80&#62; ServerAdmin webmaster@cas.cn &#60;Directory &#34;/var/web/casweb/cas&#34;&#62; Options -Indexes FollowSymLinks Includes Order allow,deny Allow from all &#60;/Directory&#62; DocumentRoot /var/web/casweb/cas/ ServerName www.cas.cn ErrorLog logs/www.cas.cn-error_log TransferLog &#34;&#124;/usr/local/sbin/cronolog /usr/local/apache2/logs/www.cas.cn-%Y%m%d-access_log&#34; &#60;/VirtualHost&#62; 蓝色的Includes是在原来的基础上增加的。 三、SSI页面调用方法 [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/180/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>高性能Web Site与YSlow（2）-Make fewer HTTP requests</title>
		<link>http://www.liyue.org/tech/archives/155</link>
		<comments>http://www.liyue.org/tech/archives/155#comments</comments>
		<pubDate>Fri, 20 Feb 2009 08:20:45 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[web优化]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[yslow]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=155</guid>
		<description><![CDATA[　　在YSlow性能分析的第一条标准就是“Make fewer HTTP requests”。网站的响应时间大部分花费在前端，浏览器从服务器下载images、js 、flash等文件。在保持内容不变的情况下，首要做的就是减少浏览器请求文件的数量，网页中每个图标文件都需要发生一次请求。http协议是建立在请求/响应模式下的，浏览器发送请求信息（包括请求方法、URI、版本号等客户端信息）给服务器，服务器返回状态码，服务器信息、实体内容等。整个过程应该是首先浏览器和服务器先建立一个socket连接，然后客户端发送请求、服务器响应，关闭连接。默认情况是一个socket连接只能发生一次请求。那样的话，要打开一个网页，就可能重复上面的（连接、请求、响应、关闭连接）的过程N次，非常耗时。所以，在WEB服务器上可以进行配置可以使socket连接在一定时间内允许进行多个请求。例如，apache中的KeepAlive 设置为On时就可以。  　　在这基础上，再减少资源的数目，方法是将资源合并。CSS文件尽量外连，并合并到一个.css文件中，不同的用途之间可以用注释分隔符隔开区分。js文件同样是，图片可以采用CSS Sprites方法将小图合并到一张大图中，利用css定位，根据需要显示大图中的部分图像。例如，下面的导航菜单，当鼠标移动到菜单项，会显示不同的颜色的图片，而当前页又会显示另外一个颜色的图片。传统做法是做三个不同状态的图片，配合js切换。 　　按照CSS Sprites方法，三个状态图片合并到一张图： 常态下，只显示上面的图片，当鼠标hover的时候，样式如下 li a:hover span &#123;background-position: 0 -26px; border-bottom-color: #5f5f5f;&#125; 图像的Y轴坐标上移26px（每个小图的高度正好是26px）,显示的是中间的图。当前页的时候，显示下面图： li.selected a:hover span &#123;background-position: bottom left;&#125; 　　图像的处理还有一种就是maps，在一张大图上，做热区连接，但是不推荐。  　　本节只有CSS Sprites有些技术含量，其他的应该是工作习惯。]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/155/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>高性能Web Site与YSlow（1）-Gzip</title>
		<link>http://www.liyue.org/tech/archives/114</link>
		<comments>http://www.liyue.org/tech/archives/114#comments</comments>
		<pubDate>Wed, 18 Feb 2009 09:13:54 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[web优化]]></category>
		<category><![CDATA[yslow]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=114</guid>
		<description><![CDATA[　　在FireFox下发现对网站性能评分的好工具YSlow，可以根据网站进行13类别性能评分，等级A-F，A最好，F最差。YSlow下载网址：http://developer.yahoo.com/yslow/，在download按钮下面有个提示：Install Firebug first!，需要先安装Firebug，http://getfirebug.com/，安装完成后，可以在FireFox的状态栏右边，看到YSlow图标，点击后就在浏览器的下半部出现分析窗口。点击上面的Performance，开始对当前网页进行性能分析，给出如下的13项得分： 　　下面是各项性能的评分： 　　项目后面有箭头的，可以点开看看他的建议。先看看第4. Gzip components，Gzip的作用是网页数据在传输给浏览器前，服务器端先压缩，这样可以大大减少网络带宽。Gzip的压缩比很高。在启用Gzip之前，先看看网站是否已经启用了gzip，在下面测试网站可以测试：http://www.whatsmyip.org/mod_gzip_test/ 　　输入网址后，在下面会告诉你是否网站启用了Gzip，如果启用了，可以看到压缩前后的对比，压缩比高达79.59%。下面的一段是测试你的浏览器是否支持Gzip，现在几乎所有的浏览器都支持。如果没有启用，还需要看看服务器是否支持Gzip，可以在站点下建立php测试文件。phpinfo.php，文件内容为，在浏览器访问phpinfo.php，看看有没有Zlib这么一段有就支持。 　　然后就可以通过站点根目录下的.htaccess文件来启用Gzip。打开文件，加入下面一行 AddOutputFilter DEFLATE html xml php js css 　　保存就可以了。 有兴趣的可以看一下，YouTobe上的视频High Performance Web Sites and YSlow ：http://www.youtube.com/watch?v=BTHvs3V8DBA]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/114/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
