通过 SSH 运行 Web 应用程序
我有一个 VMWare 虚拟 Linux 服务器,在上面安装了 Java EE Web 应用程序。我通过 SSH 访问服务器。
我的问题是如何通过 ssh 运行远程 Web 应用程序?
我所做的是通过 ssh 启动远程 tomcat 服务器 然后在我的浏览器中我调用了这个地址:
http://<ssh-server-host>:8080
连接花了很长时间,我的火狐无法建立连接,因为它花了太长时间。
有没有一种干净的方法可以通过 ssh 运行网络应用程序?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您所做的也可以称为 ssh 隧道。它的优点是您的流量将被加密,但它也会慢一些(加密/解密由 ssh 完成),并且更消耗资源。此外,隧道必须保持开放才能访问端点。
如果您对远程访问服务不感兴趣,但仍想私下使用,则该技术特别有用。
例如,我有一个 couchdb 服务器在我的主机“server1”中侦听 localhost:5984
我可以通过执行以下操作,在桌面计算机的端口 22222 中本地访问该端口:
这样我就可以访问我的远程 couchdb:
即使远程 couchdb 服务器仅侦听本地连接。 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.
使用称为 ssh 端口转发的技术,我执行了以下操作:
连接被转发到远程服务器上的端口 8080。
我打开网络浏览器并输入 url
http://localhost:8080/webapp
看来这可行!
关于这个方法有什么评论吗?
using a technique called ssh port forwarding i did the following:
The connection is forwarded to port 8080 on the remote server.
i open a web browser and type the url
http://localhost:8080/webapp
it seems this works!
any comments about this method?