📜 ⬆️ ⬇️

How to make a home computer connected to the Stream web server

Pre-Scriptum: as far as I know, some of my articles were fasted by someone in Habr, I'm only here for the second day. Therefore, I apologize if this post seems to be "boyish". In order not to be accused of plagiarism, I will provide a link to the original of my article . In general, I'm going to write in my Habra blog mainly on the topic of wearable computers. I work on one of these devices for the second year. Actually, the following steps were aimed at creating “external brains” to my NK (wearable computer) so that it could transfer some tasks to the home computer or take data from it.

So, let's begin…

Sometimes a person has strange desires - being away from home, looking after a dwelling through the eye of a webcam, working in the subway on a home computer, quietly rumbling far, far away, or just saving on hosting. These and other abnormal ideas can be easily implemented by making your home computer a real web server to which you can connect via the Internet.

Immediately make a reservation - I will not address the issues of installing programs like Apache or security issues (by making the computer accessible from the outside, we increase the number of dangers threatening it).
')
My initial data: a computer running Fedora 9, connected to it via an Ethernet ADSL modem / router ASUS AAM 6020 BI and connecting to the Internet via Stream. But, I think, the information below can be useful to users of other operating systems, modems and providers.

1. OUTPUT OF THE COMPUTER THROUGH THE FIREWALL IN “OPEN INET”

Go to the settings of the router: Advanced -> LAN Clients and add a home computer by entering its local IP, an arbitrary Hostname and the MAC address of its network card.

2. PORT FORWARDING

Go to the tab Advanced -> Port Forwarding . If I were connected through some other provider, then to output the computer “to the large Internet” I could select the Servers category and add ( Add> ) from the list of ready-made rules to the Web Server rule. But in Stream, port 80, which is used by the HTTP protocol, is closed. Therefore, you will have to organize a call to the server through another, not blocked port - for example, 8880. You can check which ports are open and which are closed, you can at www.dyndns.com/support/tools/openport.html (this site will still be useful to us ). Select the User category and create a new rule: New . Let's call it, for example, HTTP8880 and write the following values:
Protocol: TCP
Port Start: 8880
Port End: 8880
Port Map: 80
That is, calls to ports in the Port Start - Port End range (in our case this is the only port 8880) will be redirected to the 80th port.

Port 22 used for SSH access in Stream is not blocked. Unfortunately, there was no ready-made rule for SSH access on the router, so if you need SSH access, we will create another rule. Let's call it SSH and write port 22 in all three windows.

FTP access will also have to create a rule. As in the case of HTTP, port 21 is blocked, so let's create another rule: FTP8881
Protocol: TCP
Port Start: 8881
Port End: 8881
Port Map: 21

Having created new rules, add them: Add -> and save the changes: Tools -> System Commands -> Save All .

3. NAME FOR SERVER

Now, after reconfiguring the ports, from the Internet you can get access to web and ftp servers running on your home computer. However, it is necessary to specify the port and external IP of the home computer. In order to specify a “human” domain name (for example, vasya.dyndns.org) instead of IP, we will use the free service www.dyndns.com . By the way, you can find out your external IP again using this site: at checkip.dyndns.com . Go to www.dyndns.com and get a new account. Now you need to set up an account by going to My Services -> Host Services on this site and entering your external IP into the IP Address . You can find it out using the checkip.dyndns.com link above, or by going to the menu of the Status -> Connection Status router.

From now on, the computer’s HTTP server can be accessed at vasya.dyndns.org:8880, and the FTP server can be accessed at vasya.dyndns.org:8881. It seems to be all right, but there is another problem.

4. STRUGGLE AGAINST STREAM, CONSTANTLY CHANGING IP

As a rule, once a day, dynamic IP clients of Strima are forcibly changed. DynDns allows you to bind the ever-changing IP of the home computer to the domain name. Some routers are able to work with the DynDns service, and they can be configured to automatically update the dyndns account when changing your external IP. My router was not trained in such tricks. If the router cannot - let the computer do it. Download from www.dyndns.com/support/clients one of the utilities. For Linux, I chose inadyn . Being launched, this utility, when changing the external IP, will update it in your dyndns account. There are similar utilities for other operating systems. But back to inadyn. After downloading and unpacking the archive with the utility distribution kit, I opened the unpacked readme.html file and set up the utility in accordance with the instructions provided in it:
- created the file /etc/inadyn.conf , in which I wrote 6 lines:
log_file /var/log/inadyn.log
username my_login_dyndns.com
password my_password_dyndns.com
background
update_period 60000
alias vasya.dyndns.org
Next, copy the inadyn utility to the / opt directory and launch it as root:
# / opt / inadyn
And that's it! You can check that inadyb is “sitting” in memory with the command
# ps -efH | grep inadyn

In order not to run all this splendor every time manually, we add a line to the end of the /etc/rc.local file:
/ opt / inadyn

5. URL WITHOUT ": 8880"

If the web server is needed for personal use, the gestures described above are enough. But for a public web server, the need to contact vasya.dyndns.org:8880 instead of vasya.dyndns.org is not the most convenient option. You can, for example, hover somewhere at a free or the cheapest rate and place a page on the hosting that will transfer the visitor to vasya.dyndns.org:8880. But you can use another service DynDns: My Services -> Add New Hostname . We will create another domain name, for example, vasya.homelinux.org, but we will specify WebHop Redirect as the Service Type: instead of Host with IP address, and in the Redirect URL field that appears, we will write vasya.dyndns.org : 8880 / . Save the changes with the Save Changes button. Now, when entering vasya.homelinux.org, the browser will automatically be redirected to vasya.dyndns.org : 8880 /.</ lj-cut>

Source: https://habr.com/ru/post/45791/


All Articles