(1) Setup and test the web service
Install a simple webserver (nginx) and enabling the file to be executabled then start nginx web service:
aptitude install nginxchmod 755 /etc/init.d/nginx
/etc/init.d/nginx startThen, check whether we can access to the website, by browsing URL, http://127.0.0.1/
If "Welcome to nginx!" displayed on the web page, then it is working fine.
(2) Sign up for a dynamic DNS service from DynDNS.com
After the registration, we may confused with many services offered by DynDNS. The Dynamic DNS is free, and Custom DNS is not. Then we need to create a hostname record from their website. They offer dynamic DNS service is free of charge. After the registration, you will have a host name under their domain name. eg. myweb123.dyndns.com, myweb123.dnsalias.org, myweb123.gotdns.org ...etc. But I would advise to use the dyndns.org, because this domain pre-set in my modem/router (D-Link).
(3) Setup the DynDNS update client
Since we are having dynamic IP address from ISP, we need to have an update client that can tell the internet DNS with our latest IP address. Some ADSL modem or routers have a function to act as update client, otherwise we need to install an update client service/daemon (eg. ddclient package can be found in Debian Lenny repository). Just one update client will do: either configuring at the router (if the device has this feature) or software-based update client.
(4) Configure router for port forwarding
To configure port forwarding by adding HTTP port 80 entry in the router. We can refer to this link to learn port forwarding settings for different router. http://www.dyndns.com/support/kb/routers_and_port_forwarding.html
We also need to check and enable the security setting "NAT redirections" for our router. Also, we need to check the firewall settings which may restrict the external host to access to local resources (eg. webserver). Once we made any changes in the router, remember to save the settings and restart the router.
(5) To test & check the external IP address
By browsing this URL (http://checkip.dyndns.com:8245/) we can know the external public IP and then ping the host name (hostname.dyndns.org) to see if the return address is the same as the one show in the checkip.dyndns.com website.
From the external internet clients, open your internet browser with URL address, eg. hostname.dyndns.org and if those clients can see "Welcome to nginx!" displayed on the web page, then we done.
Note: the Port Forwarding is work for external clients access to the webserver (passed thought the router to do the port forwarding) and then access to our local webserver. If our local clients (same subnet with our webserver then we need to change the /etc/hosts file to map the hostname to the local IP address of our webserver, otherwise we may end-up at the router and the router web management site may be prompted. This can happen when both are using same port number 80.)
Since I have been used to Windows environment, so I always associate the word "host name" the computer name (eg. myserver1), but here in my post it is referring to the complete FQDN, example, myserver1.domainname.net
No comments:
Post a Comment