1.寻找apache源码安装目录中的mod_rewrite.c文件
#find / -name mod_rewrite.c
/usr/httpd-2.2.22/modules/mappers/mod_rewrite.c
2.切换到mod_rewrite.c文件目录
#cd /usr/httpd-2.2.22/modules/mappers/
3.编译
#/usr/apache/Apache2.2/bin/apxs -c mod_rewrite.c
#/usr/apache/Apache2.2/bin/apxs -i -a -n mod_rewrite mod_rewrite.la
在/usr/apache/Apache2.2/modules中会编译好mod_rewrite.so
4.如果是Apache2.2.22版本
LoadModule mod_rewrite_module modules/mod_rewrite.so 前面添加#注释符;