2010/06/25

header_logo trac

Ubuntu を入れたんで Trac + Mercurial でも作ってみようかと
最近 build ばっかしてて疲れてきたので package でサクサクいきたいです

package をまず探したいんですがファイルから探したいので
auto-apt とか apt-file とか入れようと思って
auto-apt 入れようとしたら凄い依存関係が攻めてきたので apt-file で
でも、apt-file 遅いんだよなぁ
$sudo aptitude install apt-file
(略)
$ sudo apt-file update
(略)
$ apt-file search bin/tracd
trac: /usr/bin/tracd
お前はそこまでしないと trac という package みつけられないのか!

trac を入れようとすると沢山依存関係で入ります。apache とか。
まぁ apache でいいですよね。
あと mercurial にしたいので trac-mercurial も入れます。

で、ここからググると思うでしょ?
でも Debian ならググらなくてもいいんです。
/usr/share/doc の下にドキュメント揃っていますの。
  • /usr/share/doc/apache2/README.Debian.gz
  • /usr/share/doc/trac/README.Debian.gz
  • /usr/share/doc/trac-mercurial/README.Debian
みたいに README に Debian って付いてるのが
Debian 系の設定方法が書いてあったりするファイルになります

/usr/share/doc/trac/README.Debian.gz に trac 環境の作り方細かに書いてあって
  Trac can work without vcs repository, but you may want to create
one for you project before creating a Trac environment. With
Subversion this can be made with:

$ mkdir /path/to/repos
$ svnadmin create /path/to/repos

A new Trac environment is created with trac-admin:

$ trac-admin /path/to/projectenv initenv
なんかレポジトリ作ってそれ使って trac を initenv しろと
今回は mercurial でいきたいので svn? って聞かれるところを hg と答えます

で、apache で使えるようにするには
Configuring as CGI, WSGI, FastCGI
---------------------------------

For trac >= 0.11 the *gi scripts have to be generated using the deploy command:

trac-admin /path/to/env deploy /path/to/www/trac
deploy しろと
WSGI がお薦めらしいので
#Trac as WSGI on Apache
#extra info on http://trac.edgewall.org/wiki/TracModWSGI
#info about daemon mode http://code.google.com/p/modwsgi/
# http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac
WSGIScriptAlias /trac /path/to/www/trac/cgi-bin/trac.wsgi
WSGIScriptAlias を設定しろと
なんでまぁ例えば /etc/apache2/sites-available/default なんかに
WSGIScriptAlias 設定すればいいのかー

で、apache 再起動したら動かなかったんですが
そういえば mod_wsgi を入れた覚えがなく
$ apt-file search wsgi.conf
libapache2-mod-wsgi: /etc/apache2/mods-available/wsgi.conf
なので libapache2-mod-wsgi を入れました

で、最後に /usr/share/doc/trac-mercurial/README.Debian を見て
  [components]
tracext.hg.* = enabled

(略)

[hg]
# -- Show revision number in addition to the changeset hash
show_rev = yes

# -- Changeset hash format
node_format = short
# hex: Show the full SHA1 hash
# short: Show a shortened hash for the changesets
って設定を trac.ini にコピりました

これで http://192.168.0.1/trac とかにアクセスしちゃうと
mod_wsgi 経由で trac が動いちゃってるという素敵

で、動いたんだけど左上のロゴが壊れてたのでググったら
Tracサイトのロゴを変えたい - hack my life
src = site/your_project_logo.png
ってあるので、
trac の下の htdocs に your_project_logo.png って画像置けば OK だそうでした

0 件のコメント:

コメントを投稿