S
S
Synoecium2018-09-12 08:52:07
SSH
Synoecium, 2018-09-12 08:52:07

How to forward a web server via SSH through a VPS?

We have: 1) a physical server with Win7 x64 installed, on which apache is running (everything is standard here, port 80, everything works locally, the Apache page shows). The server is located behind the NAT of the Internet provider, gray IP
2) rented VPS with UBUNTU 14 x32 installed with a white fixed IPv4 address
We want: connect via white IP VPS to a web server on a physical. server (the port is not critical, as long as it works)
I tried to do this article through tunneling in Putty, the connection is established, but I can’t go to the right page of my web server, it shows only Ubuntu Apache with VPS.
5b98a91f39bee363178314.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Synoecium, 2018-09-12
@Synoecium

For those who searched on Google and came here:
1. On the VPS side in the "sshd_config" file, add the line "GatewayPorts yes", without this it did not work for me
2. sudo restart ssh //on the VPS side, restart the ssh service to make the settings work
3. On the physical server side, run Putty and add a tunneling setting like this: R8181 localhost:80. In this case, the port will not be standard 80, but usually not used 8181, which will allow you not to stop Apache on the VPS side, if it is there, of course.
4. try to connect from any computer with internet at http://IP_VPS:8181. Here IP_VPS is the white IP address of the leased virtual server.

A
Andrej Gessel, 2018-09-12
@andiges

I tried to follow this article through tunneling in Putty, the connection is established, but I can’t go to the right page of my web server, it shows only Ubuntu Apache with VPS.

Port 80 on Ubuntu is busy, tunneling cannot work because the port is busy. You need to stop/remove apache or use a different port.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question