ITeye博客

apache httpd mod_rewrite

vanghoh · 2012-06-01 15:36 · 非技术 · Markdown

安装:

1.如果为初次安装apache,在编译时增加--enable-rewrite选项。 

./configure --prefix=/usr/local/apachel --enable-so --enable-mods-shared=all --enable-rewrite --enable-cache 

2.如果已安装apahe httpd,但通过./apachectl -l发现未安装mod_rewrite,增加mod_rewrite模块方法:

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

find . -name mod_rewrite.c

# 进入包含mod_rewrite.c文件的目录 

cd PATH/to/mod_rewrite.c

# 完成后apache的modules目录中会有mod_rewrite.so文件。 

/usr/local/apache/bin/apxs -c mod_rewrite.c 

/usr/local/apache/bin/apxs -i -a -n mod_rewrite mod_rewrite.la 

 

 

# 编辑httpd.conf文件,加入: 

LoadModule rewrite_module modules/mod_rewrite.so

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。