Apache httpd module

This module allows the Grassroots infrastructure to be used with an Apache httpd web server. This means that the Grassroots infrastructure can take advantage of all of the functionality that httpd provides.


To build this module, you need the grassroots core and grassroots build config installed and configured.

The files to build the Grassroots module are in the build/<platform> directory.


If you enter this directory

cd build/linux

you can then build the service by typing

make all

and then

make install

to install the module into the appropriate httpd installation allowing the Grassroots system to be used in conjunction with it.


As well as installing the module, httpd requires a couple of alterations to allow the Grassroots system to be available.

Module configuration file

The first change is to set up the module configuration. This is done using a standard httpd configuration file and an example is at conf/httpd_grassroots.conf in this repository. It requires some modules to provide the caching functionality to store job data between requests in a multi-process and multi-threaded environment

The only parts that a server administrator would need to change are what uri to use for the Grassroots system and the directory in which the Grassroots system is installed.

The uri is set using the standard httpd directives such as <Location> and <LocationMatch> and the installation directory is specified using the GrassrootsRoot directive which takes a string denoting the path. The content of an example configuration is file is shown below.

The available configuration properties are described below:

  • GrassrootsCache: The provider for the Jobs Cache
  • GrassrootsConfig: The config file to use for this Grassroots Server
  • GrassrootsServicesConfigPath: The path to the individual services config files AP_INIT_TAKE1 ("GrassrootsReferenceServicesPath", SetGrassrootsReferencesPath, NULL, ACCESS_CONF, "The path to the referred service files"), AP_INIT_TAKE1 ("GrassrootsRoot", SetGrassrootsRootPath, NULL, ACCESS_CONF, "The path to the Grassroots installation"), AP_INIT_TAKE1 ("GrassrootsServersManager", SetGrassrootsServersManager, NULL, ACCESS_CONF, "The path to the Grassroots Servers Manager Module to use"), AP_INIT_TAKE1 ("GrassrootsJobManager", SetGrassrootsJobsManager, NULL, ACCESS_CONF, "The path to the Grassroots Jobs Manager Module to use"),
# Load the Grassroots module and the caching modules required
# for storing persistent data when the server is running
LoadModule grassroots_module modules/mod_grassroots.so
LoadModule cache_module modules/mod_cache.so
LoadModule cache_socache_module modules/mod_cache_socache.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
# Set the caching preferences for storing the persistent data
CacheSocache shmcb
CacheSocacheMaxSize 102400
# Set the uri for the Grassroots infrastructure requests
<LocationMatch "/grassroots/controller">
# Let Grassroots handle these requests
SetHandler grassroots-handler
# The path to the Grassroots root directory
GrassrootsRoot /opt/grassroots-0/grassroots

Updating envvars

The Apache httpd server also needs to have access to the paths where the Grassroots infrastructure and its dependencies are located. This is done be editing the envvars file that is part of the httpd distribution and is normally located at bin/envvars.

# Begin Grassroots
# Set the Grassroots installation path
# Add all of the paths for the dependencies
# End Grassroots