Rt4, centos, and fastcgi

Hi. I just tried to upgrade to rt4 and I’m having the hardest time getting the web server to work. For rt3, I was using webmux.pl in my apache configuration.

I’m on CentOS 5.5 and using Apache 2.2.3. I installed mod_fastcgi 2.4.6 from source. I’ve followed the example configurations in docs/web_deployment.pod for mod_fastcgi and mod_fcgid and both give me errors. I’ve heard good things about mod_fastcgi, so I would prefer to get that going.

Here is my mod_fastcgi apache config
LoadModule fastcgi_module modules/mod_fastcgi.so

#FastCgiIpcDir /tmp
FastCgiServer /opt/rt4/sbin/rt-server.fcgi -processes 5 -idle-timeout 300

### Optional apache logs for RT # Ensure that your log rotation scripts know about these files # ErrorLog /opt/rt4/var/log/apache2.error # TransferLog /opt/rt4/var/log/apache2.access # LogLevel debug

AddDefaultCharset UTF-8

Alias /NoAuth/images/ /opt/rt4/share/html/NoAuth/images/
ScriptAlias / /opt/rt4/sbin/rt-server.fcgi/

DocumentRoot "/opt/rt4/share/html"

Order allow,deny
Allow from all

 Options +ExecCGI
 AddHandler fastcgi-script fcgi

When I start apache, I get the following errors in /var/log/https/error_log
[Fri Jul 01 10:30:32 2011] [error] [client x.x.x.x] (13)Permission denied: FastCGI: failed to connect to server “/opt/rt4/sbin/rt-server.fcgi”: connect() failed
[Fri Jul 01 10:30:32 2011] [error] [client x.x.x.x] FastCGI: incomplete headers (0 bytes) received from server “/opt/rt4/sbin/rt-server.fcgi”
[Fri Jul 01 10:30:33 2011] [crit] (13)Permission denied: FastCGI: can’t create server “/opt/rt4/sbin/rt-server.fcgi”: bind() failed [/etc/httpd/logs/fastcgi/f758b05f8779532382e3166ad1890013]

Here’s permissions for all files in that directory. I’ve temporarily changed permissions from 750 to 755, just to see if I could get it working, but that didn’t help.
-=>>ls -lah /opt/rt4/sbin/
total 216K
drwxr-xr-x 2 root root 4.0K Jul 1 08:55 .
drwxr-xr-x 9 root rt 4.0K Jul 1 08:55 …
-rwxr-xr-x 1 root rt 3.6K Jul 1 08:55 rt-attributes-viewer
-rwxr-xr-x 1 root rt 5.4K Jul 1 08:55 rt-clean-sessions
-rwxr-xr-x 1 root rt 7.7K Jul 1 08:55 rt-dump-metadata
-rwxr-xr-x 1 root rt 4.9K Jul 1 08:55 rt-email-dashboards
-rwxr-xr-x 1 root rt 12K Jul 1 08:55 rt-email-digest
-rwxr-xr-x 1 root rt 13K Jul 1 08:55 rt-email-group-admin
-rwxr-xr-x 1 root rt 12K Jul 1 08:55 rt-fulltext-indexer
-rwxr-xr-x 1 root rt 7.9K Jul 1 08:55 rt-server
-rwxr-xr-x 1 root rt 7.9K Jul 1 08:55 rt-server.fcgi
-rwxr-xr-x 1 root rt 3.6K Jul 1 08:55 rt-session-viewer
-rwxr-xr-x 1 root rt 18K Jul 1 08:55 rt-setup-database
-rwxr-xr-x 1 root rt 22K Jul 1 08:55 rt-setup-fulltext-index
-rwxr-xr-x 1 root rt 8.3K Jul 1 08:55 rt-shredder
-rwxr-xr-x 1 root rt 16K Jul 1 08:55 rt-test-dependencies
-rwxr-xr-x 1 root rt 38K Jul 1 08:55 rt-validator
-rwxr-xr-x 1 root rt 7.9K Jul 1 08:55 standalone_httpd
— .:root@aspdev:. (/opt/rt3)
-=>>groups apache
apache : apache git rt gitweb

