Home >Backend Development >PHP Tutorial >Alibaba Cloud Ubuntu system + Apache2 + PHP build gitblog

Alibaba Cloud Ubuntu system + Apache2 + PHP build gitblog

WBOY
WBOYOriginal
2016-08-08 09:19:141046browse

阿里云Ubuntu系统+Apache2+PHP搭建gitblog

Apache2以及PHP的安装这里就不介绍了,网上一大堆。唯一需要总结的就是gitblog安装过程中的问题需要解决。

我遇到的问题是无法生成404 Not Found

需要apache支持rewrite, 改动有三处

  1. 修改内容apache2.conf, 在末尾加上

    LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

  2. 修改 “AllowOverride None” 中的 “None” 为 “All”;

    <code>Options FollowSymLinks
    AllowOverride All
    Require all denied
    </code>
  3. 在网站的根目录添加.htaccess,内容如下

    <code>RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    RewriteRule ^(.*)$ /index.php/$1 [L]
    </code>

版权声明:本文为博主原创文章,未经博主允许不得转载。

以上就介绍了阿里云Ubuntu系统+Apache2+PHP搭建gitblog,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Nginx reverse proxy demoNext article:Nginx reverse proxy demo