Linux下Apache安装/增加mod_rewrite模块的方法
更新时间:2011年04月02日 22:44:47 作者:
如果你的apache已经安装好了,现在只想编译出mod_rewrite.so模块,在apache中进行加载,下面我们就介绍这个方法。
如果你的服务器apache还没有安装,那很简单,在编译apache时将mod_rewrite模块编译进去就可以,相关文档可以在http://man.chinaunix.net/newsoft …… ew/mod/mod_rewrite. html中找到。如果你的apache已经安装好了,现在只想编译出mod_rewrite.so模块,在apache中进行加载,下面我们就介绍这个方法。
以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.
以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.
您可能感兴趣的文章:
- 开启Apache mod_rewrite模块示例代码
- 13个实用的Apache Rewrite重写规则
- Apache伪静态Rewrite详解
- 如何在Ubuntu下启动Apache的Rewrite功能
- 浅析Apache中RewriteCond规则参数的详细介绍
- 浅谈apache和nginx的rewrite的区别
- Apache Rewrite实现URL的301跳转和域名跳转
- apache中通过mod_rewrite实现伪静态页面的方法
- Apache Rewrite url重定向功能的简单配置
- 让Apache支持Rewrite静态页面重写的方法
- Linux下Apache安装/增加mod_rewrite模块的方法
- apache urlrewrite防盗链功能配置
- 学习Apache的mod rewrite、access写法
- Apache rewrite的重写相关的参数说明
- Apache中利用mod_rewrite实现防盗链
- Apache rewrite重写规则的常见应用
- apache rewrite_module模块使用教程
- apache的rewrite规则使用说明
相关文章
CentOS 5.11服务器安装配置LAMP服务器(Apache+PHP5+MySQL)
这篇文章主要介绍了CentOS 5.11服务器安装配置LAMP服务器(Apache+PHP5+MySQL),需要的朋友可以参考下2016-10-10Linux执行可执行文件提示No such file or directory的解决方法
这篇文章主要介绍了Linux执行可执行文件提示No such file or directory的解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2020-05-05Apache服务器关闭TRACE Method请求方式的方法
这篇文章主要介绍了Apache服务器关闭TRACE Method请求方式的方法,因为支持该方式的服务器存在跨站脚本漏洞,需要的朋友可以参考下2014-06-06CentOS 6.3 安装配置Apache2.2.6的方法(源码编译安装)
这篇文章主要介绍了CentOS 6.3 安装配置Apache2.2.6的方法,需要的朋友可以参考下2014-11-11
最新评论