Any ideas?

Thanks

John Alberts
Cloud Optimization Engineer
Ex Libris (USA) Inc.
1350 E. Touhy Ave. Suite 200 East
Des Plaines, IL 60018

Follow Ex Libris on Twitter: @exlibrisgrouphttp://twitter.com/ExLibrisGroup

mod_fastcgi and mod_fcgid require different configurations. We haven’t used
mod_fastcgi in quite some time, but here is our config for mod_fcgid:

LoadModule fcgid_module modules/mod_fcgid.so

Use FastCGI to process .fcg .fcgi & .fpl scripts

Don’t do this if mod_fastcgi is present, as it will try to do the same

thing
<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl

Sane place to put sockets and shared memory file

SocketPath run/mod_fcgid
SharememPath run/fcgid_shm

Main instance

Alias /rt/NoAuth/images/ /opt/rt3/share/html/NoAuth/images/
ScriptAlias /rt /opt/rt3/bin/mason_handler.fcgi/

Since you have your RT instance inside a virtual host entry, your FastCgiServer
directive should also be inside that virtual host entry.On Fri, Jul 1, 2011 at 10:52 AM, John Alberts < John.Alberts@exlibrisgroup.com> wrote:

Hi. I just tried to upgrade to rt4 and I’m having the hardest time
getting the web server to work. For rt3, I was using webmux.pl in my
apache configuration.

I’m on CentOS 5.5 and using Apache 2.2.3. I installed mod_fastcgi 2.4.6
from source. I’ve followed the example configurations in
docs/web_deployment.pod for mod_fastcgi and mod_fcgid and both give me
errors. I’ve heard good things about mod_fastcgi, so I would prefer to get
that going.

Here is my mod_fastcgi apache config
LoadModule fastcgi_module modules/mod_fastcgi.so

#FastCgiIpcDir /tmp
FastCgiServer /opt/rt4/sbin/rt-server.fcgi -processes 5 -idle-timeout 300

### Optional apache logs for RT # Ensure that your log rotation scripts know about these files # ErrorLog /opt/rt4/var/log/apache2.error # TransferLog /opt/rt4/var/log/apache2.access # LogLevel debug

AddDefaultCharset UTF-8

Alias /NoAuth/images/ /opt/rt4/share/html/NoAuth/images/
ScriptAlias / /opt/rt4/sbin/rt-server.fcgi/

DocumentRoot "/opt/rt4/share/html"

Order allow,deny
Allow from all

  Options +ExecCGI
 AddHandler fastcgi-script fcgi

When I start apache, I get the following errors in
/var/log/https/error_log
[Fri Jul 01 10:30:32 2011] [error] [client x.x.x.x] (13)Permission
denied: FastCGI: failed to connect to server “/opt/rt4/sbin/rt-server.fcgi”:
connect() failed
[Fri Jul 01 10:30:32 2011] [error] [client x.x.x.x] FastCGI: incomplete
headers (0 bytes) received from server “/opt/rt4/sbin/rt-server.fcgi”
[Fri Jul 01 10:30:33 2011] [crit] (13)Permission denied: FastCGI: can’t
create server “/opt/rt4/sbin/rt-server.fcgi”: bind() failed
[/etc/httpd/logs/fastcgi/f758b05f8779532382e3166ad1890013]

James Moseley

Thanks. I’ll have to give this a try later tonight when I can have some downtime.

John Alberts
Cloud Optimization Engineer
Ex Libris (USA) Inc.
1350 E. Touhy Ave. Suite 200 East
Des Plaines, IL 60018
Phone: 1-219-979-6560

Follow Ex Libris on Twitter: @exlibrisgrouphttp://twitter.com/ExLibrisGroupFrom: James Moseley <jmoseley@corp.xanadoo.commailto:jmoseley@corp.xanadoo.com>
Date: Fri, 1 Jul 2011 11:50:39 -0500
To: John Alberts <john.alberts@exlibrisgroup.commailto:john.alberts@exlibrisgroup.com>
Cc: "rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com" <rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com>
Subject: Re: [rt-users] rt4, centos, and fastcgi

