Add JavaScript Agent - Apache

You can use Apache to add the tCell JavaScript agent to any page automatically. The Apache mod we'll need is mod_substitute. It is included in the standard httpd 2.4 install and the source is included in the standard httpd 2.2 distribution.

Once you have the module enabled, you just need the following changes to your httpd.conf file:

  1. Enable the mod if it isn't enabled already.
    1
    LoadModule substitute_module modules/mod_substitute.so
  2. Configure the module to add the script tag to all html pages.
    1
    <Location "/">
    2
    AddOutputFilterByType SUBSTITUTE text/html
    3
    Substitute "s|<head>|<head><script src='https://us.jsagent.tcell.insight.rapid7.com/tcellagent.min.js' tcellappid='ADD_APP_ID' tcellapikey='ADD_API_KEY'></script>|niq"
    4
    </Location>

Note: You can get your app ID and API key from the tCell management console as described here.