5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS 7 に Trac 1.0 をインストールする

Last updated at Posted at 2016-01-13

Trac

https://trac.edgewall.org/
Trac は Python で書かれた課題管理ツール。

(追記)「Python 製の課題管理ツール Trac - Qiita」で Trac 1.2 のインストールを再検証した。

構築環境例

  • CentOS 7.2.1511 (minimal)
  • Apache 2.4.6
  • Python 2.7.5
  • setuptools 0.9.8 (easy_install)
  • GNU Enscript 1.6.6
  • Trac 1.0.9
  • Babel 2.2.0
  • Genshi 0.7

Trac のインストール

yum -y install gcc python-devel python-setuptools enscript
easy_install Babel
easy_install Trac

Trac および trac-admin は自動で日本語化される。
この際、Babel を事前にインストールしていないと英語版のみのインストールとなる。1
easy_install Babel Trac などと一括で処理すると英語版のみになってしまう。

Apache のセットアップ

yum -y install httpd mod_wsgi
mkdir /var/www/trac
chown apache:apache /var/www/trac
cat <<_EOF_ > /var/www/trac/trac.wsgi
import os
os.environ['TRAC_ENV_PARENT_DIR'] = '/var/www/trac'
os.environ['PYTHON_EGG_CACHE'] = '/var/www/trac/eggs'
import trac.web.main
application = trac.web.main.dispatch_request
_EOF_
chmod 755 /var/www/trac/trac.wsgi
cat <<_EOF_ > /etc/httpd/conf.d/trac.conf
WSGIScriptAlias /trac /var/www/trac/trac.wsgi
<Directory /var/www/trac>
    WSGIApplicationGroup %{GLOBAL}
    Require all granted
</Directory>
<LocationMatch "/trac/.*/login">
   AuthType Basic
   AuthName "trac"
   AuthUserFile "/var/www/trac/.htpasswd"
   Require valid-user
</LocationMatch>
_EOF_
firewall-cmd --permanent --add-service=http && firewall-cmd --reload
httpd -t
systemctl start httpd && systemctl enable $_
setenforce 0 #TODO

BASIC 認証のユーザー追加

htpasswd -c /var/www/trac/.htpasswd user1
htpasswd /var/www/trac/.htpasswd user2

Subversion

yum install subversion subversion-python mod_dav_svn
mkdir /var/www/svn
cat <<_EOF_ > /etc/httpd/conf.d/subversion.conf
<Location /svn>
    DAV svn
    SVNParentPath /var/www/svn
    <LimitExcept GET PROPFIND OPTIONS REPORT>
        AuthType Basic
        AuthName "Subversion - Authorization Realm"
        AuthUserFile /var/www/trac/.htpasswd
        Require valid-user
    </LimitExcept>
</Location>
_EOF_
httpd -t
systemctl restart httpd

参考

  1. http://qiita.com/bezeklik/items/139c7096663a676481ea#comment-b98cde46bb8408296cc1

5
8
3

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
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?