Linux Apache mod_rewrite模块 Linux下Apache安装/增加mod_rewrite模块的方法

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

Linux Apache mod_rewrite模块 Linux下Apache安装/增加mod_rewrite模块的方法

  2021-03-18 我要评论
想了解Linux下Apache安装/增加mod_rewrite模块的方法的相关内容吗,在本文为您仔细讲解Linux Apache mod_rewrite模块的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点: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.

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们