mod_fastcgi and mod_fcgid require different configurations. We haven’t used mod_fastcgi in quite some time, but here is our config for mod_fcgid:

LoadModule fcgid_module modules/mod_fcgid.so

Use FastCGI to process .fcg .fcgi & .fpl scripts

Don’t do this if mod_fastcgi is present, as it will try to do the same thing

<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl

Sane place to put sockets and shared memory file

SocketPath run/mod_fcgid
SharememPath run/fcgid_shm

Main instance

Alias /rt/NoAuth/images/ /opt/rt3/share/html/NoAuth/images/
ScriptAlias /rt /opt/rt3/bin/mason_handler.fcgi/

Since you have your RT instance inside a virtual host entry, your FastCgiServer directive should also be inside that virtual host entry.

I gave it another try using fcgid and now I have errors about running it being configured to run on the wrong port, which makes no sense.

Here is the apache error log
[Fri Jul 01 13:58:24 2011] [warn] module fcgid_module is already loaded, skipping
[Fri Jul 01 13:58:24 2011] [notice] Digest: generating secret for digest authentication …
[Fri Jul 01 13:58:24 2011] [notice] Digest: done
[Fri Jul 01 13:58:24 2011] [notice] Apache/2.2.3 (CentOS) configured – resuming normal operations
[Fri Jul 01 13:58:27 2011] [warn] mod_fcgid: stderr: [Fri Jul 1 18:58:27 2011] [warn]: The actual SERVER_PORT (80) does NOT match the configured WebPort (443). Perhaps you should Set($WebPort, 80); in RT_SiteConfig.pm, otherwise your internal links may be broken. (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:1079)
[Fri Jul 01 13:58:27 2011] [warn] mod_fcgid: stderr: [Fri Jul 1 18:58:27 2011] [warn]: The actual SERVER_NAME (aspdev.hosted.exlibrisgroup.com) does NOT match the configured WebDomain (helpdesk.hosted.exlibrisgroup.com). Perhaps you should Set($WebDomain, ‘aspdev.hosted.exlibrisgroup.com’); in R
[Fri Jul 01 13:58:31 2011] [warn] mod_fcgid: stderr: T_SiteConfig.pm, otherwise your internal links may be broken. (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:1092)
[Fri Jul 01 13:58:31 2011] [warn] mod_fcgid: stderr: [Fri Jul 1 18:58:27 2011] [warn]: The actual SCRIPT_NAME () does NOT match the configured WebPath (/rt4). Perhaps you should Set($WebPath, ‘’); in RT_SiteConfig.pm, otherwise your internal links may be broken. (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:1097)
[Fri Jul 01 13:59:04 2011] [notice] caught SIGTERM, shutting down
[Fri Jul 01 13:59:04 2011] [notice] mod_fcgid: process /opt/rt4/sbin/rt-server.fcgi(22499) exit(shutting down), get stop signal 15

[Fri Jul 01 13:59:19 2011] [notice] Digest: generating secret for digest authentication …
[Fri Jul 01 13:59:19 2011] [notice] Digest: done
[Fri Jul 01 13:59:20 2011] [notice] Apache/2.2.3 (CentOS) configured – resuming normal operations

You can see above, after I remove the rt4.conf file, apache works fine.
Here is my fcgid configuration for RT. When yum installed fcgid, it created a fcgid.conf file, so I’m showing that as well.

-=>>cat fcgid.conf

This is the Apache server configuration file for providing FastCGI support

through mod_fcgid

Documentation is available at http://fastcgi.coremail.cn/doc.htm

LoadModule fcgid_module modules/mod_fcgid.so

Use FastCGI to process .fcg .fcgi & .fpl scripts

Don’t do this if mod_fastcgi is present, as it will try to do the same thing

<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl

Sane place to put sockets and shared memory file

SocketPath /var/run/mod_fcgid
SharememPath /var/run/mod_fcgid/fcgid_shm
— .:root@aspdev:. (/etc/httpd/conf.d)
-=>>cat rt4.conf
LoadModule fcgid_module modules/mod_fcgid.so

