{"id":419,"date":"2010-09-09T18:21:53","date_gmt":"2010-09-09T13:21:53","guid":{"rendered":"http:\/\/linuxndme.com\/?p=28"},"modified":"2011-06-22T12:30:14","modified_gmt":"2011-06-22T12:30:14","slug":"running-a-web-server-at-home-dynamic-hosting","status":"publish","type":"post","link":"https:\/\/blog.nixwind.com\/?p=419","title":{"rendered":"Web server at home :: Dynamic hosting with dyndns, nginx &#038; ddclient"},"content":{"rendered":"<p>You want to test your website at your home and before setting it up on a real server ?<br \/>\nYou want access your home machine from outside ?<br \/>\nYou want to stimulate a real web site without loosing a penny ?<br \/>\nYou have a decent connection and lot of time to test things out ?<\/p>\n<p>Lets setup a home webserver with dyndns , ddclient and nginx<\/p>\n<p><strong>Overview<\/strong><\/p>\n<ol>\n<li>Setting up a subdomain that points to your machine<\/li>\n<li> Setting up a Update Client ( using : ddclient )<\/li>\n<li> A basic webserver installation ( using : nginx since it is really light on system)<\/li>\n<\/ol>\n<p><strong>Requirements<\/strong><\/p>\n<ul>\n<li> An ubuntu machine ( You can install any other Linux distro you are comfortable with)<\/li>\n<li> A working stable Internet connection<\/li>\n<li> Dyndns account ( You can get a free one from http:\/\/dyndns.com )<\/li>\n<\/ul>\n<p><strong>Installation &amp;\u00a0 configuration<\/strong><\/p>\n<p><strong>Step 1<\/strong><br \/>\nDyndns account registration and subdomain setup<\/p>\n<p>a. Register a dyndns account ( http:\/\/dyndns.com )<br \/>\nb. login to the account<br \/>\nc. setup a subdomain , you can do this as below<\/p>\n<p><em><strong>My Account &gt;&gt; Add Host Services &gt;&gt;<\/strong><\/em><br \/>\n<em><strong>Hostname<\/strong><\/em> : Select a domain and provide a hostname ( this will be used to access your home machine )<br \/>\n<em><strong>Service type<\/strong><\/em> : Host with IP address<br \/>\n<em><strong>IP address<\/strong><\/em> : Click on the link &#8220;Your current location&#8217;s IP address is x.x.x.x&#8221;<br \/>\n<strong><em>Select services and devices you would like to use with this hostname<\/em><\/strong> : webserver , ssh<br \/>\n<em><strong>Add to Cart &gt;&gt; Next &gt;&gt; Active services<\/strong><\/em><\/p>\n<div><strong>Step 2<\/strong><\/div>\n<div>Install ddclient<\/div>\n<div><strong><span style=\"color: #3ea99f;\">yo@home:~$ <\/span>sudo apt-get install ddclinet<\/strong><\/div>\n<div>\n<div>You will be asked to configure it you can read and update the values as you like for now, as we will configure it\u00a0 manually with the below given steps<\/div>\n<p><strong>Step 3<\/strong><br \/>\nConfigure it by modifying conf files \/etc\/ddclient.conf and \/etc\/default\/ddclient as below. Read the comments in the configuration file to get an idea of each directive. Please note to change the fields that are highlighted with your values.<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@home:~# <\/span> vi \/etc\/ddclient.conf<\/strong><\/p>\n<div><em># Configuration file for ddclient generated by debconf<br \/>\n#<br \/>\n# \/etc\/ddclient.conf<br \/>\n## ddclient configuration file<br \/>\ndaemon=300<br \/>\n# check every 600 seconds<br \/>\nsyslog=yes<br \/>\n# log update msgs to syslog<br \/>\nmail-failure=<strong>Your_mail_Id@domain.com<\/strong> # Mail failed updates to user<br \/>\npid=\/var\/run\/ddclient.pid<br \/>\n# record PID in file.<br \/>\n## Detect IP with our CheckIP server<br \/>\nuse=web, web=checkip.dyndns.com\/, web-skip=&#8217;IP Address&#8217;<br \/>\n## DynDNS username and password here<br \/>\nlogin=<strong>Username<\/strong><br \/>\npassword=<strong>password<\/strong><br \/>\n## Default options<br \/>\nprotocol=dyndns2<br \/>\nserver=members.dyndns.org<br \/>\n## Dynamic DNS hosts<br \/>\n<strong>your_sub_domain.domain.com<\/strong><\/em><\/div>\n<p><strong><span style=\"color: #3ea99f;\">root@home:~# <\/span>vi \/etc\/default\/ddclient <\/strong><\/p>\n<div><em># Configuration for ddclient scripts<br \/>\n# generated from debconf on Sat Sep\u00a0 4 10:15:24 IST 2010<br \/>\n#<br \/>\n# \/etc\/default\/ddclient<\/em><em> <\/em><\/div>\n<div># Set to &#8220;true&#8221; if ddclient should be run every time a new ppp connection is<\/div>\n<div># established. This might be useful, if you are using dial-on-demand.<em> <\/em><\/div>\n<div><em>run_ipup=&#8221;false&#8221;<\/em><\/div>\n<div># Set to &#8220;true&#8221; if ddclient should run in daemon mode<\/div>\n<div># If tis is changed to true, run_ipup must be set to false.<em> <\/em><\/div>\n<div><em>run_daemon=&#8221;true&#8221;<\/em><\/div>\n<div># Set the time interval between the updates of the dynamic DNS name in seconds.<\/div>\n<div># This option only takes effect if the ddclient runs in daemon mode.<em> <\/em><\/div>\n<div><em>daemon_interval=&#8221;300&#8243;<\/em><\/div>\n<div>\n<p><strong>Step 4<\/strong><br \/>\nInstall webserver nginx<\/p>\n<p><strong><span style=\"color: #3ea99f;\">yo@home:~$ <\/span> sudo apt-get install nginx <\/strong><\/p>\n<p>Default DocumentRoot will be \/var\/www\/nginx-default , you can upload your files to the DocumentRoot directory and you can access it from anywhere with your dyndns subdomain.<\/p>\n<\/div>\n<\/div>\n<p><a href=\"http:\/\/linuxndme.com\/?page_id=70\"><br \/>\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You want to test your website at your home and before setting it up on a real server ? You want access your home machine from outside ? You want to stimulate a real web site without loosing a penny ? You have a decent connection and lot of time to test things out ? [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[46],"tags":[44,45,47],"_links":{"self":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/419"}],"collection":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=419"}],"version-history":[{"count":1,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions"}],"predecessor-version":[{"id":501,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions\/501"}],"wp:attachment":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}