添加虚拟主机
<virtualhost 127.0.0.1:50001>
</virtualhost>
这里新添加了50001端口来进行监听,所以还需要添加监听端口号
Listen 50001要让程序能正常运行,还得通过配置ScriptAlias来允许服务器在指定的情况下,以CGI方式运行。
<virtualhost 127.0.0.1:50001>
ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/
</virtualhost>
所以上述的配置会告诉apache,所以以/cgi-bin/开头的资源都会被映射到/usr/local/apache/cgi-bin/目录下,并被认为是cgi程序。然后重启服务器
继续阅读 »
HTTP压缩对于纯文本内容可压缩至原大小的40%一下,从而提供60%以上的数据传输节约,虽然WEB服务器会因为压缩导致CPU占用的略微上升,但是可以节约大量用于传输的网络IO。对于数据压缩带来的用户浏览速度提升(让页面符合8秒定律),这点总体负载5%-10%上升是非常值得的。毕竟通过数据压缩会比通过不规范的HTML代码优化要方便得多。 继续阅读 »


There are a number of ways to improve the amount of time it takes visitors to load your Drupal powered web site.
Measurements
There are many tools that can be used to measure page load performance on your website. Here are some that we recommend.
- YSlow FireFox add-on
The YSlow FireFox add-on is maintained by Yahoo. It analyses your web page and offers a simple to understand report explaining why your website is slow to load. The tool requires that the Firebug FireFox add-on also be installed. Visit http://developer.yahoo.com/yslow/ for complete details on using the FireFox add-on. 继续阅读 »
Apache mod_rewrite规则重写的标志一览
R[=code](force redirect) 强制外部重定向
强制在替代字符串加上http://thishost[:thisport]/前缀重定向到外部的URL.如果code不指定,将用缺省的302 HTTP状态码。
F(force URL to be forbidden)禁用URL,返回403HTTP状态码。
G(force URL to be gone) 强制URL为GONE,返回410HTTP状态码。
P(force proxy) 强制使用代理转发。
L(last rule) 表明当前规则是最后一条规则,停止分析以后规则的重写。
N(next round) 重新从第一条规则开始运行重写过程。
C(chained with next rule) 与下一条规则关联 继续阅读 »