Installing mod_fcgid on Apache HTTP Server 2.0.x configurations under Linux/Unix
search cancel

Installing mod_fcgid on Apache HTTP Server 2.0.x configurations under Linux/Unix

book

Article ID: 341896

calendar_today

Updated On:

Products

VMware Support Only for Apache HTTP

Issue/Introduction

The PHP version included in vFabric Enterprise Ready Server (ERS) 4.0.x for Apache HTTP Server 2.0.x configurations is limited to PHP4. This article provides information on how to compile the mod_fcgid httpd module for such a system, so that httpd can be configured to use a PHP installation of your choice.

Environment

VMware vFabric Enterprise Ready Server 4
Apache HTTP Server 2.0

Resolution

To install mod_fcgid on Apache HTTP Server 2.0.x configurations under Linux/Unix:

  1. Obtain the latest version of mod_fcgid from http://httpd.apache.org/mod_fcgid/.

    Note: The preceding link was correct as of November 11, 2011. If you find the link is broken, provide feedback and a VMware employee will update the link.

  2. Unpack the mod_fcgid files to a convenient location.
  3. Open the apxs script located at /path/to/ers/apache2.0/bin/ using a text editor.
  4. Change the first line:

    #!/usr/local/bin/perl –w

    To

    #!/bin/sh /path_to_ers/perl5.8/bin/perl

    For example:

    #!/bin/sh /usr/local/ers/perl5.8/bin/perl

  5. Change directory to the mod_fcgid installation files.
  6. Run this command:

    APXS=/path/to/ers/apache2.0/bin/apxs ./configure.apxs

  7. Ensure that you have installed a C compiler toolchain on your system to compile mod_fcgid.
  8. To compile mod_fcgid, run this command:

    make; make install


    Note: You may see this error, which can be safely ignored:

    Installing configuration files

    make[1]: /path/to/ers/httpd-2.0-svn/build/mkdir.sh: Command not found.


  9. Move the mod_fcgid.so file located at /path/to/ers/apache2.0/modules to the standard subdirectory within the modules directory, so that the path to the mod_fcgid.so file is /path/to/ers/apache2.0/modules/standard/.

  10. If you want to build a version of PHP of your choice, use this configuration line:

    ./configure --enable-cgi --enable-maintainer-zts --with-openssl --with-iconv --with-ldap --with-zlib --with-libxml-dir=/usr/lib --with-xsl --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib/

    Notes:
    • This entry assumes that the local php installation resides in /usr/local/php.
    • Ensure to enable cgi when building PHP as mod_fcgid depends on the php-cgi binary to serve PHP content.
    • You may have to install third party applications to meet the build requirements. You may also elect to incorporate additional features in your PHP build. Such modifications are beyond the scope of this document. For more information on the installation and configuration issues, see the PHP documentation.

  11. Set up mod_fcgid with the PHP installation of your choice. For more information, see Using your own version of PHP with vFabric Enterprise Ready Server (ERS) under Linux/Unix (2001316).

    Note: You may have to remove or comment these lines from httpsd.conf file to avoid the PHP4 module from loading:

    <IfModule !worker.c>

    LoadModule php4_module "/path/to/ers/apache2.0/modules/php/mod_php4.so"
    </IfModule>

    <IfModule mpm_winnt.c>

    LoadFile "/path/to/ers/php4.4/bin/php4ts.dll"

    </IfModule>


    <IfModule sapi_apache2.c>

    PHPINIDir /path/to/ers/php5.2/etc

    AddType application/x-httpd-php .php
    </IfModule>


Additional Information

Using your own version of PHP with vFabric Enterprise Ready Server (ERS) under Linux/Unix