AppDynamics Knowledge Base

How do I configure the Apache Agent and C/C++ SDK for an authenticated HTTP proxy?

How do I configure the Apache Agent and C/C++ SDK for an authenticated HTTP proxy?

Question

How do I provide a username and password for an HTTP proxy for use with the Apache Web Server Agent or C/C++ SDK?

Scope

This article applies only to those versions of the Apache Web Server Agent and C/C++ SDK that utilize the standalone Java Proxy for connecting with the AppDynamics Controller.

Answer

In order to configure the HTTP Proxy with a username and password file, you need to manually edit the <agent-install-dir>proxy/runProxy script.

Step 1

Near line 20, you should see the following:

httpProxyHost=
httpProxyPort=
httpProxyUser=
httpProxyPasswordFile=

Assign the appropriate values for your HTTP Proxy to these variables.

Step 2

Near line 219, you should see the following:

if [ -n "${httpProxyHost}" ] ; then
    cmdLine[${#cmdLine[@]}]="-Dappdynamics.http.proxyHost=${httpProxyHost}"
    cmdLine[${#cmdLine[@]}]="-Dappdynamics.http.proxyPort=${httpProxyPort}"
fi

Edit this code to add the username and password file to the java cmdLine as such:

if [ -n "${httpProxyHost}" ] ; then
    cmdLine[${#cmdLine[@]}]="-Dappdynamics.http.proxyHost=${httpProxyHost}"
    cmdLine[${#cmdLine[@]}]="-Dappdynamics.http.proxyPort=${httpProxyPort}"
    if [ -n "${httpProxyUser}" ]; then
        cmdLine[${#cmdLine[@]}]="-Dappdynamics.http.proxyUser=${httpProxyUser}"
    fi
    if [ -n "${httpProxyPasswordFile}" ]; then
        cmdLine[${#cmdLine[@]}]="-Dappdynamics.http.proxyPasswordFile=${httpProxyPasswordFile}"
    fi
fi

From now on, when you run <agent-install-dir>/runSDKProxy.sh, which in turn calls the proxy/runProxy script, it will instruct the java proxy to use the http proxy as defined by the variables near line 20.

Labels (1)
Tags (3)
Version history
Last update:
‎07-13-2017 02:23 PM
Updated by: