文章

一、安装 # 解压缩 tar jxvf httpd-2.2.2.tar.bz2 cd httpd-2.2.0 # vi server/mpm/worker/worker.c 找到下面几行,并改成如下的数值,其目的是在源码中修改apache可支持的最大线程数和最大客户端数目。 # define DEFAULT_SERVER_LIMIT 256 # define MAX_SERVER_LIMIT 40000 # define DEFAULT_THREAD_LIMIT 256 # define MAX_THREAD_LIMIT 40000 # 编译和安装 apr 1.2 cd srclib/apr ./configure –prefix=/home/liuchao/local/apr make make install # 编译和安装 apr-util 1.2 cd ../apr-util ./configure –prefix=/home/local/apr-util –with-apr=/home/local/apr make make install 优化编译选项及配置apache可加载的模块 patch -p1 < ../mod_limitipconn-0.22/apachesrc.diff /usr/local/apache2.2.3/bin/apxs -c -i -a mod_limitipconn.c /usr/local/apache2.2/bin/apxs -c -i -a mod_evasive20.c 更改2Glogs export CFLAGS=”-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_L
2011-03-10
15分钟阅读时长
7108字
阅读
谷歌的Chart API真是全啊,下面这个就是比较实用的二维码: http://code.google.com/intl/zh-CN/apis/chart/docs/gallery/qr_codes.html
2011-01-30
1分钟阅读时长
32字
阅读
网络看到,记录下。 一般来说,我们判断 iframe 是否加载完成其实与 判断 JavaScript 文件是否加载完成 采用的方法很类似: var iframe = document.createElement("iframe"); iframe.src = "http://www.planabc.net"; if (!/*@cc_on!@*/0) { //if not IE iframe.onload = function(){ alert("Local iframe is now loaded."); }; } else { iframe.onreadystatechange = function(){ if (iframe.readyState == "complete"){ alert("Local iframe is now loaded."); } }; } document.body.appendChild(iframe); 最近, Nicholas C. Zakas 文章《Iframes, onload, and document.domain》的评论中 Christopher 提供了一个新的判断方法(很完美): var iframe = document.createElement("iframe"); iframe.src = "http://www.planabc.net"; if (iframe.attachEvent){ iframe.attachEvent("onload", function(){ alert("Local iframe is now loaded."); }); } else { iframe.onload = function(){ alert("Local iframe is now loaded."); }; } document.body.appendChild(iframe); 几点补充说明: IE 支持 iframe 的 onload 事件,不过是隐形的,需要通过 attachEvent 来注册。 第二种方法比第一种方法更完美,因为 readystatechange 事件相对于 load 事件有一些潜在的问题。
2011-01-13
1分钟阅读时长
244字
阅读
在任何编辑器中,获取光标位置都是非常重要的,很多人可能认为较难,其实只要处理好浏览器的兼容,还是比较容易实现的。
2011-01-13
3分钟阅读时长
1089字
阅读
如何获取当前 select 元素的值
2011-01-13
1分钟阅读时长
257字
阅读
如何在事件代理中正确使用 focus 和 blur 事件
2011-01-13
2分钟阅读时长
563字
阅读
This is a list of the API changes made from 1.2 to 1.3. It allows you to drop the compatibility layer mostly by doing search and replace. If you just want to update to MooTools Core 1.3 with your existing code, see Update from 1.2 to 1.3.
2011-01-13
2分钟阅读时长
360字
阅读
var getRandomColor = function() { return ‘#’ + (‘00000’ + (Math.random() * 0x1000000 « 0).toString(16)).substr(-6); } 网上看到,记录一下。
2011-01-12
1分钟阅读时长
35字
阅读
冰冷的夜,守在窗边,期待归来。 忏悔的心,坐在床头,渴望重来。 对视,哀叹,奇怪又无奈。 说不出话来。 上望着熬过这一晚。
2010-12-15
1分钟阅读时长
57字
阅读
| 对于前端开发来说,经常要面对JS,CSS,图片等资源的缓存更新问题(CDN永久缓存的就另当别论)。 大部分情况,为了节省服务器压力及带宽且又不失可维护性,习惯对这些资源文件添加比较久的缓存时间,这样就给前端开发人员带来一个自动更新的棘手问题。 其实,较简单的解决办法,就是固定周期或有条件的或每次(这样要缓存何用?)的增加随机数击穿缓存,强制更新即可。 这里说一个也较为简单的方式,利用AJAX的访问来更新本地缓存。 原理很简单,使用http协议的 If-Modified-Since 和 Cache-Control 两个header头参数即可。
2010-11-25
2分钟阅读时长
611字
阅读