Re: FastCGI with Apache 2.2.0
"Vishal Singh" <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Gerry,
Thanks alot.
I could install the mod_fastcgi after patching the distribution using
the patch provided at following location.
http://www.fastcgi.com/archives/fastcgi-developers/2005-December/004060.html
This fixes the compilation problem "mod_fastcgi.c:271: error:
'ap_null_cleanup' undeclared" and allows to install using the
instructions in INSTALL.AP2,
Now, I want to test it and make sure it works fine.
I was trying to run the following code
http://www.fastcgi.com/devkit/doc/fcgi-devel-kit.htm
#include "fcgi_stdio.h"
#include <stdlib.h>
void main(void)
{
int count = 0;
while(FCGI_Accept() >= 0)
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello!</title>"
"<h1>FastCGI Hello!</h1>"
"Request number %d running on host <i>%s</i>\n",
++count, getenv("SERVER_NAME"));
}
I had added the following line in my httpd.conf
"LoadModule fastcgi_module modules/mod_fastcgi.so"
And, I am putting the binary generated by compiling the above code in
<apache_dir>/cgi-bin/
The request url is http://<server_name>/cgi-bin/<binary_name>
The FCGI_Accept returns 0, but each request creates a new process.
This could be verified by observing that that count always returned
1.
Am I doing something worng? Do I need to do anything else., Any
pointers will be helpful.
After doing make install in the mod_fcgi distribution, it copied the
mod_fastcgi.so in <apache_dir>/modules directory.
How did u verify the installation was working as expected?
Regards,
Vishal
On 4/4/06, Gerry Marthe <[email protected]> wrote:
> I had a little trouble with this myself.
>
> First of all, you should read the INSTALL.AP2 file that comes in the tar
> file - this explains that you may need to specify the parameter
> "top_dir" for the Apache2 source when running make.
>
>
> > *NIX
> > ====
> >
> > $ cd <mod_fastcgi_dir>
> > $ cp Makefile.AP2 Makefile
> > $ make
> > $ make install
> >
> > If your Apache2 installation isn't in /usr/local/apache2, then
> > set the top_dir variable when running make (or edit the
> > Makefile), e.g.
> >
> > $ make top_dir=/opt/httpd/2.0.40
> >
> > Add an entry to httpd.conf like this:
> >
> > LoadModule fastcgi_module modules/mod_fastcgi.so
>
>
> Secondly, I found that if running a recent distribution such as Fedora Core 5,
> the make generated a lot of errors regarding old apache 1.3 function calls.
> The header file "ap_compat.h" included with Apache 2.2 does not include "apu_compat.h" as it
> used to. Indeed, I couldn't find any include files resolving the mapping between old apache 1.3 functions
> and the new version 2.x functions.
>
>
> If that is the case, the Make will fail with errors such as:
>
> > mod_fastcgi.c:271: error: 'ap_null_cleanup' undeclared (first use in this function)
>
> One solution is to edit the source files, replacing the old function names
> with the new ones. For instance, the function "ap_null_cleanup" should be
> apr_pool_cleanup_register (). You can find the function name mappings by
> consulting the file "apu_compat.h" from an older version of apr-devel (Fedora package), but I've included
> it here for convenience.
>
> Its a bit tedious to do, but it works. Just the same I'd be interested to know how the compatibility issue is supposed
> to work with the version 2.2 include file of "ap_compat.h" - I'll paste it below:
>
> > /**
> > * @file ap_compat.h
> > * @brief Redefine Apache 1.3 symbols
> > */
> >
> > #ifndef AP_COMPAT_H
> > #define AP_COMPAT_H
> >
> > /* redefine 1.3.x symbols to the new symbol names */
> >
> > #define MODULE_VAR_EXPORT AP_MODULE_DECLARE_DATA
> > #define ap_send_http_header(r) ;
> >
> > #endif /* AP_COMPAT_H */
>
>
>
>
> On Mon, 2006-04-03 at 21:51 -0400, Vishal Singh wrote:
> > Hello,
> >
> > Has anyone tried FastCGI with apache 2.2.0.
> > The install documentation with the distribution of mod_fastcgi-2.4.2
> > i.e, http://fastcgi.com/mod_fastcgi/INSTALL assumes presence of
> > <apache_dir>/src which is not there in Apache 2.0 and 2.2 versions
> > and it was present in Apache 1.3.34 versions. Also, the
> > --activate-module is not there in the latest configure file of apache.
> >
> > Can anyone share the installation instructions for adding the fast_cgi
> > module to Apache 2.2.0.?
> >
> > Is fast_cgi now inbuilt in Apache?
> >
> > Regards,
> > Vishal
> > ___________________________________
> > fastcgi-developers mailing list
> > http://fastcgi.com/fastcgi-developers/
> --
>
>
>
>
>
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/