Unix Build Instructions
-----------------------

To build and install as a DSO outside of the httpd source
build, from the fcgid source root directory, simply;

    ./configure.apxs
    make
    make install

If apxs is not in your path, or you are building to a different
httpd installation, or your distribution has an alternate script
name for apxs (e.g. apxs2), then either set the APXS environment
variable, or use the syntax;

    APXS=/path/to/bin/apxs ./configure.apxs

so the desired configuration is used.

To build static, or as a DSO but within the same build as httpd,
copy the entire fcgid source directory tree on top of your existing 
httpd source tree, and from the httpd source root directory

    ./buildconf  (to pick up fcgid)
    ./configure --enable-fcgid {your usual options}

and proceed as usual.


Win32 Build Instructions
------------------------

1. Win32 build based on Visual Studio

The windows packages prior to 2.2.7 (or 2.0.62) left out the file
include\mod_log_config.h, just copy these from the source tree
or you can export them from subversion, just change to your
installed Apache 2.2 (or 2.0) include subdirectory and...

  svn export http://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/modules/loggers/mod_log_config.h

(for your 2.0 installation, replace 2.2.x with 2.0.x in the
command above).  You should be ready to compile the project.

On windows, before building for httpd-2.0, you must adjust the
two apr 1.x specific lines in modules\fcgid\mod_fcgid.dsp which begin

    # ADD LINK32 libapr-1.lib libaprutil-1.lib ...

to start with the apr 0.9 equivilants for httpd-2.0,

    # ADD LINK32 libapr.lib libaprutil.lib ...

If using httpd development version 2.3 plus APR 2.0, replace both 
of these entries with the single (combined) entry;

    # ADD LINK32 libapr-2.lib ...

To build on windows out-of-tree as a DSO, simply

    set APACHE2_HOME=c:\path\to\Apache2.2

and then, for Visual Studio 6.0 (98)...

    msdev /useenv mod_fcgid.dsw

or for Visual Studio .NET (2002) and later ...

    devenv /useenv mod_fcgid.dsw

The later command is needed on Visual Studio .NET/2002 and later, 
and converts mod_fcgid.dsw to mod_fcgid.sln.  So after converting once,
use the newly converted solution instead...

    devenv /useenv mod_fcgid.sln

On windows you can overlay mod_fcgid source files into the httpd source
file tree, and make the following changes for an in-tree build;

 * Manually add the project mod_fcgid.dsp to the Apache.dsw workspace.
 * Ensure the BuildBin project includes the mod_fcgid project dependency.
 * Add mod_fcgid project dependencies of libhttpd, libapr and libaprutil.
 * Remove /D "FCGID_APXS_BUILD" from the # ADD CPP lines of
   modules\fcgid\mod_fcgid.dsp.
 * Replace /I "$(APACHE2_HOME)/include" with /I "../../modules/loggers" 
   for both # ADD CPP lines of modules\fcgid\mod_fcgid.dsp.
 * Remove the libraries libapr[-1].lib libaprutil[-1].lib libhttpd.lib 
   and the /libpath:"$(APACHE2_HOME)\lib" flag from the # ADD LINK32 
   lines of modules\fcgid\mod_fcgid.dsp.

Note that mod_fcgid.so needs to be added to the module installation 
lines in Makefile.win, or you must manually copy the .so module from 
modules\fcgid\Release after compiling.

2. Win32 build based on cmake:

Note: This support is experimental and may not build mod_fcgid in a
      manner compatible with the existing Windows build support.  The
      build interfaces may change as feedback is received and bugs are
      resolved.  Currently a .conf file is not created.

Install httpd and APR to a common prefix, and point CMAKE_INSTALL_PREFIX
to that prefix when configuring mod_fcgid.

Example using the "NMake Makefiles" generator from a Visual Studio command
prompt:

  cd some-build-directory
  cmake -G "NMake Makefiles" ^
        -DCMAKE_INSTALL_PREFIX=C:\Apache246 ^
        -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
        C:\path\to\fcgid-sources\modules\fcgid
  nmake && nmake install

