Apache with mod_wsgi

The Python Agent beta supports only mod_wsgi configurations that use WSGIScriptAlias that point to a single WSGI file. For example, the following type of configuration is supported:
WSGIScriptAlias /books /var/www/acme/bookstore/app.wsgi

If, instead, the script alias points to a directory, or if the script is using the WSGIScriptAliasMatch directive, contact python@appdynamics.com to discuss how the Python Agent can be deployed in your environment.

If the environment is Apache with mod_wsgi with a supported configuration as described above, you need to modify its mod_wsgi configuration files and manually launch the proxy.

To instrument an app for Apache with mod_wsgi:

  1. Create the configuration file described in Configure the Agent.
  2. Modify the mod_wsgi configuration file.
    If the mod_wsgi configuration file has an entry like this:
    WSGIScriptAlias /books /var/www/acme/bookstore/app.wsgi
    WSGICallableObject application
    Modify it to look like this, assuming that you have stored the configuration file in /etc/appdynamics.cfg:
    SetEnv APPD_CONFIG_FILE /etc/appdynamics.cfg
    SetEnv APPD_WSGI_MODULE acme.bookstore:app
    WSGIScriptAlias /books /<path_to_virtualenv>/lib/python3.10/site-packages/appdynamics/scripts/wsgi.py
  3. Before running any traffic through the instrumented app, manually launch the proxy by executing:
    pyagent proxy start