mod_fcgid

mod_fcgid is a high performance alternative to mod_cgi or mod_cgid, which starts a sufficient number instances of the CGI program to handle concurrent requests, and these programs remain running to handle further incoming requests.

   1 wget http://mirrors.up.pt/pub/apache//httpd/mod_fcgid/mod_fcgid-2.3.9.tar.bz2
   2 tar xvif mod_fcgid-2.3.9.tar.bz2 
   3 cd mod_fcgid-2.3.9
   4 ./configure.apxs 
   5 make
   6 make install
   7 /usr/lib/httpd/modules/mod_fcgid.so
   8 # /etc/httpd/httpd.conf
   9 # LoadModule fcgid_module lib/httpd/modules/mod_fcgid.so
  10 

fcgi library

   1 cd /tmp/
   2 wget https://slackbuilds.org/slackbuilds/14.2/libraries/fcgi.tar.gz
   3 tar xvzf fcgi.tar.gz 
   4 cd fcgi
   5 wget https://sourceforge.net/projects/slackbuildsdirectlinks/files/fcgi/fcgi-2.4.0.tar.gz
   6 ./fcgi.SlackBuild 
   7 installpkg  /tmp/fcgi-2.4.0-i486-1_SBo.tgz

fcgi_app.c

   1 /*compile:  cc fcgi_app.c -o fcgi_app -lfcgi */
   2 /* /usr/lib/libfcgi.so */
   3 /* cp /tmp/fcgi_app /var/www/htdocs/localhostfcgi/app.fcgi */
   4     #include <fcgi_stdio.h>
   5 
   6     void main(void)
   7     {
   8         int count = 0;
   9         while(FCGI_Accept() >= 0) {
  10             printf("Content-type: text/html\r\n");
  11             printf("\r\n");
  12             printf("Hello world!<br>\r\n");
  13             printf("Request number %d.", count++);
  14         }
  15         exit(0);
  16     }

mod_fcgid (last edited 2019-08-16 22:49:39 by localhost)