Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 171148

Summary: www-apache/mod_fcgid communication error
Product: Gentoo Linux Reporter: Evert <evert.gentoo>
Component: [OLD] ServerAssignee: Apache Team - Bugzilla Reports <apache-bugs>
Status: RESOLVED CANTFIX    
Severity: normal CC: devnull, ramereth
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Evert 2007-03-16 10:50:03 UTC
Since mod_fastcgi is masked, I tried mod_fcgid for use with the Oracle Calendar webclient. As it does not work I had to unmask mod_fastcgi and change back to mod_fastcgi.

Reproducible: Always

Steps to Reproduce:
1. /etc/init.d/apache2 stop
2. emerge -C mod_fastcgi
3. emerge -a mod_fcgid
4. replace -D FASTCGI for -D FCGID in /etc/conf.d/apache2
5. add .fcgi in /etc/apache2/modules.d/20_mod_fcgid.conf like this:
       AddHandler fcgid-script .fcg .fcgi
6. /etc/init.d/apache2 start
Actual Results:  
Oracle Calendar webclient does not work.

/var/log/apache2/error_log contains:
[Fri Mar 16 10:43:04 2007] [notice] mod_fcgid: server /data/ocal/server10g/ocas/bin/ocas.fcgi(28352) started
[Fri Mar 16 10:43:05 2007] [error] [client XX.MY.IP.XX] Premature end of script headers: ocas.fcgi
[Fri Mar 16 10:43:10 2007] [notice] mod_fcgid: process /data/ocal/server10g/ocas/bin/ocas.fcgi(28352) exit(communication error), get unexpected signal 11

Expected Results:  
A working Oracle Calendar webclient just like when using mod_fastcgi

# emerge --info
Portage 2.1.2.2 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.3.6-r4, 2.6.18.6 i686)
=================================================================
System uname: 2.6.18.6 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 16 Mar 2007 06:30:01 +0000
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mtune=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mtune=i686 -pipe"
DISTDIR="/data/linux/gentoo/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LINGUAS="de en nl"
MAKEOPTS="-j2"
PKGDIR="/data/linux/gentoo/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/compile"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac alsa apache2 apm berkdb bitmap-fonts cli cracklib crypt cups dri dvd dvdr dvdread encode esd fortran gdbm gif gnome gpm gstreamer gtk iconv imlib ipv6 isdnlog java jpeg ldap libg++ mad midi mikmod mmx mng mozilla mp3 mpeg mplayer ncurses nls nptl nptlonly nsplugin ogg opengl oss pam pcre perl png ppds pppd python qt qt3 qt4 quicktime readline reflection samba sdl session spell spl sse ssl svg tcpd tiff truetype truetype-fonts type1-fonts unicode vcd vorbis wmf x86 xml xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en nl" USERLAND="GNU" VIDEO_CARDS="vesa fbdev i810"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-03-16 10:53:23 UTC
Please, try w/ 2.1; 1.10 is way too old to be worth fixing.
Comment 2 Evert 2007-03-16 11:19:28 UTC
Fortunately, both mod_fastcgi and mod_fcgid can be installed at the same time and it's easy to switch using -D FASTCGI or -D FCGID in /etc/conf.d/apache2.

Anyway, it doesn't look better using mod_fcgid-2.1:

[Fri Mar 16 12:09:57 2007] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Fri Mar 16 12:09:57 2007] [error] [client XX.MY.IP.XX] Premature end of script headers: ocas.fcgi
[Fri Mar 16 12:10:00 2007] [notice] mod_fcgid: process /data/ocal/server10g/ocas/bin/ocas.fcgi(1132) exit(communication error), get unexpected signal 11
Comment 3 Evert 2007-03-16 11:22:49 UTC
Forgot to click "Reopen bug"...
Comment 4 Roman Pertl 2007-05-08 19:17:37 UTC
i also had some problems getting mod_fcgid to work last week.

one problem was that the fcgid-socket was in a directory /var/log/apache2 which was not readable by the apacheusere

adding these lines to /etc/apache2/modules.d/20_mod_fcgid.conf help me:
        SocketPath /var/run/fcgidsock.d
        SharememPath /var/run/fcgid_shm
