请求跟踪4.4.1与Apache2

请求跟踪4.4.1与Apache2

问题描述:

我安装了RT4,它正在工作。我现在试图用Apache2运行RT。我正在使用Centos 6.8请求跟踪4.4.1与Apache2

现在我不在乎使用哪种方法: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 [email protected] 

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}); 

我试图在互联网上找到的所有配置。我不明白我做错了什么。有人可以提供一个提示吗?

貌似与mysql连接的问题是因为SeLinux。

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

我仍然有问题:你几乎在那里......