Apache 安装 mod_rewrite 模块(ubuntu)
Posted 11 months, 1 week ago at 11:32 am. 0 comments
编辑
/etc/apache2/httpd.conf
加入
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
如果你的服务器apache还没有安装,那很简单,在编译apache时将mod_rewrite模块编译进去就可以,相关文档可以在www.gbunix.com中找到。如果你的apache已经安装好了,现在只想编译出mod_rewrite.so模块,在apache中进行加载,下面我们就介绍这个方法。
以Solaris操作系统进行举例:
# PATH=/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:$PATH
# export PATH
# which gcc
# which make
# find ./ -name mod_rewrite.c //在apache的安装目录中寻找mod_rewrite.c文件
# cd PATH/to/mod_rewrite.c //进入包含mod_rewrite.c文件的目录
# apxs -c mod_rewrite.c //apxs请指定绝对路径,在你当前正在使用apache的bin目录里
# apxs -i -a -n mod_rewrite mod_rewrite.la
如果没有什么错误的话,应该在你的apache的modules目录中编译出一个mod_rewrite.so文件。
编辑httpd.conf文件,确认httpd.conf中已经包含mod_rewrite.so的加载语句,如下:
LoadModule rewrite_module modules/mod_rewrite.so
这时,你的apache应该已经支持rewrite了。
Popularity: 12% [?]
Tags: ubuntu, unixRelated posts
No Replies
Feel free to leave a reply using the form below!