and created the direcotry /var/run7fcgidsock.d
Comment 5 Priit Laes (IRC: plaes) 2007-05-25 06:23:58 UTC
L(In reply to comment #4)
> i also had some problems getting mod_fcgid to work last week.
> 
> one problem was that the fcgid-socket was in a directory /var/log/apache2 which
> was not readable by the apacheusere

The problem you are talking about was fixed this week (bug 178407).

Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-09-11 16:46:43 UTC
Any better with 2.2?
Comment 7 Evert 2007-09-12 08:35:57 UTC
Well, since mod_fcgid does not work with Oracle Calendar I still need to use mod_fastcgi.
And since mod_fastcgi is removed from portage, I had to put it into local/portage.
And since mod_fastcgi does not work with apache 2.2, I had to mask >=apache-2.2.
And since mod_fcgid-2.2 now seems to need apache 2.2, I can't simply try mod_fcgid-2.2!

Also, I found out that I have some apache statements which I need to rewrite for mod_fcgid, but I have no idea how to rewrite those statements, so before I'm gonna try mod_fcgid-2.2 including installing apache-2.2, can you please tell me how the following apache statements should be rewritten for use with mod_fcgid?

<IfModule mod_fastcgi.c>
    <Directory "/data/ocal/server10g/ocas/bin/">
        SetHandler fastcgi-script
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
        <IfModule mod_ossl.c>
            SSLOptions +StdEnvVars
        </IfModule>
    </Directory>
    FastCgiExternalServer /data/ocal/server10g/ocas/bin/ocas.fcgi -appConnTimeout 300 -idle-timeout 300 -pass-header REMOTE_USER -host localhost:8010
    FastCgiExternalServer /data/ocal/server10g/ocas/bin/ochecklet.fcgi -appConnTimeout 300 -idle-timeout 300 -host localhost:8011
</IfModule>
Comment 8 Benedikt Böhm (RETIRED) gentoo-dev 2007-09-16 12:22:23 UTC
FYI, www-apache/mod_fastcgi-2.4.4_pre20070916 is in portage again, bug #133563
Comment 9 Evert 2007-09-18 10:05:11 UTC
Welcome back mod_fastcgi!
I already got the patch and ebuild from that bug and that way I got mod_fastcgi working with apache-2.2. But not having to put it in local/portage is of course much better! :)
Comment 10 Roman Pertl 2007-09-18 19:22:51 UTC
you can use mod_fcgid-2.2 with apache-2.0, you need to copy the ebuild to /usr/local and change need_apache2_2 to need_apache2
works perfectly for me.
btw: this is should be fixed anyway, i wanted to fill a bug report for that long time ago... 
Comment 11 Evert 2007-09-19 09:31:04 UTC
I still need to know how to rewrite those apache statements before I can try mod_fcgid-2.2, especially those FastCgiExternalServer statements and according to https://bugs.gentoo.org/show_bug.cgi?id=133563#c12 that seems to be a real problem...
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2007-11-24 14:59:43 UTC
Well, get back to us if 2.2 doesn't work. Noone's gonna fix 1.10
Comment 13 Evert 2007-11-24 17:38:35 UTC
> Well, get back to us if 2.2 doesn't work. Noone's gonna fix 1.10

Well, that's not the issue. I'm willing to try mod_fcgid-2.2 but for that I need to know if and how FastCgiExternalServer is supported.

By the way, my current working configuration is apache-2.2.6 with mod_fastcgi-2.4.4_pre20070916 so it won't be a problem anymore if mod_fcgid-2.2 doesn't support FastCgiExternalServer.
Comment 14 Benedikt Böhm (RETIRED) gentoo-dev 2007-11-29 18:52:23 UTC
please reopen if there is still an issue
Comment 15 Evert 2007-12-01 18:15:18 UTC
Well let me explain the issue because it seems the issue is not very clear:

The reason for creating this bugreport in the first place is that gentoo dropped mod_fastcgi from portage in favor of mod_fcgid which didn't work for Oracle Calendar Application System.
Now, gentoo re-added mod_fastcgi so in fact the whole reason for trying mod_fcgid has gone... for now...

So, if you're not interested in getting Oracle Calendar Application System to work with mod_fcgid, I'll stick with mod_fastcgi until the gentoo team decides to drop mod_fastcgi... again...

I see the state of this bug is marked as RESOLVED TEST-REQUEST but for that I still *need input* from gentoo how to rewrite mod_fastcgi's statement FastCgiExternalServer for mod_fcgid. If that's too hard to understand, please leave this bug closed forever and ever!
Comment 16 Alexander Bechkov 2008-02-26 22:35:30 UTC
(In reply to comment #14)
> please reopen if there is still an issue
> 

apache-2.2.6-r7(the same with 2.2.8)
mod_fcgid-2.2

scripts are working ok with apache-2.2.6(on other server),
after upgrading i got  500 error
...
exit(communication error), get unexpected signal 11
[Wed Feb 27 00:55:10 2008] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.


i848 ~ # emerge -pv =www-servers/apache-2.2.6*

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] www-servers/apache-2.2.6-r7  USE="ldap ssl suexec threads -debug -doc (-selinux) -sni -static" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -authn_alias -cern_meta -charset_lite -dumpio -log_forensic -proxy_ftp -version" APACHE2_MPMS="worker -event -itk -peruser -prefork" 0 kB

Vhost:
<IfDefine FCGID>
        SuexecUserGroup becha becha

<Directory /var/www/denco.ru/html/myshop/admin>
AddHandler fcgid-script .php .php3 .php4 .phtml
FCGIWrapper /var/www/site/php-fcgi/php5-fcgi .php
Options +ExecCGI
Allow From All
AllowOverride All
</Directory>
</IfDefine>

FCGIWrapper:

#!/bin/sh
PHPRC="/home/becha/mysites/etc/cgi-php5/"
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
exec /usr/bin/php-cgi


/etc/apache2/modules.d/20_mod_fcgid.conf:
<IfDefine FCGID>

        LoadModule fcgid_module modules/mod_fcgid.so
        SocketPath /var/run/fcgidsock
        SharememPath /var/run/fcgid_shm

        IPCConnectTimeout 30
#       IPCCommTimeout 120
IPCCommTimeout 200
PHP_Fix_Pathinfo_Enable 1
</IfDefine>


Comment 17 Evert 2008-02-27 10:43:07 UTC
reopen, see comment #16
Comment 18 Benedikt Böhm (RETIRED) gentoo-dev 2008-02-27 19:51:50 UTC
(In reply to comment #15)
> I see the state of this bug is marked as RESOLVED TEST-REQUEST but for that I
> still *need input* from gentoo how to rewrite mod_fastcgi's statement
> FastCgiExternalServer for mod_fcgid. If that's too hard to understand, please
> leave this bug closed forever and ever!

unfortunately i cannot help you there, but mod_fastcgi will stay in the tree ...
Comment 19 Evert 2008-08-17 13:37:48 UTC
mod_fastcgi will stay in the tree so I guess there's no point for this bug to stay open anymore, closing...