PR

[RT3] ログイン画面を表示するまで

[RT3] Request Tracker のインストール(まとめ直し) の続き。

データベースの初期化

# make initialize-database

[error]: The RTAddressRegexp option is not set in the config. Not setting this option results in additional SQL queries to check whether each address belongs to RT or not. It is especially important to set this option if RT recieves emails on addresses that are not in the database or config.

エラーがでてるけど今は放置・・・。

設定ファイルに設定する

# view /opt/rt3/etc/RT_SiteConfig.pm

スポンサードリンク

初期状態

Set( $rtname, 'example.com');
#Set(@Plugins,(qw(Extension::QuickDelete RT::FM)));
1;

設定する

設定はRT Essentialsを参考にする。

# Site Details
Set($rtname, 'examplecorp');
Set($Organization, "rt.example.com");
Set($Timezone , 'US/Eastern');
Set($WebBaseURL, 'http://rt.example.com');
Set($WebPath, '/');

# Email Configuration
Set($CorrespondAddress, '[email protected]');
Set($CommentAddress, '[email protected]');
Set($SendmailPath, '/usr/sbin/sendmail');

# Logging
Set($LogToSyslog, '');
Set($LogToFile, 'debug');
Set($LogDir, '/opt/rt3/var/log');
Set($LogToFileNamed, 'rt.log');

Set($OwnerEmail, '[email protected]');
Set($MyTicketsLength, 20);

# Database
Set($DatabaseType, 'mysql');
Set($DatabaseHost, 'localhost');
Set($DatabaseUser, 'root');
Set($DatabasePassword, 'password');
Set($DatabaseName, 'rt3');

1;

チェックする

# perl -c /opt/rt3/etc/RT_SiteConfig.pm

httpd.confの設定

# view /etc/httpd/conf/httpd.conf

<VirtualHost *:80>
 ServerName rt.example.com
 DocumentRoot /opt/rt3/share/html
 AddDefaultCharset UTF-8

 PerlModule Apache::DBI
 PerlRequire /opt/rt3/bin/webmux.pl

 <Location />
 SetHandler perl-script
 PerlHandler RT::Mason
 </Location>
</VirtualHost>

起動に失敗する

httpd を起動中: Syntax error on line 998 of /etc/httpd/conf/httpd.conf:
Invalid command ‘PerlModule’, perhaps misspelled or defined by a module not included in the server configuration
[失敗]

不足していたモジュールを追加する

# install Apache::DBI
# yum install mod_perl

ブラウザからアクセスする

ダウンロードになってしまう

httpd/unix-directory となったので、取り敢えず C5zwHI+4.part を保存して内容を確認する。

mkdir /opt/rt3/var/mason_data/obj: Permission denied at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Compiler/ToObject.pm line 107

権限が気に入らないらしい。

# ll /opt/rt3/var/mason_data/
合計 12
drwxrwx— 2 www www 4096 11月 19 03:58 cache
drwxrwx— 2 www www 4096 11月 19 03:58 etc
drwxrwx— 2 www www 4096 11月 20 03:31 obj

このへんをapacheにする。

# ./configure –with-web-user=apache

ここでは上記のようにしてインストールしてしまった。

正しく表示してくれない

OTRSでも同様の現象が起きた。あまり見たくない画面だ。今回は権限ではなく、RTの問題っぽい。

ソースは以下のとおり。

<link rel=”shortcut icon” href=”//NoAuth/images//favicon.png” type=”image/png” />
<link rel=”stylesheet” href=”//NoAuth/css/web2/main-squished.css” type=”text/css” media=”all” />
<link rel=”stylesheet” href=”//NoAuth/css/print.css” type=”text/css” media=”print” />

ブラウザにそのまま(BaseURLに)追記すると画像やCSSは表示される・・・?詳しく調べると、以下のものを取りに行ってしまっていることがわかった。

http://noauth/images/bplogo.gif
http://noauth/images//favicon.png

RT_SiteConfig.pmの再編集

ここで気になるのは RT_SiteConfig.pm の設定値だ。

# view /opt/rt3/etc/RT_SiteConfig.pm

Set($WebPath, “/”); を

#Set($WebPath, “/”); にしてみる。(mod_perlが有効なのでapacheの再起動を忘れずに)

確認

これでログイン画面の表示までようやくたどり着いた・・・。

初期状態では root / password でログインする。

参考文献

  • [rt-users] RT3: mkdir /opt/rt3/var/mason_data/obj: Permission denied
  • Apache::ASP

コメント