【问题标题】:Request Tracker 4.4.1 with Apache2使用 Apache2 的请求跟踪器 4.4.1
【发布时间】:2016-10-10 13:38:55
【问题描述】:

我安装了 RT4,它正在工作。我现在正在尝试使用 Apache2 运行 RT。我正在使用 Centos 6.8

现在我不在乎我使用哪种方法:mod_perl、fastcgi 或 fcgid。只是想看看它的工作原理。

如果我使用 mod_perl 配置,当我重新启动 apache 时会出错。

/etc/httpd/conf/httpd.conf:

<VirtualHost *:80>
# This first-listed virtual host is also the default for *:80
ServerName ittickets.domain.local
AddDefaultCharset UTF-8
    DocumentRoot "/opt/rt4/share/html"
    <Location /rt>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
        <IfVersion < 2.4>
            Order allow,deny
            Allow from all
        </IfVersion>
        SetHandler modperl
        PerlResponseHandler Plack::Handler::Apache2
        PerlSetVar psgi_app /opt/rt4/sbin/rt-server
    </Location>
    <Perl>
        use Plack::Handler::Apache2;
        Plack::Handler::Apache2->preload("/opt/rt4/sbin/rt-server");
    </Perl>
</VirtualHost>

错误:

Starting httpd: [8891] [Mon Oct 10 13:07:49 2016] [warning]: DBI connect('dbname=rt4;host=srv-db.domain.local','rt_user',...) failed: Can't connect to MySQL server on 'srv-db.domain.local' (13) at /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 105. (/usr/local/share/perl5/Carp.pm:169)

RT couldn't connect to the database where tickets are stored.
If this is a new installation of RT, you should visit the URL below
to configure RT and initialize your database.

If this is an existing RT installation, this may indicate a database
connectivity problem.

The error RT got back when trying to connect to your database was:

Connect Failed Can't connect to MySQL server on 'srv-db.domain.local' (13)
 at /opt/rt4/sbin/../lib/RT.pm line 216.

[8891] [Mon Oct 10 13:07:50 2016] [warning]: DBI connect('dbname=rt4;host=srv-db.domain.local','rt_user',...) failed: Can't connect to MySQL server on 'srv-db.domain.local' (13) at /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 105. (/usr/local/share/perl5/Carp.pm:169)

但是,用 rt_user 连接数据库是没有问题的。

如果我访问http://ittickets.domain.local,我会收到以下消息:

You're almost there!
You haven't yet configured your webserver to run RT. You appear to have installed RT's web interface correctly, but haven't yet configured your web server to "run" the RT server which powers the web interface. The next step is to edit your webserver's configuration file to instruct it to use RT's mod_perl or FastCGI handler. If you need commercial support, please contact us at sales@bestpractical.com. 

RT 配置 /opt/rt4/etc/RT_SiteConfig.pm:

Set($rtname, 'domain.local');
Set($Organization, 'ittickets.domain.local');
Set($WebPort, 80);
Set($WebDomain, 'ittickets.domain.local');
Set($WebPath, '/rt');
Set(@ReferrerWhitelist, qw(ittickets.domain.local));

### MYSQL Config
Set($DatabaseType, "mysql");
Set($DatabaseHost,   "srv-db.domain.local");
Set($DatabaseRTHost, "srv-rt.domain.local");
Set($DatabasePort, "");
Set($DatabaseUser, "rt_user");
Set($DatabasePassword, q{xxxxxxxxxxx});
Set($DatabaseName, q{rt4});

我尝试了在 Internet 上找到的所有配置。我不明白我做错了什么。有人可以给点提示吗?

【问题讨论】:

    标签: apache perl request fastcgi tracker


    【解决方案1】:

    看起来mysql connect的问题是因为SeLinux。

    setsebool -P httpd_can_network_connect=1 完成了这项工作。

    我仍然有问题:你快到了....

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-12
      • 2018-01-19
      相关资源
      最近更新 更多