下载地址

https://github.com/jockchou/gitblog/releases

安装ubuntu 14.04 + apache2 + php

1
apt-get install apache2 libapache2-mod-php5 php5

开启rewrite

1
gitblog利用了apache2的伪静态技术,需要rewrite模块的支持
  1. 修改/etc/apache2/apache2.conf,文件末尾添加

    1
    
    LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
    
  2. apache2.conf搜索directory字段,添加

    1
    2
    3
    4
    5
    
    <Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
  3. 网站根目录下添加.htaccess,内容如下

    1
    2
    3
    4
    5
    6
    
    RewriteEngine on
       
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index.php|images|robots.txt)
    RewriteRule ^(.*)$ /index.php/$1 [L]
    

重启apache2服务

1
/etc/init.d/apache2 restart