Apache2 + PHP 在Windows2000下不稳定解决方案
来源:互联网 发布:怎么把淘宝店排名靠前 编辑:程序博客网 时间:2024/05/09 06:41
1 制作一个bat文件在计划任务里面定期(每天夜里)执行:然后删除旧的日志文件,避免文件过大
apache -k shutdown
move /Y access_log access_log.old
move /Y error_log error_log.old
apache -k start
2 [httpd.conf]
ThreadsPerChild 250
MaxRequestsPerChild 30 <- 这个可以为100,但最好不要为0
Win32DisableAcceptEx <-这个
3 使用更详细日志捕捉死机时访问的页面
LogFormat "%h %l %u %t /"%r/" %>s %b /"%{Referer}i/" /"%{User-Agent}i/"" combined
记录refer可以帮助确认发生问题的请求来自什么页面,以判断是否受到攻击
可以使用"%400,501{User-agent}i" "%!200,304,302{Referer}i" 来捕捉特定需要的log
4 在计算机管理->性能中,启动性能日志和警报->计数器日志->System Overview。根据一段时间的监测的数据,在系统监视器里面查看,找到发生死机的异常时候,内存,CPU的极值的规律。然后在警报里面,如果超过,或接近某个极值,执行重起apache命令。
5 无论如何在你的程序里面加上缓存机制:无论是通过生成静态html页面或者设置meta expired为几分钟
6 在php.ini里面,将output_buffering=On 不要设置具体的数值
7 对于文件下载,使用以下的方法,而不要使用readfile
//readfile($file);
$fd = @fopen($file, rb);
if(!$fd) {
print "Bad entry: $entry
";
continue;
}else {
flock($fd,LOCK_SH);
$contents = fread($fd, $size);
}
fclose ($fd);
8 为了防止多线程下载,给Apache 加上mod_limitipconn
MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=565080
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- Apache2 + PHP 在Windows2000下不稳定解决方案
- 业务人员用的软件=BPEL+SOA
- 用YUI Ajax 库改造的 phpBB
- 从一个工作流流转中人员设定的例子看WBISF流程引擎所定义的用户授权安全模型
- Semantic Web,我们来了
- M$的DHTML Editor 使用心得
- Apache2 + PHP 在Windows2000下不稳定解决方案
- 多核新观念-象使用内存一样使用CPU?
- 并行版本控制的好帮手--WinMerge
- SOA和ESB,摘录自virtuas公司
- J2ME平台A-RPG游戏怪物寻路算法初探
- SOA和ESB,摘录自virtuas公司
- IBM收购Bowstreet
- 美国劳动局薪金排行-IT仍是收入最高的行业
- 根据需求选择合适的Linux发行版本