[转]Apache & Squid优化 加速高负荷Web访问

2008-09-03,星期三 | 分类:Web开发, 开发环境, 转载 | 标签:, , , | 111 views
来自 Copyleft#华大桑梓-Prince 在实际环境中,元素丰富的页面产生的服务器负担不能小觑。几个月前配置的Apache最近终于撑不住了,在连接数达到1000的时候,页面访问已经相当迟缓,到了非优化不可的地步。     由于网站还提供在线音乐,怀疑是由于百度和迅雷的盗链影响,d4e上很多人都在反应迅雷对他们站点的影响很恶劣。 在Apache中启用防盗链(需要mod_rewrite支持 ) 附上.htaccess配置文件 RewriteEngine  On RewriteCond %{HTTP_HOST} !([a-zA-Z]*\.)?sends.cc$ [NC] [OR] RewriteCond %{HTTP_REFERER} !^http://([a-zA-Z]*\.)?sends.cc/.*$ [NC] RewriteRule \.(mp3|wav|flv|gif|jpg|wma)$ - [F]     如上配置,在一定程度上缓解了服务器压力。Apache此时差不多可以顶1400个连接数,由此也引来一个问题,Apache子进程大量派生,Load average经常都上100(2×2核心,单个CPU此时的load大约在25左右(危急状态)。 Apache默认MaxRequestsPerChild为0,子进程在完成所有请求仍然不会退出,处于等候状态。在Apache2.conf中将其修改为适当的数字,我将其改成10000,子进程在处理完10000个Web请求之后自动退出,不再占用系统资源。

[转]Install PHP

2008-09-03,星期三 | 分类:MySQL, PHP, Web开发, 开发环境, 数据库, 转载 | 标签:, , , | 183 views
 Table of Contents Overview Pre-installation notices Download and unpack PHP configuration and integration     Configure PHP to use in command prompt     Configure Apache Service     Configure IIS FastCGI         Configure IIS 5.1 (Windows XP) or 6.0 (Windows Server 2003)         Configure IIS 7 (Windows Vista SP1 and Windows Server 2008)         Testing your configuration Overview Using this installation gude you can: create different PHP.INI ...

[原]Windows 环境下安装 Apache + MySQL + PHP5 + ZendDebug

2008-09-01,星期一 | 分类:原创, 开发环境 | 标签:, , , , | 385 views
1.安装Apache2.2 安装apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi 选项填写如下 [NetWork Domain] 127.0.0.1 [Server name] 127.0.0.1 [Email Address] xxxx@xxx.xxx 选择 for alluser,port 80 选择custom,选择全部安装 2.安装PHP5 解压缩php-5.2.6-Win32.zip 设置PHP5安装路径,例如D:\PHP5 将目录下的php.ini-dist复制一份并重命名为php.ini 找到标有如下选项的地方 ...