Wednesday, 5 February 2014

Make your web server accessible from the outside

The web server is now running (see previous article), but is only accessible from the local network. We should need outside access.

In this case I am lucky that we recently had a new modem/router from our ISP (Belgacom) on which you can easily enable DynDNS (Dynamic DNS).  (See below for non-Belgacom routers).

the steps:

  • sign up for a free account at No-IP and set up a hostname;
  • log in your router's page, mostly something like 192.168.1.1; 

  • click the "My Modem" section, and you will get this screen. Select the DynDNS tab. Switch the DynDNS button to "on", select the supplier (in this case No-IP) and fill out your username, password and hostname which you created at the No-IP web site;



  • go back to the home screen (192.168.1.1) and in the list of connected devices, select your Raspberry Pi;


  • A screen will pop-up in which you select the Port Forwarding tab. There you click "Add Rule" and fill out the following:
      • service: (no choice possible, so leave)
      • Protocol: TCP-UDP
      • External port: 80 (=default for web pages)
      • Internal host: is your Raspberry Pi's internal IP address
      • Internal port: 80
      • click OK and you're done.



Now if you connect your Raspberry to an external network (neighbour's wifi or wifi from iPhone) then you should be able to access the webpage (index.html in the /var/www folder) by typing the hostname which you created at No-IP instead of typing the Raspberry's static internal IP.


In case that you don't have a modem/router on which you can enable DynDNS then you can do the following: No-IP provides a DUC (Dynamic Update Client) which has to be installed on the Raspberry Pi. This software looks at an interval of 30 minutes (can be configured) what your external IP address is  and so enables that your web site stays accessible. The installation instructions are well explained in the link provided.

No comments:

Post a Comment