Re: mod_fastcgi vs. mod_fcgid

Alex Efros <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel,gmane.spam.detected
Organization asdfGroup Inc., http://powerman.asdfGroup.com/
Message-ID <[email protected]>
Hi!

On Sat, Sep 22, 2007 at 09:07:03AM -0700, Fred Krogh wrote:
> I'm using Apache 2.2.6 and have recently switched from mod_fastcgi to
> mod_fcgid.  The only reason for doing this was that Gentoo seemed to be
> pushing me in that direction.  Is there any connection between these
> modules?  Should mod_fastcgi be preferred and if so why?

Gentoo devs doing a lot of good work, but they can't do all work in the
world themselves. So, several unsupported packages was removed from
main portage tree. If somebody will support them - they will be returned
back to main portage tree, I think.

AFAIK mod_fcgid was preferred because it:
1) has better process management (at least it say so on it website)
2) under active development and has support

For me mod_fcgid unacceptable because one of main reasons why I use
FastCGI is ability to start CGI scripts under usual user account, and
possibility to do this on another server - so I need FastCgiExternalServer
feature which is not realized in mod_fcgid.

You can work around this by using own ebuild for mod_fastcgi in portage
overlay (usually - /usr/local/portage). Run:
    mkdir -p /usr/local/portage/net-www/mod_fastcgi/files
and save three attached files to:
    /usr/local/portage/net-www/mod_fastcgi/mod_fastcgi-2.4.2-r1.ebuild
    /usr/local/portage/net-www/mod_fastcgi/files/mod_fastcgi-httpd-2.2.3.patch
    /usr/local/portage/net-www/mod_fastcgi/files/20_mod_fastcgi.conf
then run:
    ebuild /usr/local/portage/net-www/mod_fastcgi/mod_fastcgi-2.4.2-r1.ebuild digest
and now you can just emerge it and continue using it:
    emerge mod_fastcgi

-- 
			WBR, Alex.

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
mod_fastcgi-2.4.2-r1.ebuild (text/plain, 926 B)
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/mod_fastcgi/mod_fastcgi-2.4.2-r1.ebuild,v 1.9 2006/06/05 18:30:57 chtekk Exp $

inherit eutils apache-module

DESCRIPTION="FastCGI  is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs."
KEYWORDS="amd64 ppc sparc x86"
SLOT="0"
HOMEPAGE="http://fastcgi.com/"
SRC_URI="http://fastcgi.com/dist/${P}.tar.gz"
LICENSE="mod_fastcgi"

APXS1_ARGS="-c mod_fastcgi.c fcgi*.c"
APXS2_ARGS="${APXS1_ARGS}"

APACHE1_MOD_CONF="20_mod_fastcgi"
APACHE2_MOD_CONF="20_mod_fastcgi"

APACHE1_MOD_DEFINE="FASTCGI"
APACHE2_MOD_DEFINE="FASTCGI"

DOCFILES="CHANGES README docs/LICENSE.TERMS docs/mod_fastcgi.html"

need_apache


src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/${PN}-httpd-2.2.3.patch
}
20_mod_fastcgi.conf (text/plain, 204 B)
<IfDefine FASTCGI>
	<IfModule !mod_fastcgi.c>
		LoadModule fastcgi_module    modules/mod_fastcgi.so
	</IfModule>

	<IfModule mod_fastcgi.c>
		AddHandler fastcgi-script .fcg .fcgi
	</IfModule>
</IfDefine>
mod_fastcgi-httpd-2.2.3.patch (application/x-patch, 1.6 KB)
--- mod_fastcgi-2.4.2/fcgi.h	2003-02-04 00:07:37.000000000 +0100
+++ mod_fastcgi-2.4.2-ap22/fcgi.h	2005-12-07 21:05:55.000000000 +0100
@@ -73,6 +73,36 @@
 #define ap_reset_timeout(a)
 #define ap_unblock_alarms()
 
+/* starting with apache 2.2 the backward-compatibility defines for
+ * 1.3 APIs are not available anymore. Define them ourselves here.
+ */
+#ifndef ap_copy_table
+
+#define ap_copy_table apr_table_copy
+#define ap_cpystrn apr_cpystrn
+#define ap_destroy_pool apr_pool_destroy
+#define ap_isspace apr_isspace
+#define ap_make_array apr_array_make
+#define ap_make_table apr_table_make
+#define ap_null_cleanup apr_pool_cleanup_null 
+#define ap_palloc apr_palloc
+#define ap_pcalloc apr_pcalloc
+#define ap_psprintf apr_psprintf
+#define ap_pstrcat apr_pstrcat
+#define ap_pstrdup apr_pstrdup
+#define ap_pstrndup apr_pstrndup
+#define ap_push_array apr_array_push
+#define ap_register_cleanup apr_pool_cleanup_register
+#define ap_snprintf apr_snprintf
+#define ap_table_add apr_table_add
+#define ap_table_do apr_table_do
+#define ap_table_get apr_table_get
+#define ap_table_set apr_table_set
+#define ap_table_setn apr_table_setn
+#define ap_table_unset apr_table_unset
+
+#endif /* defined(ap_copy_table) */
+
 #if (defined(HAVE_WRITEV) && !HAVE_WRITEV && !defined(NO_WRITEV)) || defined WIN32
 #define NO_WRITEV
 #endif
diff -ruN mod_fastcgi-2.4.2/Makefile.AP2 mod_fastcgi-2.4.2-ap22/Makefile.AP2
--- mod_fastcgi-2.4.2/Makefile.AP2	2002-07-29 03:36:34.000000000 +0200
+++ mod_fastcgi-2.4.2-ap22/Makefile.AP2	2005-12-07 20:27:50.000000000 +0100
@@ -20,8 +20,6 @@
 
 all: local-shared-build
 
-install: install-modules
-
 clean:
 	-rm -f *.o *.lo *.slo *.la
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.