Getting to apex via the wrong port?



Today we've had lots of 'fun' with out firewall setup and Apex - we had originally setup port 1099 which worked from one office location but we planned to move to a different port to be accessible from all locations. This move was done but it ruend out not all locations could access the new port.


We had a situation then that either one team could work or the other team could work - but not both....



The firewalls will eventually get sorted but we came up with a short term fix to resolve this using port forwarding

What this does is reroute traffic from one port to another port – so in our case we set up a tunnel that sent all traffic from port 1099 to port 18080, this means that either port will work as everything ends up going to port 18080 in the end but port 1099 also appears to be active.

To set this up I had to enable the apex server to ssh back to itself without a password (to avoid typing this on the command line) and then use the ssh command to set up a permanent port forwarding between the two ports – to do this I ran this command as the oracle user:

ssh -fNL server-name:1099:server-name:18080 server-name

(this needs to be started with a nohup at the front – otherwise when I log out the forwarding dies)

this is just saying any traffic received on port 1099 forward on to port 18080 – which makes both url’s work

So now we can allow all users to work even though apex is really only running on port 18080.

A useful trick!

Comments