Linux 技术手札

Linux 下编译 Apache 的 mod_rewrite

要为 Apache 加载 mod_rewrite 模组,如果 Apache 并未安装,可以在编译时加上 –enable-rewrite 便可以,但如果 Apache 已经安装好,而又不想重新编译 Apache 的话,可以用以下方法:

1. 首先 cd 到 Apache 的源代码目录并到 mod_rewrite.c 档案,

1. 在apache的源码安装目录中寻找mod_rewrite.c文件

2. 进入 mod_rewrite.c 的目录并用 apxs 编译 mod_rewrite.c

3. 编译好 mod_rewrite.c 后,便开启 httpd.conf 加入以下内容:

LoadModule rewrite_module modules/mod_rewrite.so

然后重新启动 Apache 便可以了。

Exit mobile version