#/usr/local/apache/bin/apxs-c-i-a/opt/httpd-2.0.52/modules/mappers/mod_rewrite.c
# 编译好后会自动把mod_rewrite.so拷贝到/usr/local/apache/modules下,并修改你的httpd.conf文件.
# vi/usr/local/apache/conf/httpd.conf
RewriteEngine onRewriteCond%{HTTP_REFERER}!
^//www.jb51.net/.*$ [NC]RewriteCond %{HTTP_REFERER} !
^//www.jb51.net$ [NC]RewriteCond %{HTTP_REFERER} !
^http://jb51.net/.*$ [NC]RewriteCond %{HTTP_REFERER} !
^http://jb51.net$ [NC]RewriteRule .*.
(jpg|gif|png|bmp|tar|gz|rar|zip|exe)$
//www.jb51.net/error.htm [R,NC]
到此,我们就对Apache做了一次全面优化,性能比原来明显地有了很大的提高.这次实施过程到此也就圆满的结束了.相信大家通过读完我的这篇文章后,对Apache优化也有了一些心得,相信你在工作中也会处理好突发事件。









