ksaitoの日記

日々試したことの覚え書き

UbuntuにRequest-Trackerをインストールする

移転しました。

自動的にリダイレクトします。

以前から気になっていたRequest-Trackerを試してみました。
tracは、プロジェクト管理のオールインワンで、よくできた課題管理が含まれています。
Request-Trackerは、日本では流行っていませんが専用アプリだけあって、個人のタスク管理からヘルプデスク業務までカバーできるポテンシャルがあります。
海外ではオライリー本も出ていますが翻訳される気配はありません...
Howto setup Request-Tracker 3.6 on Debian Etchを参考に設定しました。

RT Essentials

RT Essentials

  • 作者: Darren Chamberlain,Richard Foley,Dave Rolsky,Robert Spier,Jesse Vincent
  • 出版社/メーカー: Oreilly & Associates Inc
  • 発売日: 2005/08/30
  • メディア: ペーパーバック
  • クリック: 1回
  • この商品を含むブログ (2件) を見る

パッケージのインストール

RTは、メール送信にpostfix、データベースにPostgreSQLが標準ですが、exim4とmysqlで問題なく動きました。
必要なパッケージをインストールします。

$ sudo apt-get install fetchmail mysql-server-5.0 
$ sudo apt-get install rt3.6-apache2 request-tracker3.6

RTの設定

RTを設置するサーバ名とドメイン名、データベースへの接続情報に合わせてRT_SiteConfig.pmを修正します。
データベースを"Pg"から"mysqlに変更します。

$ diff -r /etc/request-tracker3.6/RT_SiteConfig.pm.org /etc/request-tracker3.6/RT_SiteConfig.pm
 --- RT_SiteConfig.pm.org       Sat May 31 21:17:02 2008 +0900
 +++ RT_SiteConfig.pm           Sat May 31 21:24:49 2008 +0900

 -Set($rtname, 'i.recommend.you.use.your.fqdn');
 -Set($Organization, 'my.domain.com');
 +Set($rtname, 'rt.domain');
 +Set($Organization, 'domain');

 -Set($DatabaseType, 'Pg'); # e.g. Pg or mysql
 +Set($DatabaseType, 'mysql'); # e.g. Pg or mysql

 Set($DatabaseUser , 'rtuser');
 -Set($DatabasePassword , 'wibble');
 +Set($DatabasePassword , 'パスワード');
 Set($DatabaseName , 'rtdb');

 -Set($WebBaseURL , "http ://my.domain.com");
 +Set($WebBaseURL , "http ://rt.domain");

$

RT用のmysqlユーザを作成する

データベース接続情報に合わせてmysqlのユーザを登録します。

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8760
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT ALL PRIVILEGES ON rtdb.* TO 'rtuser'@'localhost' IDENTIFIED BY 'パスワード';
Query OK, 0 rows affected (0.14 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.06 sec)

mysql> quit
Bye

$

RTのデータベース初期化

rt-setup-database-3.6コマンドでデータベースを初期化します。

$ sudo /usr/sbin/rt-setup-database-3.6 --action init --dba root --prompt-for-dba-password
In order to create or update your RT database,this script needs to connect to your mysql instance on localhost as root.
Please specify that user's database password below. If the user has no database
password, just press return.

Password:
Now creating a database for RT.
Creating mysql database rtdb.
Now populating database schema.
Creating database schema.
readline() on closed filehandle SCHEMA_LOCAL at /usr/sbin/rt-setup-database-3.6 line 223.
Done setting up database schema.
Now inserting database ACLs
Done setting up database ACLs.
Now inserting RT core system objects
Checking for existing system user...not found.  This appears to be a new installation.
Creating system user...done.
Now inserting RT data
Creating Superuser  ACL...done.
Creating groups...3.4.5.6.7.8.9.done.
Creating users...10.12.done.
Creating queues...1.2.done.
Creating ACL...2.3.done.
Creating ScripActions...1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.done.
Creating ScripConditions...1.2.3.4.5.6.7.8.9.10.done.
Creating templates...1.2.3.4.5.6.7.8.9.10.11.12.done.
Creating scrips...1.2.3.4.5.6.7.8.9.10.11.12.13.14.done.
Creating predefined searches...1.2.3.done.
Done setting up database content.
$

Apache2の設定

mod_rewriteを有効にして、000-defaultのにIncludeとRedirectMatchを設定します。
Apache2を再起動したらインストール完了です。

$ sudo a2enmod rewrite
$ tail /etc/apache2/sites-enabled/000-default
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    
    Include /etc/request-tracker3.6/apache2-modperl2.conf
    RedirectMatch ^/$ /rt/


$ sudo /etc/init.d/apache2 restart

サイトにログイン

ブラウザでhttp ://rt.domain/に接続するとログインフォームが表示されるはずです。
root/passwordでログインしたらrootのパスワードを変更しましょう。
RTの使い方については、またこんど...