15
Mar
今天终于把apache的rewrite搞定了,特别要感谢hilton和chedong两位的文章,在这里要对他们文章补充的是,apache安装rewrite模块的时候需要DBM支持,否则无法编译,所以首先要安装一个GDBM,然后在编译rewrite的时候用如下命令:
gcc -DLINUX=22 -fpic -DSHARED_MODULE -I/usr/local/apache/include
-Wall,-O6,-mpentiumpro -I/usr/include/gdbm -c mod_rewrite.c
gcc -shared -o mod_rewrite.so mod_rewrite.o -lgdbm -Wc,-Wall,-O6,-mpentiumpro
mv rewrite.so /usr/local/apache/libexec/
然后在http.conf配置文件里加上:
LoadModule rewrite_module libexec/mod_rewrite.so
接下来用/usr/local/apache/bin/apachectl stop停止apache,然后用再start,千万注意,在这里不能用restart或者graceful参数来重新启动apache,必须先停止,然后再开始,或者是reboot机器,否则rewrite将不起作用,我就是在这里找原因找
了很长时间,呵呵。剩下的部分他们二位的文章已经说得非常清楚了,我在这里就不说了哈。













发表评论
字体为 粗体 是必填项目,邮箱地址 永远不会 公布。
允许部分 HTML 代码:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>URIs must be fully qualified (eg: http://shunz.net/) and all tags must be properly closed.
超出部分系统将会自动分段及换行。
请保证评论内容是与日志或 Blog 内容相关的,灌水、攻击性或不恰当的评论 may 会被编辑或删除。