### Optional apache logs for RT # Ensure that your log rotation scripts know about these files # ErrorLog /opt/rt4/var/log/apache2.error # TransferLog /opt/rt4/var/log/apache2.access # LogLevel debug

AddDefaultCharset UTF-8

Alias /NoAuth/images/ /opt/rt4/share/html/NoAuth/images/
ScriptAlias / /opt/rt4/sbin/rt-server.fcgi/

DocumentRoot “/opt/rt4/share/html”
<Location /rt4>
Order allow,deny
Allow from all

 Options +ExecCGI
 AddHandler fcgid-script fcgi

If I remove the rt4.conf file and restart the server, apache works fine and all of my other sites work just fine, even with ssl.

John Alberts
Cloud Optimization Engineer
Ex Libris (USA) Inc.
1350 E. Touhy Ave. Suite 200 East
Des Plaines, IL 60018
Phone: 1-219-979-6560

Follow Ex Libris on Twitter: @exlibrisgrouphttp://twitter.com/ExLibrisGroupFrom: John Alberts <john.alberts@exlibrisgroup.commailto:john.alberts@exlibrisgroup.com>
Date: Fri, 1 Jul 2011 18:15:12 +0000
To: James Moseley <jmoseley@corp.xanadoo.commailto:jmoseley@corp.xanadoo.com>
Cc: "rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com" <rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com>
Subject: Re: [rt-users] rt4, centos, and fastcgi

Thanks. I’ll have to give this a try later tonight when I can have some downtime.

John Alberts
Cloud Optimization Engineer
Ex Libris (USA) Inc.
1350 E. Touhy Ave. Suite 200 East
Des Plaines, IL 60018
Phone: 1-219-979-6560

Follow Ex Libris on Twitter: @exlibrisgrouphttp://twitter.com/ExLibrisGroup

From: James Moseley <jmoseley@corp.xanadoo.commailto:jmoseley@corp.xanadoo.com>
Date: Fri, 1 Jul 2011 11:50:39 -0500
To: John Alberts <john.alberts@exlibrisgroup.commailto:john.alberts@exlibrisgroup.com>
Cc: "rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com" <rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com>
Subject: Re: [rt-users] rt4, centos, and fastcgi

mod_fastcgi and mod_fcgid require different configurations. We haven’t used mod_fastcgi in quite some time, but here is our config for mod_fcgid:

LoadModule fcgid_module modules/mod_fcgid.so

Use FastCGI to process .fcg .fcgi & .fpl scripts

Don’t do this if mod_fastcgi is present, as it will try to do the same thing

<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl

Sane place to put sockets and shared memory file

SocketPath run/mod_fcgid
SharememPath run/fcgid_shm

Main instance

Alias /rt/NoAuth/images/ /opt/rt3/share/html/NoAuth/images/
ScriptAlias /rt /opt/rt3/bin/mason_handler.fcgi/

Since you have your RT instance inside a virtual host entry, your FastCgiServer directive should also be inside that virtual host entry.

You don’t need both an RT4 and a fcgid conf file. Paste exactly what I put
in my previous reply (correcting for obvious path differences) into, say, a
file named rt.conf and then rename your current RT-associated config files
to something like rt4.conf.old and fcgid.conf.old then restart.

Let’s try to get it to work outside of a virtual host first then let’s
examine the errors.

You should also set the following (or something like it) in your site config
file.

