I have a VMWare virtual Linux server on which i installed a Java EE web application. i access the server via SSH.
my question is how can i run the remote web app through ssh?
what i did is start remote tomcat server over ssh
then in my browser i invoked this address :
http://<ssh-server-host>:8080
the connection took very long and my firefox can’t establish connection b/c it takes too long.
is there a clean way to run a web app over ssh?
What you are doing can also be called ssh tunneling. It has the advantage that your traffic will be encrypted, but it will also be a bit slower (encryption/decryption being done by ssh), and more resource intensive. Besides, the tunnel will have to stay open in order to access the endpoint.
The technique is specially useful if you are not interested in making a service remotely accessible, but still want to use privately.
For example, I have a couchdb server listening on localhost:5984, in my host “server1”
I can make that port locally accessible in port 22222 in my desktop computer, by doing:
This way I can access my remote couchdb:
And that even though the remote couchdb server is only listening to local connections. The SSH tunnel makes the magic.