While running some tests that required building the CFMX Apache connector module from source I became rather weary of typing out all the instructions again and again as I repeated the test. So I decided to write a little script that does it all for me to save time and typing. You can download it here.
The script is intended for Linux, although it may run on Solaris, I haven't tested that. Do not edit the file on Windows if you plan to use it on Linux/Unix.

The script uses the -DEAPI switch to stop the Apache warning:
[warn] Loaded DSO /opt/coldfusionmx/runtime/lib/wsconfig/2/mod_jrun.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI) Please read the usage, assumption, and caveat before using the script. Its better to download the script than to copy it from your browser screen below.
For a good reference on building the module by hand without this script, see this reference.
Update 10/10/03: Based on reader feedback, I've modified the script to now create a back up of the old mod_jrun.so so that its renamed with a timestamp such as mod_jrun.so.Oct101657022003. The script also creates a log file of the event, in the same directory as from where you run the script. Again, this version works for Apache 1.3.2x, but can be easily modified to work for Apache 2, but as far as I know Apache 2 doesn't complain about EAPI.


#!/bin/sh
##--------------------------------------------------------------
## ColdFusion MX Connector Module Build Script
## Date: October 10, 2003
## Author: Steven Erat
##
## Purpose: This script can be used to build a ColdFusionMX
## connector module for Apache, compiled from source with -DEAPI
##
## Why use this script?: Rather than typing and retyping
## the instructions used in ApacheBuildInstructions
## each time, use a script instead to save time.
##
## Usage: Set the script variables below, stop Apache,
## make this script executable (chmod u+x), run this script,
## start Apache. A log file is created for your records in
## the directory from which you run this script, called
## cfmx_connector_build.log
##
## Assumptions: This script expects that you have already
## configured Apache for ColdFusion, that httpd.conf is
## still configured, that you are building a new mod_jrun.so
## to use instead of the existing one already in the
## $CFMX_CONNECTOR directory. This script backs up the
## the existing mod_jrun.so to mod_jrun.so.${DATETIME}
## where ${DATETIME} is a timestamp for your reference.
##
## This script is based on ApacheBuildInstructions.txt, which
## is found in {cfhome}/runtime/connectors/src/. This script
## is set to build a module for Apache 1.3.2x because that
## version complains with the EAPI warning. If you want to
## use this for Apache 2, then modify this script based on
## the Apache 2 instructions in ApacheBuildInstructions.txt
##
## Build Errors: ColdFusion provides the .c and .h files
## and its up to apxs to figure out how how to compile
## and link everything. Should you get a build error such
## as "apxs:Break: Command failed with rc=16777215", then
## you are on your own to take it up with the Apache community,
## because this is not ColdFusion's fault.
##
## Warning: Use at your own risk!!! By using this script
## you agree to not hold the author, author's employer,
## author's friends, or author's dog liable for any havoc
## that you create on your system while using this script.
##
## Remember its always a good idea to back things up first!
##
## Be sure to read ApacheBuildInstructions.txt for more
## options and to know what's going on here...
##--------------------------------------------------------------

##---------------------------------
## SET SCRIPT VARS HERE
##---------------------------------
## Make any additions to PATH here if necessary
#PATH=
## ColdFusionMX's root directory
CFMX_HOME=/opt/coldfusionmx
## Path to the connector module directory
CFMX_CONNECTOR=$CFMX_HOME/runtime/lib/wsconfig/2
## Apache bin directory
APACHE_BIN=/opt/apache/1.3.27/bin

##----------------------------------
## DO NOT EDIT BELOW THIS POINT
## UNLESS YOU REALLY NEED TO
##----------------------------------
echo "Building ColdFusion MX Connector Module from source"
echo "Apache should be stopped for this"
## Name of Log file to redirect stdout and stderr
## Log will be located in $CFMX_CONNECTOR directory
LOG="`pwd`/cfmx_connector_build.log"
## Write name, date and parameters to log file
echo "CFMX Connector Module Build Script Log" > $LOG
echo `date` >> $LOG
echo "CFMX_HOME=$CFMX_HOME" >> $LOG
echo "CFMX_CONNECTOR=$CFMX_CONNECTOR" >> $LOG
echo "APACHE_BIN=$APACHE_BIN" >> $LOG
## Change to the directory already containing mod_jrun.so
msg="Changing directory to $CFMX_CONNECTOR"
echo $msg >> $LOG
echo $msg
cd $CFMX_CONNECTOR >> $LOG 2>&1
## Set a date-timestamp to use when renaming old mod_jrun.so
DATETIME=`date | cut -d" " -f2,3,4,6 --output-delimiter=""
| cut -d: -f1,2,3 --output-delimiter=""`
## Remove the old files, if any
msg="Moving previous mod_jrun.so to mod_jrun.so.${DATETIME}"
echo $msg >> $LOG
echo $msg
mv mod_jrun.so "mod_jrun.so.${DATETIME}" >> $LOG 2>&1
## Unzip connector source code to new connector directory
msg="Unzipping ApacheModule.zip to $CFMX_CONNECTOR"
echo $msg >> $LOG
echo $msg
unzip ${CFMX_HOME}/runtime/connectors/src/ApacheModule.zip
-d $CFMX_CONNECTOR >> $LOG 2>&1
## Call apxs with appropriate flags to build connector module
msg="Running apxs to build connector module now"
echo $msg >> $LOG
echo $msg
${APACHE_BIN}/apxs -c -Wc,-w -DJRUN_SSL -DEAPI mod_jrun.c
jrun_maptable_impl.c jrun_property.c jrun_session.c
platform.c jrun_mutex.c jrun_proxy.c jrun_ssl.c
>> $LOG 2>&1
## finish up and clean out the directory of unwanted files
msg="Cleaning up"
echo $msg >> $LOG
echo $msg
strip mod_jrun.so >> $LOG 2>&1
rm *.txt *.h *.c *.o *.rc *.rc2 >> $LOG 2>&1
echo "Finished at `date`" >> $LOG
echo "Done."
echo "Check $LOG for details"
echo "Remember to restart Apache"
echo
##----------------------------------
## END OF SCRIPT
##----------------------------------