Build Apache with mod_fcgid

I think i needed to write this after successfully building Apache with mod_fcgid firstly becoz there was no proper tutorial available for this n secondly becoz i m writing after a long time.

Anyways back to the topic. To run php as a fast-cgi module we need to first build apache using mod_fcgid. You guys can also use mod_fastcgi(Caution: mod_fastcgi developement has been discontinued and not supported). Here is a step by step procedure:

1.) First download the source code for mod_fcgid from the Apache website.(lazy folks can find the link here).

2.) Next, untar the archive to your apache source folder to the top of the tree. So if my apache source is in /usr/local/src/httpd/, I will untar my mod_fcgid source to this folder.

3.)  Change your directory to the apache source in your terminal. run ./buildconf for the apache config file to pick up mod_fgcid.

4.) Run ./configure script with the options that u want adding –enable-fcgid to the end of it.

5.) Now the fun starts. If you issue the make command now it will spew out errors. Heres where i spend most of the time on.

6.) cd to (whatever your apache src folder is)/(whatever your mod_fcgid src folder is)/modules/fcgid/. Copy the entire contents to  (whatever your apache src folder is)/modules/fcgid/

7.) Run the ./configure script again. followed by the make and the make install command.

There you go your Apache can now handle FastCGI. I tried this on my developement box which is Ubuntu Karmic machine but i don’t think there will be much difference for other machines since we are compiling from the source.

I will be posting soon… till then Adios !

–Tojo Chacko

4 Replies to “Build Apache with mod_fcgid”

    1. performance wise php with fast-cgi is faster for servers handling multiple sites. because it has less memory foot print as compared to a php module.

      Secondly for php modules even if one application goes wrong it affects other sites also, for php fast-cgi this is not the case. it has one persistent process and uses multiple threads for different sites.

Leave a comment