4.2.4 If you already have an Apache installation
If you already have an installation of Apache which you want to use it is possible to copy the necessary parts of the MS4W bundle to your installation. The details will depend on exactly how you have configured your installation but the main steps you will need to follow are as follows. They are in the context of using a pristine Apache (v2.2.17) installation so, if you have done a lot of customization of your installation you may need to adapt them.
Instead of following all the above steps for installation simply unzip the ms4w.zip file to a convenient temporary location. You will then need to copy the following files over to your existing Apache installation. In the following we give directory paths from the ms4w root wherever you unzipped it.
Copy the contents of ms4w\Apache\cgi-bin to the cgi-bin directory of your Apache installation. (Strictly you may not need all these files but it is easier just to copy them all across.)
Add the following directives in an appropriate place in your httpd.conf file.
# Alias for MapServer tmp directory
Alias /ms_tmp/ /ms4w/tmp/ms_tmp/
Order allow, deny
Allow from all
Replace "/ms4w/tmp/" with the path to somewhere on your machine suitable for storing the temporary image files which MapServer generates during its operation. You may also want to copy the contents of ms4w\tmp to this directory as it contains a script that can be used to delete old files from this directory and which could be set as a scheduled task.
You will also want to copy the following directories from the MS4W bundle to somewhere convenient on your machine: ms4w\proj\nad, ms4w\gdaldata and ms4w\gdalplugins. Then add the following to your httpd.conf file, replacing the path /ms4w/ with the directory you have copied the above directories to.
# set environment vars necessary for MapServer
SetEnv PROJ_LIB /ms4w/proj/nad/
# Replace /Apache/cgi-bin/ below with your
# Apache cgi-bin directory path
SetEnv PATH /Apache/cgi-bin/
# Set GDAL_DATA environment variable to location
# of supporting gdal files
SetEnv GDAL_DATA "/ms4w/gdaldata"
# Set GDAL_DRIVER_PATH environment variable for gdal plugins
SetEnv GDAL_DRIVER_PATH "/ms4w/gdalplugins"
# uncomment the following line to log MapServer errors to a file
#SetEnv MS_ERRORFILE "/ms4w/tmp/ms_error.txt"
Section last modified: 11 June 2013