<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tim Akinbo's Blog &#187; Web Development</title>
	<atom:link href="http://blog.timakinbo.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timakinbo.com</link>
	<description>the web, mobile technology and location based services as I see it</description>
	<lastBuildDate>Sun, 25 Jul 2010 09:26:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>When unique isn&#8217;t really unique</title>
		<link>http://blog.timakinbo.com/2009/11/24/when-unique-isnt-really-unique/</link>
		<comments>http://blog.timakinbo.com/2009/11/24/when-unique-isnt-really-unique/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 10:53:23 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=74</guid>
		<description><![CDATA[Sometimes, an auto-generated number isn&#8217;t enough and what you really need is a unique identifier. Several people have different techniques for generating their unique identifiers. My favorite has been generating a random number and then hashing it through the md5 hash generator. Here&#8217;s an example I was once using: &#60;?php $unique_identifier = md5(rand(100000, 999999)); ?&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, an auto-generated number isn&#8217;t enough and what you really need is a unique identifier. Several people have different techniques for generating their unique identifiers. My favorite has been generating a random number and then hashing it through the md5 hash generator. Here&#8217;s an example I was once using:</p>
<pre class="brush: php">&lt;?php $unique_identifier = md5(rand(100000, 999999)); ?&gt;</pre>
<p>The problem with this is that I have given an allowance for only 899,999 possible values. I didn&#8217;t realize my error until I started getting mysql integrity check errors for a unique column that stored that value.</p>
<p>I reverted to using a more elegant solution:</p>
<pre class="brush: php">&lt;?php $unique_identifier = md5(uniqid(rand(), true)); ?&gt;</pre>
<p>The <em>uniqid</em> statement generates a globally unique identifier with a <em>rand()</em> prefix and using much more entropy (<em>true).</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/11/24/when-unique-isnt-really-unique/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Web APIs and Mashups Seminar in Jos</title>
		<link>http://blog.timakinbo.com/2009/11/16/web-apis-and-mashups-seminar-in-jos/</link>
		<comments>http://blog.timakinbo.com/2009/11/16/web-apis-and-mashups-seminar-in-jos/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 09:06:57 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Jos]]></category>
		<category><![CDATA[Mashups]]></category>
		<category><![CDATA[Nigeria]]></category>
		<category><![CDATA[SMS]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=57</guid>
		<description><![CDATA[I spent last week in the city of Jos where I went to spend some time with my family and also attend my class reunion. I had an idea to organize a seminar where I&#8217;ll teach and talk about anything I thought would be cool and constitute new knowledge. So I went about contacting some [...]]]></description>
			<content:encoded><![CDATA[<p>I spent last week in the city of Jos where I went to spend some time with my family and also attend my class reunion. I had an idea to organize a seminar where I&#8217;ll teach and talk about anything I thought would be cool and constitute new knowledge.</p>
<p>So I went about contacting some of my colleagues who gave me pointers on whom to see and after making a few contacts, I was well on my way to organizing the seminar.</p>
<p>I got a lot of support there and we were able to get about a hundred diploma students at the University of Jos to attend. I was initially thinking about organizing something strictly for web developers and programmers. I had a few ideas about web-based APIs, mashups, code versioning, improving web application performance, etc. but when I was told the caliber of people who were going to be attending the seminar, I decided to stick to something regular computing students will be interested in.</p>
<p><a href="http://blog.timakinbo.com/wp-content/uploads/2009/11/13112009022.jpg"><img style="border: 0px initial initial;" title="Unpacking" src="http://blog.timakinbo.com/wp-content/uploads/2009/11/13112009022-300x225.jpg" alt="Unpacking" width="300" height="225" /></a></p>
<p>I gave a presentation on Web APIs and Mashups and after the short slideshow, went into building a practical mashup. <span style="background-color: #ffffff;">I was a little concerned about making sure I didn&#8217;t speak over the top of their heads and so looked for something very practical to demonstrate a mashup. I ended up building an application that sent a text message to their mobile phones. Afterwards, I went on to talk about the various freely available APIs on the web that can be used to build smart applications and encouraged them to try them out.</span></p>
<p><a href="http://blog.timakinbo.com/wp-content/uploads/2009/11/13112009031.jpg"><img class="alignnone size-medium wp-image-59" title="Making the presentation" src="http://blog.timakinbo.com/wp-content/uploads/2009/11/13112009031-300x225.jpg" alt="Making the presentation" width="300" height="225" /></a></p>
<p><span style="background-color: #ffffff;">There were only a very few individuals there who had done anything for the web but based on the inquiries I received at the end of the seminar, I knew a lot of them had gotten very interested in making further exploration.</span></p>
<p><span style="background-color: #ffffff;">I ended the seminar by talking about web mapping and most especially Google Mapmaker and told them about how Plateau State had very little content on the Internet and how that was an opportunity to do something. I&#8217;m told that there are plans to build a team that will take what they&#8217;ve learnt from the seminar and do something about it.</span></p>
<p><span style="background-color: #ffffff;"><a href="http://blog.timakinbo.com/wp-content/uploads/2009/11/13112009029.jpg"><img class="alignnone size-medium wp-image-58" title="Attendees" src="http://blog.timakinbo.com/wp-content/uploads/2009/11/13112009029-300x225.jpg" alt="Attendees" width="300" height="225" /></a></span></p>
<p><span style="background-color: #ffffff;">The success of the event was more than I envisaged and I&#8217;m encouraged to give many of these talks and presentations in other parts of the country.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/11/16/web-apis-and-mashups-seminar-in-jos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using git hooks to check syntax errors</title>
		<link>http://blog.timakinbo.com/2009/09/25/using-git-hooks-to-check-syntax-errors/</link>
		<comments>http://blog.timakinbo.com/2009/09/25/using-git-hooks-to-check-syntax-errors/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 07:57:33 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=53</guid>
		<description><![CDATA[Git is currently my favorite source code versioning tool and while I used Subversion, I knew about something called hooks that I never used. Essentially, hooks allow you to execute custom scripts when you perform certain actions on your repository like committing files, pulling updates and so on. This is a very useful as you [...]]]></description>
			<content:encoded><![CDATA[<p>Git is currently my favorite source code versioning tool and while I used Subversion, I knew about something called hooks that I never used.</p>
<p>Essentially, hooks allow you to execute custom scripts when you perform certain actions on your repository like committing files, pulling updates and so on. This is a very useful as you can write hook scripts to (say for example) automatically ftp a file to your web server when a change has been made.</p>
<p>A whole lot of really cool hook scripts have been written and if you use any code versioning tools, you should check out the ones that have been written for the tool you use.</p>
<p>In particular, I find that sometimes developers could check in code that has syntactic bugs. This happens in environments where there are no strict code testing rules. It can be really annoying when you or someone else does this and you have to fix that and then commit again&#8230; not professional at all. So I came across <a href="http://phpadvent.org/2008/dont-commit-that-error-by-travis-swicegood" target="_blank">this post</a> by Travis Swicegood that lists code that does a php lint on your PHP files before committing them to the repository. PHP lint (php -l) basically checks the syntax of your code and either gives an &#8220;ok&#8221; or prints the offending line.</p>
<p>For one of the projects I&#8217;m working on, I had to change line 11 of Travis&#8217; code to read:</p>
<p><code>$filename_pattern = '/\.(php|engine|theme|install|inc|module|test)$/';</code></p>
<p>instead of</p>
<p><code>$filename_pattern = '/\.php$/';</code></p>
<p>If you&#8217;ve done Drupal coding, you&#8217;ll quickly recognize that <img src='http://blog.timakinbo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/09/25/using-git-hooks-to-check-syntax-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Git over non-standard SSH ports</title>
		<link>http://blog.timakinbo.com/2009/09/14/using-git-over-non-standard-ssh-ports/</link>
		<comments>http://blog.timakinbo.com/2009/09/14/using-git-over-non-standard-ssh-ports/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 13:01:46 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=43</guid>
		<description><![CDATA[I&#8217;ve configured some deployment servers to use SSH over non-standard SSH ports and that can really be a problem when you want to use that with git. No matter what you do, git would always attempt to connect through the standard SSH port 22. There was really no point in scratching my head and trying [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve configured some deployment servers to use SSH over non-standard SSH ports and that can really be a problem when you want to use that with git. No matter what you do, git would always attempt to connect through the standard SSH port 22.</p>
<p>There was really no point in scratching my head and trying to pull my hair out in order to fix this. So I googled a solution. This <a href="http://infovore.org/archives/2008/10/13/pulling-from-git-over-a-non-standard-ssh-port/" target="_blank">post</a> gave me a hint but wasn&#8217;t helpful enough so I decided to write a blog post on how to go about solving this.</p>
<p>You&#8217;ll have to configure your repository in your <em>.ssh/config</em> file. Here&#8217;s an example. Simply substitute the <em>#*#</em> placeholders for the actual values</p>
<pre>
Host #hostname#
  User #username#
  Hostname #hostname#
  Port #non-standard port#
</pre>
<p>And if you prefer to use private keys to login:</p>
<pre>
Host #hostname#
  User #username#
  Hostname #hostname#
  Port #non-standard port#
  PreferredAuthentications publickey
  IdentityFile "#path_to_private_key#"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/09/14/using-git-over-non-standard-ssh-ports/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t ignore that warning</title>
		<link>http://blog.timakinbo.com/2009/08/29/dont-ignore-that-warning/</link>
		<comments>http://blog.timakinbo.com/2009/08/29/dont-ignore-that-warning/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 09:39:52 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=35</guid>
		<description><![CDATA[Webmasters out there, how many times have you ignored the advice to backup your site when making an upgrade? Trust me, if you continue (like I&#8217;ve been doing) that way, it will come back to bite you one day. Earlier today, I wrote a new post on this blog and having ignored the blog for [...]]]></description>
			<content:encoded><![CDATA[<p>Webmasters out there, how many times have you ignored the advice to backup your site when making an upgrade? Trust me, if you continue (like I&#8217;ve been doing) that way, it will come back to bite you one day.</p>
<p>Earlier today, I wrote a new post on this blog and having ignored the blog for a while, I noticed that there was a new upgrade for WordPress (the software that powers this blog) and I thought &#8211; &#8220;Hey why don&#8217;t I do some site maintenance in the process.&#8221; and there I went to click on <strong>upgrade automatically</strong>. I (like I usually do) ignored the advice to backup the site before upgrading and just clicked through. For some reason (I thought my Internet connection broke) the process didn&#8217;t display a success status but I assumed it went well.</p>
<p>Thanks for my friend Tunde Adeyemi (@barbietunnie) who pointed out the fact that the site was broken and needed fixing. I quickly replaced the site with a &#8220;We&#8217;ll be back soon&#8221; banner page and went about fixing it. Thankfully, nothing was damaged and the process took less than 30 minutes. So next time you want to do upgrades (especially when it involves the core), do take the advice you&#8217;re given.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/08/29/dont-ignore-that-warning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I&#8217;m a Map Maker</title>
		<link>http://blog.timakinbo.com/2009/03/23/why-im-a-map-maker/</link>
		<comments>http://blog.timakinbo.com/2009/03/23/why-im-a-map-maker/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 10:38:00 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[LBS]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[Mashups]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=24</guid>
		<description><![CDATA[I remember the first time I used Google Maps. I was thrilled with the ability to find places and locate them on a digital map. That was my first exposure to Geographic Information Systems. But I quickly grew out of it after a while and what was majorly because of the lack of localized information. [...]]]></description>
			<content:encoded><![CDATA[<p>I remember the first time I used <a href="http://maps.google.com/" target="_blank">Google Maps</a>. I was thrilled with the ability to find places and locate them on a digital map. That was my first exposure to <a href="http://en.wikipedia.org/wiki/GIS" target="_blank">Geographic Information Systems</a>. But I quickly grew out of it after a while and what was majorly because of the lack of localized information.</p>
<div id="attachment_25" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.timakinbo.com/wp-content/uploads/2009/03/staticmap-roadmap.gif"><img class="size-medium wp-image-25" title="staticmap-roadmap" src="http://blog.timakinbo.com/wp-content/uploads/2009/03/staticmap-roadmap-300x300.gif" alt="Roadmap as appeared on Google Maps on 22 March, 2009" width="300" height="300" /></a><p class="wp-caption-text">Victoria Island roadmap as appeared on Google Maps on 22 March, 2009</p></div>
<p>I dabbled into Google Maps mashups and built my first Google Maps application when I was working on my final year project in the University but then I saw little use for it locally.</p>
<p>A few months back, Google announced a community-based mapping project known as <a href="http://www.google.com/mapmaker" target="_blank">Google Map Maker</a>. Google Map Maker enables the people who live in areas that have not been well covered by Google to map their localities using the tools that Google has provided. The implication of this is that you now have the ability to map your village, if you wanted to.</p>
<div id="attachment_26" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.timakinbo.com/wp-content/uploads/2009/03/staticmap-mapmaker-roadpmap.gif"><img class="size-medium wp-image-26" title="staticmap-mapmaker-roadpmap" src="http://blog.timakinbo.com/wp-content/uploads/2009/03/staticmap-mapmaker-roadpmap-300x300.gif" alt="Google Map Maker tile of Victoria Island as at March 22, 2009" width="300" height="300" /></a><p class="wp-caption-text">Google Map Maker tile of Victoria Island as at March 22, 2009</p></div>
<h3>What&#8217;s the motivation?</h3>
<p>That&#8217;s a rather interesting question because I never really gave thought to it when I started creating maps using Google Map Maker but in giving thought to it, I realized that in providing local content on the Internet not only does it makes the Internet richer but it also provides value for the locals. I earlier mentioned how the Mapping service was of little use to me because there wasn&#8217;t local data but now, with other people mapping different areas within the country, I am able to determine routes before setting out (for instance).</p>
<p>I remember a particular day I was to meet up with someone somewhere in Lagos Mainland. He described the point of meeting as around the intersection of Opebi Link Road. I wasn&#8217;t sure of the location but then I thought &#8220;worst case scenario, I&#8217;ll ask someone about it.&#8221; I decided to put Google Map Maker to the test. I did a search for Opebi Link Road and voila, it showed me the location and I was able to know where it was and how to get there.</p>
<p>Imagine then that you are looking for the nearest branch of a particular bank. Apart from having to consult the list of branches from the bank&#8217;s web site, you can look it up on Google Map Maker. Now eventually, the information will be integrated into Google Maps proper but for now, everything is still available on Google Map Maker.</p>
<p>So what happens if the information you are looking for is not available? Add it! There&#8217;s no reason why your company&#8217;s branches or building (or other features like street names, restaurants, churches, mosques, entertainment venues, etc) is not tagged on the map. Information is being added to the map on a daily basis and your contributions are not only helping give your company visibility, but it&#8217;s also adding value to others who might find that information useful when the need arises.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/03/23/why-im-a-map-maker/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Why every Web Developer needs an online presence</title>
		<link>http://blog.timakinbo.com/2009/03/20/why-every-web-developer-needs-an-online-presence/</link>
		<comments>http://blog.timakinbo.com/2009/03/20/why-every-web-developer-needs-an-online-presence/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 22:21:04 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Publicity]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=21</guid>
		<description><![CDATA[It&#8217;s simple &#8211; visibility. Loy Okezie recently published a blog post listing a few of what he thinks to be the top 100 web developers in Nigeria. I found the comments to be very educative and interesting. I happen to know virtually everyone on that list and while some comments on the site and elsewhere [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s simple &#8211; visibility.</p>
<p>Loy Okezie recently published a <a href="http://www.startupsnigeria.com/2009/03/100-best-web-developers-from-nigeria/" target="_blank">blog post</a> listing a few of what he thinks to be the top 100 web developers in Nigeria. I found the comments to be very educative and interesting.</p>
<p>I happen to know virtually everyone on that list and while some comments <a href="http://www.startupsnigeria.com/2009/03/100-best-web-developers-from-nigeria/#comments" target="_blank">on the site</a> and <a href="http://www.nairaland.com/nigeria/topic-246291.0.html" target="_blank">elsewhere</a> were such that the author was partial, there&#8217;s something very important here that I wish every other developer (that was nominated) will do something about &#8211; Get visible. The people on that list were there because Loy happened to know about them. Loy hasn&#8217;t met a number of them physically but using online interaction tools and social networks, he&#8217;s been able to get to know them.</p>
<p>After reading the comments on the blog and the discussion forum, I was happy to know that there are people making a difference all over Nigeria but they need to get visible and let the whole world know what they&#8217;re doing. At the very least, I expect these web developers to have a <a href="http://twitter.com/" target="_blank">Twitter</a> account (since I refer to it as a blog for lazy bloggers) and better still a blog. If they are very ambitious, they can go ahead to have a proper web site with profiles of what they&#8217;ve done, a blog and so on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/03/20/why-every-web-developer-needs-an-online-presence/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Internal web server access from the Internet</title>
		<link>http://blog.timakinbo.com/2009/03/20/internal-web-server-access-from-the-internet/</link>
		<comments>http://blog.timakinbo.com/2009/03/20/internal-web-server-access-from-the-internet/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 00:09:31 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://blog.timakinbo.com/?p=17</guid>
		<description><![CDATA[Here&#8217;s the synopsis, I have a web development machine that has a NAT connection to the Internet and what that means is that I cannot access the machine directly from the Internet. So if I wanted a friend or colleague to test my work or say I&#8217;m at someplace remote and want to be able [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the synopsis, I have a web development machine that has a NAT connection to the Internet and what that means is that I cannot access the machine directly from the Internet. So if I wanted a friend or colleague to test my work or say I&#8217;m at someplace remote and want to be able to view my web application, that will not be possible. However, using some techniques (which I will describe in this post), you can actually make this machine accessible on the Internet.</p>
<p>Here are certain assumptions:</p>
<ol>
<li>You are using Windows XP or Vista as your local machine.</li>
<li>You have a Linux/UNIX host as your remote machine.</li>
<li>You are using the Apache web server on both machines.</li>
<li>You have basic Linux/UNIX administration skills.</li>
<li>You&#8217;re comfortable with basic level Apache configuration and know what .htaccess is.</li>
</ol>
<h2>Step 1</h2>
<p>First of all, we will be using a technique known as SSH port forwarding. This makes it possible to have an SSH server that has a public routable address (public IP) to forward an arbitrary port number to our local machine. For this demonstration, I chose to forward port 8080 on the remote machine to port 80 on my local machine.</p>
<p>SSH servers by default are now being configured in such a way that this <em>forwarded port</em> is only accessible from within the remote machine (AKA localhost). In order to ensure that this <em>forwarded port</em> is accessible to any machine connecting from the Internet, you need to tweak the settings of the SSH server running on the remote machine.</p>
<p>Simply edit the <em>/etc/ssh/sshd_config</em> (the path may be different) file on the remote machine and comment out the line <em>GatewayPorts no</em>. Change the value from <em>no</em> to <em>yes</em>. Save the file and reload the SSH server.</p>
<h2>Step 2</h2>
<p>Next on your local machine, you will need to create the SSH tunnel to the remote machine. This can easily be done using the plink application in the PuTTY suite of applications. Please visit <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/</a></p>
<p>Simply launch the plink application from your command prompt using the following syntax:</p>
<p><code><br />
plink -R %REMOTE_PORT%:%LOCAL_IP%:80 %USERNAME%@%SERVER_ADDR%<br />
</code></p>
<p>%REMOTE_PORT% is the remote port you wish to forward. In my case it was 8080.<br />
%LOCAL_IP% is your local machine&#8217;s IP address. In my case, I simply used the localhost IP &#8211; 127.0.0.1<br />
%USERNAME% is your username on the remote machine and %SERVER_ADDR% is either the IP address or hostname of the remote machine.</p>
<p>Once you&#8217;ve logged in, the port on the remote machine is forwarded to your machine. If your web server is running on a port different from 80, change the syntax accordingly.</p>
<p>You can test connectivity by going to http://%SERVER_ADDR%:%REMOTE_PORT%/. This should display contents from your local web server. If you wish to simply use this, you&#8217;re fine but if you want something cleaner and more invisible, then you&#8217;ll want to proceed.</p>
<h2>Step 3</h2>
<p>Next step is configuring your hosting account (a subdomain will be best) to proxy requests to your local machine&#8217;s web server.</p>
<p>Create your subdomain and navigate to the document_root of that subdomain. Edit/create a .htaccess file and put the following into it.</p>
<p><code><br />
RewriteEngine on<br />
RewriteRule ^(.*)$ "http://%DOMAIN%:%REMOTE_PORT%/$1" [P,L]<br />
</code></p>
<p>Here, %DOMAIN% is either localhost or your domain/subdomain (which of course should have previously been configured to point to the remote machine), %REMOTE_PORT% is the remote port configured on the remote machine. The <em>magic</em> being performed here is done by the [P,L] directive that proxies any requests to the local machine through the tunnel accessible from the remote port. The $1 parameter passes on any url parameters to the local web server.</p>
<p>Once this has been completed, visiting http://%DOMAIN%/ will bring up content from your local machine. This is made possible by virtue of the proxy features in the Apache web server.</p>
<h2>Step 4</h2>
<p>This final step is only needed if you intend to be able to log the original ip address the request came from before the proxying was done.</p>
<p>This involves modifying your local machine&#8217;s web server configuration.</p>
<p>Simply locate the VirtualHost or main configuration section in the Apache configuration file and add this:</p>
<p><code><br />
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxylog<br />
CustomLog logs/custom-access.log proxylog<br />
</code></p>
<p>This directive is a modified combinedlogs directive to use the HTTP_X_FORWARDED_FOR header parameter instead of the IP address in logging the request.</p>
<p>Save the file and reload/restart your web server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timakinbo.com/2009/03/20/internal-web-server-access-from-the-internet/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
