UP | HOME

Gollum安装(Git+Markdown+Wiki)

安装Gollum

$ aptitude install ruby ruby-dev rubygems
$ aptitude install libicu-dev
$ gem install gollum
$ gem install redcarpet
$ gem install github-markdown
$ pip install Pygments
$ mkdir wiki
$ cd wiki
$ git init
$ gollum
# 访问http://localhost:4567

配置Apache2

$ a2enmod proxy
$ a2enmod proxy_http
$ vi /etc/apache2/mods-available/proxy.conf
    ProxyRequests On
    <Proxy *>
        AddDefaultCharset off
        Order deny,allow
        #Deny from all
        Allow from .shixf.com
    </Proxy>

$ vi /etc/apache2/sites-available/default
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass /wiki http://localhost:4567/wiki
    ProxyPassReverse /wiki http://localhost:4567/wiki

    <Location /wiki>
        Order allow,deny
        Allow from all
        ProxyPass http://localhost:4567/wiki
        ProxyPassReverse /wiki
    </Location>
$ gollum --host localhost --no-edit --js --css --mathjax --gollum-path /var/www/knowledge/ --base-path wiki

设置Gollum自动化

$ echo PATH=$PATH
$ vi /var/www/wiki/.gollum.sh
    #!/bin/bash

    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    export PATH

    DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    gollum --host localhost --no-edit --js --css --mathjax --gollum-path $DIR --base-path wiki
$ vi /etc/rc.local
    bash /var/www/wiki/.gollum.sh &
$ echo PATH=$PATH
$ vi /var/www/wiki/.sync.sh
    #!/bin/bash

    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    export PATH

    DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    (cd $DIR && git pull && git push)
$ crontab -e
    0 */1 * * * bash /var/www/wiki/.sync.sh

Date: 2019-01-29 Tue 21:55

Author: shixiongfei

Created: 2020-09-05 Sat 14:40

Emacs 27.1 (Org mode 9.3)