LoginSignup
5
5

More than 5 years have passed since last update.

CentOS Trac1.0.1を入れる

Posted at

yumでTracを入れた。

yum install trac

少し触ってみたが、バージョンが0.12で有ることに気づく。
ソースからsetup.pyで入れ直して、新しい方を試して見る。
せっかく入れたtracを一回消す。

/etc/init.d/httpd stop #念のためApacheを止める
yum remove trac

バベルを入れる。

easy_install Babel

Trac1.0.1のソースをダウンロードし、解凍、setup.pyを実行する。

wget http://download.edgewall.org/trac/Trac-1.0.1.tar.gz
tar xvxf Trac-1.0.1.tar.gz
cd Trac-1.0.1
sython setup.py compile_catalog -f

tracプロジェクトを作る。

trac-admin /var/trac/sampleproject  initenv

Apacheと連携しようと思って、/etc/httpd/を覗くとファイルがない。
先ほどのremoveで消してしまったようだ…、と思っていたら、trac.conf.rpmsaveの名前で自動でコピーをして置いてくれたみたいだ。コピーして書き換える。

vi /etc/httpd/conf.d/trac.conf
trac.conf
<VirtualHost *:443>
  ServerName samplehost
  DocumentRoot /var/trac/sampleproject
  ErrorLog logs/ssl_error_log
  TransferLog logs/ssl_access_log
  LogLevel warn

  SSLEngine on
  SSLProtocol all -SSLv2

  SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
  SSLCertificateFile /etc/pki/tls/certs/server.crt
  SSLCertificateKeyFile /etc/pki/tls/private/server.key

  <location />
    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnv /var/trac/sampleproject
    PythonOption TracUriRoot /
  </location>

  CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

  <LocationMatch "/">
    AuthType Basic
    AuthName "Trac"
    AuthUserFile /etc/trac/.htpasswd
    Require valid-user
  </LocationMatch>

</Virtualhost>

adminのユーザーの設定をしておく。

htpasswd /etc/trac/.htpasswd admin

Apacheを起動する。

/etc/init.d/httpd start

わくわくしながら、ブラウザで画面を表示するとエラー。

TracError: Error reading '/var/trac/sampleproject/conf/trac.ini', make sure it is readable.

Apacheから見えるようにしてあげる。

chown -R apache:apache  /var/trac/

以上で、なんとか動いた。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5