views:

200

answers:

3

How would I access a webserver behind a firewall? I'm developing an application for this webserver which is not yet open to the public.

Someone walked me through this before, so I know it can be done. However, it has been about four months and I haven't been able to do it again.

I'm using Putty to connect to the remote machine. From that machine I can open the site http://dev.server.address:83 using Firefox. However, I want to be able to open http://localhost:80 on my machine to see the same page.

Below are screen shots of the parameters I entered into Putty. I log on to the server fine, but still can't access the webpage (http://localhost:80).

First screen shot:
I'm using the server address and port 22 to connect to it via SSH.

Second screen shot:
I'm using the server address and port 83 for the "source port" I'm using localhost:80 for the "destination port"

putty 1

putty 2

+2  A: 

Have you tried using 127.0.0.1:80 instead of localhost:80? I don't use PuTTY, but when I use SSH on my machine, I have to specify 127.0.0.1 instead of localhost.

Reynolds
Thanks for your answer. I thought that 127.0.0.1 and localhost were always equivalent (http://en.wikipedia.org/wiki/Localhost), so I wonder whey it wouldn't work sometimes.
molecules
I thought that too, believe me. I have no explanation as for why it isn't.
Reynolds
+2  A: 

You need to enter "80" into Source port and dev.server.address:83 to Destination.

[And don't forget to click the "Add" button before you leave the configuration screen. If you don't click that, PuTTY doesn't actually create a tunnel. I fell for that gotcha quite a few times myself]

intgr
Thanks so much! That did it.
molecules
+1  A: 

Do you have a webserver running on your local machine? If that is listening on port 80 http://localhost:80 wont work. Alternatively try mapping the source to a different port (12345 for eg.) and then try http://localhost:12345 in your browser.

Anand
Thanks for your answer. This wasn't the problem in this case, but it is something that I will keep in mind in the future.
molecules