Answer the question
In order to leave comments, you need to log in
How to get information from a machine behind a gray ip address?
There is a machine, let's call it the target computer (CC or target.host), on which Apache is running. The target has a gray dynamic IP address, i.e. from outside to it not to be connected. There is another machine with a static IP and an attached example.com domain. Let's call it a server. There is a user who wants to access the site on the target computer.
Question: are there ready-made solutions for creating a tunnel that can forward requests addressed to the server to the target computer, and give the CC responses to the user? At the same time, I would like the user to be able to go to test.example.com in the browser and the contents of test.target.host would be shown to him.
Or can it be done only by writing your own program? And in this case, the user will already access the site through additional software installed on his computer (in the form of a separate program or plug-in in the browser).
Answer the question
In order to leave comments, you need to log in
ssh -CND [email protected] -R 80:127.0.0.1:apache_port
I'm not sure at all that this will work, because. you will try to occupy port 80, on which, as I understand from the explanation, apache hangs anyway. So it's better to replace 80 with something left (for example, 8791), and on the "server" describe the TC virtualhost (test.example.com) as you wanted and point it to ProxyPass at 127.0.0.1 : 8791/. You don't need to write anything.
With target.host set up passwordless ssh authorization and run the command
ssh -CND [email protected] -R 80:127.0.0.1:apache_port
you can make everything easier using dns
1. on a host with a gray ip, you raise the dyndns service
2. in the example.com domain zone, make a record test.example.com CNAME my.dyndns.host
Put nginx on a server with a static IP and redirect the necessary requests to target.host.
Well, or DNAT
Well, for example, port mapping. I did this on a home router, behind which there was a computer, with standard tools that were in the firmware of the device.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question