Linux下Apache怎么安装/增加mod_rewrite模块

这篇文章主要介绍“Linux下Apache怎么安装/增加mod_rewrite模块”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Linux下Apache怎么安装/增加mod_rewrite模块”文章能帮助大家解决问题。

茫崖网站建设公司创新互联,茫崖网站设计制作,有大型网站制作公司丰富经验。已为茫崖上千家提供企业网站建设服务。企业网站搭建\外贸营销网站建设要多少钱,请找那个售后服务好的茫崖做网站的公司定做!

以fedora操作系统进行举例:
1)首次安装apache,在编译时增加——enable-rewrite选项。
如。/configure ——prefix=/usr/local/apachel ——enable-so ——enable-mods-shared=all ——enable-rewrite ——enable-cache
2)增加mod_rewrite模块
# find . -name mod_rewrite.c //在apache的源码安装目录中寻找mod_rewrite.c文件
# cd path/to/mod_rewrite.c //进入包含mod_rewrite.c文件的目录
# /usr/local/apache/bin/apxs -c mod_rewrite.c //apxs应指定绝对路径,在你当前正在使用apache的bin目录里
# /usr/local/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了。
vicos注:完成之后,记得重启服务器apache.

关于“Linux下Apache怎么安装/增加mod_rewrite模块”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注创新互联行业资讯频道,小编每天都会为大家更新不同的知识点。


本文标题:Linux下Apache怎么安装/增加mod_rewrite模块
文章路径:http://myzitong.com/article/jgecsd.html