How do I provide a username and password for an HTTP proxy for use with the Apache Web Server Agent or C/C++ SDK?
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.
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.
Near line 20, you should see the following:
httpProxyHost= httpProxyPort= httpProxyUser= httpProxyPasswordFile=
Assign the appropriate values for your HTTP Proxy to these variables.
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.