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

    Pre-Scriptum: as far as I know, some of my articles were fasted by someone in Habr, I am here only the second day. Therefore, I apologize if this post seems to you a "slaughter." In order not to accuse me 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’ve been working on one of these devices for the second year. Actually, the steps below were aimed at creating “external brains” for 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, to look after the house through the peephole of a webcam, work in the subway on a quietly rumbling far, far home computer or just save on hosting. These and other abnormal ideas can be easily implemented by making your home computer a real web server that you can connect to through the Internet.

    I’ll make a reservation right away - I won’t touch upon issues of installing programs like Apache or security issues (by making the computer accessible from the outside, we will increase the number of dangers facing it).

    My initial data: a computer running Fedora 9 connected to it via an Ethernet ADSL modem / ASUS AAM 6020 BI router and an Internet connection via Stream. But, I think the information below can be useful to users of other operating systems, modems and providers.

    1. COMPUTER OUTPUT THROUGH THE FIREWALL TO “OPEN INTERNET” Let's go

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

    2. PORT FORWARDING Go

    to the Advanced -> Port Forwarding tab . If I had been connected through some other provider, then I could select the Servers category to output the computer to the “big Internet”and add ( Add> ) the Web Server rule from the list of predefined rules . But in Stream, port 80 using the HTTP protocol is closed. Therefore, you will have to arrange access to the server through another, non-blocked port - for example, 8880. You can check which ports you have open and which are closed onwww.dyndns.com/support/tools/openport.html (this site is still useful to us). Select the User categoryand create a new rule: New . Call it, for example, HTTP8880 and write the following values:
    Protocol: TCP
    Port Start: 8880
    Port End: 8880
    Port Map: 80

    That is, access to ports in the Port Start - Port End range (in our case, this is the only port 8880) will be redirected to port 80.

    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.

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


    After creating 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, spinning on your home computer. True, you have to specify the port and external IP of the home computer. In order to indicate a “human” domain name instead of IP (for example, vasya.dyndns.org), we use a free servicewww.dyndns.com . By the way, you can find out your external IP again using this site: at checkip.dyndns.com . Let's go onwww.dyndns.com and start a new account. Now you need to set up an account by going to My Services -> Host Services on this siteand registeringyour external IPin the IP Address . You can find it out using the checkip.dyndns.com link above, or by going to the menu of the router Status -> Connection Status .

    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. Everything seems to be fine, but there is another problem.

    4. THE FIGHT AGAINST AN INSUARY STREAM CONSTANTLY CHANGING IP

    As a rule, once a day the dynamic IP clients of Stream are forced to change. DynDns allows you to bind the ever-changing IP of a home computer to a domain name. Some routers can work with the DynDns service, and you can configure them to automatically update the dyndns account when you change your external IP. My router was not trained in such tricks. If the router cannot - let the computer do it. Download fromwww.dyndns.com/support/clients one of the utilities. For Linux, I chose inadyn . Once launched, this utility will change it in your dyndns account when changing the external IP. There are similar utilities for other operating systems. But back to inadyn. After downloading and unpacking the archive with the utility distribution package, I opened the unpacked readme.html file and configured the utility in accordance with the instructions in it:
    - I created the /etc/inadyn.conf file, in which I wrote 6 lines:
    log_file / var / log / inadyn. log
    username my_log_in_dyndns.com
    password my_password_dyndns.com
    background
    update_period 60,000
    alias vasya.dyndns.org

    Next, copy the inadyn utility to the / opt directory and run as root:
    # / opt / inadyn
    That's all! You can verify that inadyb is “sitting” in memory with the command
    # ps -efH | grep inadyn

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

    5. URL WITHOUT ": 8880"

    If a web server is needed for personal use, the gestures described above are quite enough. But for a public web server, the need to access vasya.dyndns.org:8880 instead of vasya.dyndns.org is not the most convenient option. For example, you can host 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 DynDns service: My Services -> Add New Hostname . Let's create another domain name, for example, vasya.homelinux.org, but as the Service Type: instead of Host with IP address we will specify WebHop Redirect and in the appeared field Redirect URL 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 /.

    Also popular now: