Difference between revisions of "LRM Proxy Configuration"

From Lingoport Wiki
Jump to: navigation, search
Line 5: Line 5:
 
<code>export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"</code>
 
<code>export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"</code>
   
This may be added to the following locations:
 
   
  +
== Notes on the JAVA_OPTIONS setting ==
== Jenkins Config ==
 
  +
* The url should not include the preceeding 'http://' or 'www'
  +
** Good
  +
*** internet.proxy.yourcompany.com
  +
** Bad
  +
*** http://internet.proxy.yourcompany.com
  +
*** www.internet.proxy.yourcompany.com
  +
*** https://www.internet.proxy.yourcompany.com
  +
* The port number will be dependent on your proxy. 3128 is merely used as an example above.
  +
  +
== Adding Java Options ==
  +
  +
_JAVA_OPTIONS may be added to the following locations:
  +
  +
=== Jenkins Config ===
 
This will affect LRM when run through Jenkins.
 
This will affect LRM when run through Jenkins.
 
* In Jenkins, select 'Manage Jenkins' then 'Configure System'.
 
* In Jenkins, select 'Manage Jenkins' then 'Configure System'.
Line 16: Line 29:
 
** Replace 3128 with the port number appropriate for your proxy.
 
** Replace 3128 with the port number appropriate for your proxy.
   
== User Config ==
+
=== User Config ===
 
This will affect LRM commands run at the command prompt for a specific user. It will also affect other java programs run at the command prompt by this user. May not affect commands run within Jenkins builds.
 
This will affect LRM commands run at the command prompt for a specific user. It will also affect other java programs run at the command prompt by this user. May not affect commands run within Jenkins builds.
 
* Edit $HOME/.bashrc
 
* Edit $HOME/.bashrc
Line 23: Line 36:
 
** <code>export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"</code>
 
** <code>export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"</code>
   
== System Config ==
+
=== System Config ===
 
This will affect all users on the system. All java commands run at the command prompt will use the configured proxy settings. May not affect commands run within Jenkins builds.
 
This will affect all users on the system. All java commands run at the command prompt will use the configured proxy settings. May not affect commands run within Jenkins builds.
 
* Create a file /etc/profile.d/custom.sh
 
* Create a file /etc/profile.d/custom.sh
Line 29: Line 42:
 
* Add the following line to the file and save it:
 
* Add the following line to the file and save it:
 
** <code>export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"</code>
 
** <code>export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"</code>
 
== Notes on the JAVA_OPTIONS setting ==
 
* The url should not include the preceeding 'http://' or 'www'
 
** Good
 
*** internet.proxy.yourcompany.com
 
** Bad
 
*** http://internet.proxy.yourcompany.com
 
*** www.internet.proxy.yourcompany.com
 
*** https://www.internet.proxy.yourcompany.com
 
* The port number will be dependent on your proxy. 3128 is merely used as an example above.
 

Revision as of 21:48, 14 August 2017

LRM Proxy Configuration

To use LRM through a proxy, you will need to set java proxy settings before executing the LRM jar file. To set java proxy settings, configure the shell to have a '_JAVA_OPTIONS' variable with the proxy settings listed. Like so:

export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"


Notes on the JAVA_OPTIONS setting

Adding Java Options

_JAVA_OPTIONS may be added to the following locations:

Jenkins Config

This will affect LRM when run through Jenkins.

  • In Jenkins, select 'Manage Jenkins' then 'Configure System'.
  • Under 'Global properties' ensure that 'Environment variables' is checked.
  • At the bottom of the Environment variables section, there will be a button 'Add' to add new environment variables.
  • Name: _JAVA_OPTIONS
  • Value: -Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128
    • Replace 3128 with the port number appropriate for your proxy.

User Config

This will affect LRM commands run at the command prompt for a specific user. It will also affect other java programs run at the command prompt by this user. May not affect commands run within Jenkins builds.

  • Edit $HOME/.bashrc
    • $ vim $HOME/.bashrc
  • Add the following line somewhere in the file
    • export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"

System Config

This will affect all users on the system. All java commands run at the command prompt will use the configured proxy settings. May not affect commands run within Jenkins builds.

  • Create a file /etc/profile.d/custom.sh
    • sudo vim /etc/profile.d/custom.sh
  • Add the following line to the file and save it:
    • export _JAVA_OPTIONS="-Dhttp.proxyHost=some.url.here -Dhttp.proxyPort=3128 -Dhttps.proxyHost=some.url.here -Dhttps.proxyPort=3128 -Dftp.proxyHost=some.url.here -Dftp.proxyPort=3128"