The last argument to cmake in the example is the directory "modules\fcgid"
within your svn checkout or tarball/zip extract of mod_fcgid.

Add -DINSTALL_PDB=OFF to the cmake invocation to leave mod_fcgid.pdb (if
generated) in the build directory.

Add the following LoadModule directive to your configuration:

  LoadModule fcgid_module modules/mod_fcgid.so

Documentation Build
-------------------

To regenerate the html.en documentation, here again it's as simple
as copying the content docs/ into an httpd/docs/ tree and regenerating
httpd's documentation.  However, it's also possible you are generating
a local copy for reference in mod_fcgid's tree, in that case you must
have a copy of the httpd docs/manual/style.  For example;

    cd docs/manual
    svn co http://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/docs/manual/style

In either case;

    cd docs/manual
    svn co http://svn.apache.org/repos/asf/httpd/docs-build/trunk build
    cd build

and finally;

    ./build.sh all

or on windows...

    build.bat all

To make this simpler on unix, after invoking ./configure.apxs in the 
top level directory, you can simply;

    make generate-docs

which will fetch up those style and build directories (for httpd-2.2)
and generate the docs for you.  After using make and make install, you
can even merge the directives for the installed manual using this target;  

    make manualdir=/path/to/httpd/manual generate-docs

The same rules about an installed, locatable JAVA_HOME apply to building
mod_fcgid docs as apply to building the httpd manual.

The advantage to building in-tree within httpd is that you gain the complete
directive cross references applicable to all httpd and mod_fcgid directives,
before installing the httpd\manual files.


Incompatible configuration changes
----------------------------------
Some changes have been made in the ASF release of mod_fcgid which can affect
existing configurations:

i.   All directives have been renamed in order to use a common prefix "Fcgid".
     Underscores in directive names have been eliminated in favor of
     CamelCase. The old directive names will still work but are deprecated.
     To fix your configuration you can use the sed script build/fixconf.sed.
     A table with old and new directive names is included in CHANGES-FCGID.

ii.  Some directives which could be placed inside <VirtualHost > but were
     ignored before now result in configuration errors.  As before, these 
     directives must be set at global scope to have the desired effect.
     The directives are FcgidBusyScanInterval, FcgidBusyTimeout,
     FcgidMaxProcessesPerClass, FcgidDefaultMinProcessCount,
     FcgidErrorScanInterval, FcgidIdleScanInterval, FcgidIdleTimeout,
     FcgidMaxProcesses, FcgidFixPathinfo, FcgidProcessLifetime,
     FcgidProcessTableFile, FcgidIPCDir, FcgidSpawnScore,
     FcgidSpawnScoreUpLimit, FcgidTerminationScore, FcgidTimeScore, and 
     FcgidZombieScanInterval.

iii. Some directives which could be placed inside <VirtualHost > but were
     ignored before are now respected.  These include FcgidIdleTimeout,
     FcgidProcessLifeTime, and others.  (Consult CHANGES-FCGID for the complete
     list.)

iv.  Some directives which can optionally be placed inside <VirtualHost >
     were not inherited as expected in older releases.  This has been
     corrected, and behavior will change for some configurations.  The 
     affected directives are FcgidIOTimeout, FcgidConnectTimeout,
     FcgidMaxRequestInMem, FcgidMaxRequestLen, FcgidMaxRequestsPerProcess,
     and FcgidOutputBufferSize.

v.   Some directives which can be placed inside <Directory >, <Location >,
     etc. were not inherited as expected in older releases.  This has been
     corrected, and behavior will change for some configurations.  The affected
     directives are FcgidAccessChecker, FcgidAccessCheckerAuthoritative,
     FcgidAuthenticator, FcgidAuthenticatorAuthoritative, FcgidAuthorizer,
     FcgidAuthorizerAuthoritative, and FcgidWrapper.

Acknowledgements
----------------
Portions of this software were originally developed by
Ryan Pan (Pan Qingfeng) <pqf@mailtech.cn>.

This software implements portions of the FastCGI specification
as defined by Open Market, Inc.  The specification is available from
  http://www.fastcgi.com/devkit/doc/fcgi-spec.html