Set($WebPath , “/rt”);
Set($WebBaseURL , “https://”);
Set($WebImagesURL , $WebPath . “/NoAuth/images/”);

Once you get this working, then you can try mucking around with a virtual
host.

Note, that I’m also running /opt/rt3/bin/mason_handler.fcgi vs.
sbin/rt-server.fcgi.

Obviously, I’m still running RT3 and I haven’t read the documentation about
fast CGI use under RT4.On Fri, Jul 1, 2011 at 2:08 PM, John Alberts <John.Alberts@exlibrisgroup.com wrote:

I gave it another try using fcgid and now I have errors about running it
being configured to run on the wrong port, which makes no sense.

Here is the apache error log
[Fri Jul 01 13:58:24 2011] [warn] module fcgid_module is already loaded,
skipping
[Fri Jul 01 13:58:24 2011] [notice] Digest: generating secret for digest
authentication …
[Fri Jul 01 13:58:24 2011] [notice] Digest: done
[Fri Jul 01 13:58:24 2011] [notice] Apache/2.2.3 (CentOS) configured –
resuming normal operations
[Fri Jul 01 13:58:27 2011] [warn] mod_fcgid: stderr: [Fri Jul 1 18:58:27
2011] [warn]: The actual SERVER_PORT (80) does NOT match the configured
WebPort (443). Perhaps you should Set($WebPort, 80); in RT_SiteConfig.pm,
otherwise your internal links may be broken.
(/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:1079)
[Fri Jul 01 13:58:27 2011] [warn] mod_fcgid: stderr: [Fri Jul 1 18:58:27
2011] [warn]: The actual SERVER_NAME (aspdev.hosted.exlibrisgroup.com)
does NOT match the configured WebDomain (helpdesk.hosted.exlibrisgroup.com).
Perhaps you should Set($WebDomain, ‘aspdev.hosted.exlibrisgroup.com’); in
R
[Fri Jul 01 13:58:31 2011] [warn] mod_fcgid: stderr: T_SiteConfig.pm,
otherwise your internal links may be broken.
(/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:1092)
[Fri Jul 01 13:58:31 2011] [warn] mod_fcgid: stderr: [Fri Jul 1 18:58:27
2011] [warn]: The actual SCRIPT_NAME () does NOT match the configured
WebPath (/rt4). Perhaps you should Set($WebPath, ‘’); in RT_SiteConfig.pm,
otherwise your internal links may be broken.
(/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:1097)
[Fri Jul 01 13:59:04 2011] [notice] caught SIGTERM, shutting down
[Fri Jul 01 13:59:04 2011] [notice] mod_fcgid: process
/opt/rt4/sbin/rt-server.fcgi(22499) exit(shutting down), get stop signal 15

[Fri Jul 01 13:59:19 2011] [notice] Digest: generating secret for digest
authentication …
[Fri Jul 01 13:59:19 2011] [notice] Digest: done
[Fri Jul 01 13:59:20 2011] [notice] Apache/2.2.3 (CentOS) configured –
resuming normal operations

You can see above, after I remove the rt4.conf file, apache works fine.
Here is my fcgid configuration for RT. When yum installed fcgid, it
created a fcgid.conf file, so I’m showing that as well.

-=>>cat fcgid.conf

This is the Apache server configuration file for providing FastCGI

support

through mod_fcgid

Documentation is available at http://fastcgi.coremail.cn/doc.htm

LoadModule fcgid_module modules/mod_fcgid.so

Use FastCGI to process .fcg .fcgi & .fpl scripts

Don’t do this if mod_fastcgi is present, as it will try to do the same

thing
<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl

Sane place to put sockets and shared memory file

SocketPath /var/run/mod_fcgid
SharememPath /var/run/mod_fcgid/fcgid_shm
— .:root@aspdev:. (/etc/httpd/conf.d)
-=>>cat rt4.conf
LoadModule fcgid_module modules/mod_fcgid.so

### Optional apache logs for RT # Ensure that your log rotation scripts know about these files # ErrorLog /opt/rt4/var/log/apache2.error # TransferLog /opt/rt4/var/log/apache2.access # LogLevel debug
AddDefaultCharset UTF-8

Alias /NoAuth/images/ /opt/rt4/share/html/NoAuth/images/

ScriptAlias / /opt/rt4/sbin/rt-server.fcgi/

DocumentRoot "/opt/rt4/share/html"

<Location /rt4>
Order allow,deny
Allow from all

  Options +ExecCGI
 AddHandler fcgid-script fcgi

If I remove the rt4.conf file and restart the server, apache works fine
and all of my other sites work just fine, even with ssl.

James Moseley
610-934-7307