ubuntu14.04中安装好apache2.4之后默认rewrite模块是不开启的,项目public目录下的.htaccess文件就用不了,在浏览器中访问网页总是报500错误,原因就是这个。

执行下面的命令,开启rewrite模块:

$ sudo a2enmod rewrite
$ sudo service apache2 restart

然后再刷新页面,Works!

这个问题在很早以前第一次建立项目的时候就遇到过,当时花半天找到原因解决了,然后也没记下来,直到今天,想在本地的新装的系统上弄个小项目,又遇到了这个问题,又搞了半天,所以就记录在此。

Ubuntu 中 apache 开启 rewrite 模块的更多相关文章

  1. 【转】CentOs中Apache开启rewrite模块详解

    rewrite是apache环境的一个伪静态功能了,如果我们没有没让Apache开启rewrite功能,网站上所有的rewrite规则都不可使用. centos的配置文件放在: /etc/httpd/ ...

  2. ubuntu apache开启重写模块

    http://www.iblue.cc/2011/09/ubuntu-apache%E5%BC%80%E5%90%AF%E9%87%8D%E5%86%99%E6%A8%A1%E5%9D%97/ Ubu ...

  3. ubuntu 开启 rewrite 模块

    1.sudo a2enmod rewrite 开启Rewrite模块 (停用模块,使用 a2dismod) 2. 在/etc/apache2/ 修改apache2.conf 文件中把AllowOver ...

  4. apache开启rewrite重写

    命令开启 sudo a2enmod rewrite sudo /etc/init.d/apache2 restart 即可开启重写,不行的话再试下下面方法 ubuntu如何开启Rewrite模块 在终 ...

  5. Ubuntu 下apache2开启rewrite隐藏index.php

    为了实现 http://www.example.com/route/route 而不是 http://www.example.com/index.php/route/route 需要开启apache2 ...

  6. debian下为apache启用rewrite模块

    如果我们是自己编译的apache,那么启用或禁用某个模块应该说是比较容易的事,只要修改apache的配置文件就可以了.但是我们没有理由不用已经做好的二进制文件进行安装,使用apt-get要方便多了. ...

  7. Apache开启Rewrite伪静态

    环境:Windows 2003 Apache 2.2 加载Rewrite模块 在conf目录下httpd.conf中找到 去掉# LoadModule rewrite_module modules/m ...

  8. ubuntu中apache的ssl证书配置及url重写

    一.https原理 借用网上的图(图片来源: https://www.cnblogs.com/xiohao/p/9054355.html ),用到了对称加密和非对称加密.    二.ubuntu的ap ...

  9. CentOS下Apache开启Rewrite功能

    1.centos的配置文件放在: /etc/httpd/conf/httpd.conf 打开文件找到: LoadModule rewrite_module modules/mod_rewrite.so ...

随机推荐

  1. Step by Step Learn Python(1)

    print "Hello World!" action = raw_input("please select your action{1, 2, 3, 4, 5, 6, ...

  2. CentOS 5.5 下修改Apache默认端口80

    打开  /etc/httpd/conf/httpd.conf  文件 修改两个地方     #Listen 12.34.56.78:80     Listen 80 #把80改为你设置的端口,我设置端 ...

  3. Ubuntu14.04下安装docker 1.9

    有以下几种方式: 1. 通过系统自带包安装(可能不是最新版) $ sudo apt-get update $ sudo apt-get install -y docker.io $ sudo ln - ...

  4. CYQ学习主要摘要2

    数据库配置假设如下: <connectionStrings>         <add name="Conn" connectionString="Se ...

  5. 在MAC上安装Oracle JDK

    下载Mac版本的JDKhttp://www.oracle.com/technetwork/java/javase/downloads/index.html 下载之后,双击dmg文件安装 mac 下查看 ...

  6. 快速创建各种类型的NSAttributeString和NSMutableParagraphStyle

      NSDictionary *attributes = @{ NSForegroundColorAttributeName : [ UIColorredColor ], NSFontAttribut ...

  7. Python 实现抽象类的两种方式+邮件提醒+动态导入模块+反射(参考Django中间件源码)

    实现抽象类的两种方式 方式一 from abc import ABCMeta from abc import abstractmethod class BaseMessage(metaclass=AB ...

  8. 使用libjpeg 压缩yuv420到jpg (内存方式)

    #include <Windows.h> #include <stdio.h> extern "C" { #include <jpeglib.h> ...

  9. 一款纯css3实现的发光屏幕旋转特效

    今天给大家带来一款纯css3实现的发光屏幕旋转特效.该屏幕由纯css3实现带发光旋转特效,效果图如下: 在线预览   源码下载 实现的代码. html代码: <div class="s ...

  10. 代码审计之Finecms任意文件下载漏洞

    PS:该漏洞已被公布,只是学习.故自己跟着大佬的步伐审计. 文件地址:\controllers\ApiController.php Line 57 public function downAction ...