さくらにgitwebインストール

さくらサーバスタンダードプランにgitwebをインストール
こうなった http://shokai.org/projects/git/
githubに置きたくないリポジトリをwebで見せたい時なんかに使う予定


これをさくらでやるgitリポジトリをhttpで公開する - 橋本詳解
基本的に変わらないので差分のみ書く。


gitは http://d.hatena.ne.jp/shokai/20090623/1245743562 でソースから入れた。中にgitweb.cgi等があったのでそれを使う。

その前にgit使うとエラーがでていた

fatal: '~/src/shinagawaseaside' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

.zshenvにでも環境変数を追加

PATH=$HOME/local/git/libexec/git-core:$PATH

git-addとかgit-pullなどのコマンドにパスが通っていなかった
これでgitが普通に使える


gitweb.cgiは /etc/gitweb.conf を参照していて、そこにcssなどの位置が書いてあるが当然 /etc にアクセスできないので
gitweb.cgi に直接書く

# stylesheet to use                                                                                                               
our $stylesheet = "./gitweb.css";

# logo to use                                                                                                                     
our $logo = "./git-logo.png";

# the 'favicon'                                                                                                                   
our $favicon = "./git-favicon.png";

gitweb.cgiと同じディレクトリに持ってきた場合。
use strictしてるので our付ける