Using the Pentaho Marketplace over a proxy
There's a known issue with the Pentaho marketplace when used on a server that has no internet connection. The issue is that... it doesn't work. This is what you get:
Well, since the release of pentaho 5.1, not anymore! There was a code change that allowed this to be possible. What we need is to make sure we define the following java environment variables to the start of pentaho, eg, by editing the start-pentaho.sh or whatever method you use to start it:
http.proxyHost
: the host name of the proxy serverhttp.proxyPort
: the port number, the default value being 80.http.nonProxyHosts
:a list of hosts that should be reached directly, bypassing the proxy. This is a list of patterns separated by '|'. The patterns may start or end with a '*' for wildcards. Any host matching one of these patterns will be reached through a direct connection instead of through a proxy.
For authentication, there's another set
:
- http.proxyUser
- http.proxyPassword
Here's an example that I just used for testing:
-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888 -Dhttp.nonProxyHosts="localhost|127.0.0.1|10.*.*.*"
After that, here's a working marketplace again!
Using the Pentaho Marketplace on a server without internet access
Now... what if our server is on a place without a proxy (or one that doesn't work with the previous method for any reason). Let's put our white hat for a while and hack our way through!Disclaimer: Make sure you're authorized to do these steps - This is an informative post only, I don't want Mordac on my back!
I'll assume here that we have the following scenario:
- A server "server" without internet access to the marketplace where we can only access through ssh
- Our laptop, the "client", with a standard internet access
So, what we need here is:
- A proxy server that the client can access to, or
- install a proxy server on the client
Step 1: Install a proxy on the client (optional)
You can bypass this if you have a proxy somewhere. Since I don't, I had to install one on my laptop. I just googled and found one called tinyproxy. All I had to do was:$ sudo apt-get install tinyproxy
Now I have a proxy running on my client, port 8888.
Step 2: Use ssh to do a port redirect on the server
What we'll do is to setup a remote port forward on our server that points to the proxy we just set up. As simple as issuing this command from the client:$ ssh server -R8889:127.0.0.1:8888 -v -N
If you already have a proxy available and you didn't need step 1, all you need is:
$ ssh server -R8889:proxyServer:proxyPort -v -N
What we just did was to simulate the existence of a proxy on the server, on port 8889.
Step 3: Set the jvm environment variables
Now we're simply on the initial scenario I described. All we need is http.proxyHost set to 127.0.0.1 and http.proxyPort set to 8889:-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8889 -Dhttp.nonProxyHosts="localhost|127.0.0.1|10.*.*.*"
And done! Go ahead and install the Ctools and all the other plugins!