Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

How to 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.

Version history
Revision #:
4 of 4
Last update:
‎07-13-2017 02:23 PM
Updated by:
 
Labels (4)
Tags (4)
0 Kudos