リンク

方針

  • Ruby 2.0.0 ベース。(CentOS 7 デフォルト)
  • apache アカウントでサービスとして実行。
  • git リポジトリとして更新。Web からの編集は禁止。

インストール

# yum group install "Development Tools"
# yum install ruby ruby-devel libicu libicu-devel zlib zlib-devel cmake
# gem install nokogiri -v 1.6.8
# gem install github-markdown gollum gollum-rugged_adapter
  • /usr/share/httpd/.gitconfig

    [user]
    	name = <名前>
    	email = <メールアドレス>
    [core]
    	autocrlf = false
    	quotepath = false
    	pager = LESSCHARSET=utf-8 less
    [fetch]
    	prune = true
    [remote "origin"]
    	prune = true
  • /etc/systemd/system/gollum@.service

    [Unit]
    Description=Gollum wiki server
    After=network.target
    
    [Service]
    Type=simple
    User=%i
    ExecStart=/usr/local/bin/gollum --bare --css --js --no-edit --adapter rugged "/path/to/gollum.git"
    Restart=on-abort
    
    [Install]
    WantedBy=multi-user.target
  • サービス登録

    # systemctl enable gollum@apache
    # systemctl start gollum@apache
    # systemctl status gollum@apache
  • バーチャルホスト設定 /etc/httpd/conf.d/gollum.conf

    <VirtualHost *:80 *:443>
            ServerName      wiki.<ドメイン>
            DocumentRoot    /var/www/html/
            SSLEngine on
            SSLCertificateFile /etc/letsencrypt/live/<ドメイン>/cert.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/<ドメイン>/privkey.pem
            SSLCertificateChainFile /etc/letsencrypt/live/<ドメイン>/chain.pem
            RequestHeader set X_FORWARDED_PROTO 'https' env=HTTPS
            <IfModule mod_rewrite.c>
                    RewriteEngine on
                    RewriteRule     "^/favicon.ico$" "http://localhost/favicon.ico" [P]
                    RewriteRule     "^/(.*)$"       "http://localhost:4567/$1" [P,QSA]
            </IfModule>
    </VirtualHost>