<?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>Reflections of a scattered Mind !! &#187; webdev</title>
	<atom:link href="http://blog.saionline.co.in/tag/webdev/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.saionline.co.in</link>
	<description>&#34;Not all scattered pieces are of broken glass&#34;</description>
	<lastBuildDate>Mon, 14 Nov 2011 20:56:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<cloud domain='blog.saionline.co.in' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Subdomains on localhost</title>
		<link>http://blog.saionline.co.in/2008/09/subdomains-on-localhost/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=subdomains-on-localhost</link>
		<comments>http://blog.saionline.co.in/2008/09/subdomains-on-localhost/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 10:54:00 +0000</pubDate>
		<dc:creator>Sai Prasad</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://blog.saionline.co.in/2008/09/subdomains-on-localhost/</guid>
		<description><![CDATA[Intro
Developing websites on localhost may sometimes need making of sub domains. Installing and running another server for this purpose is useless, consumes more resources etc. So here is the technique to make sub domains on localhost.
You can also use this to host more than one site on localhost.  [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:onload;">Intro</span><br />
Developing websites on localhost may sometimes need making of sub domains. Installing and running another server for this purpose is useless, consumes more resources etc. So here is the technique to make sub domains on localhost.</p>
<p>You can also use this to host more than one site on localhost. i.e, you can host multiple sites situated on different folders.</p>
<p><span style="font-weight: bold;">PS</span>: This is for Apache configuration.</p>
<p><span style="font-size:130%;">Steps</span></p>
<p>First decide on the subdomain names&#8230;<br />
for eg: sub.localhost, sub2.localhost, alt.localhost , images.localhost etc..<br />
You can also name www.name.com. (Please note that if there is a site with that name on the net, you wont be able to access that site on the internet.)</p>
<p>Second making these sites to point to 127.0.0.1, for this you can edit the HOSTS file on windows. The HOSTS file found on Windows (and linux too) is like a local DNS (domain name server). When you type a url on the browsers address bar, the domain name is converted to the IP of the server by a DNS lookup by the browser. Now here is the catch &#8230; Windows first looks at the HOSTS file before doing any DNS lookup. So we can block certain sites by editing the HOSTS file.</p>
<p>HOSTS file is found typically here &#8230;</p>
<p>Windows XP    : C:\WINDOWS\SYSTEM32\DRIVERS\ETC<br />
Windows 2K    : C:\WINNT\SYSTEM32\DRIVERS\ETC<br />
Windows 98/ME : C:\WINDOWS</p>
<p>Linux  : /etc/</p>
<p>The Lines followed by a # are comments and explains how to use the HOSTS file.127.0.0.1 is the IP address that is used to loopback to your computer itself.</p>
<p>Now add to HOSTS line<br />
127.0.0.1 &lt;hostname&gt;<br />
Egs:<br />
127.0.0.1 sub.localhost<br />
127.0.0.1 sub1.localhost<br />
127.0.0.1 sub2.localhost<br />
127.0.0.1 images.localhost<br />
127.0.0.1 mysiteonmycomp.com<br />
127.0.0.1 images.mysiteonmycomp.com</p>
<p>Next we have to assign each of these different URL&#8217;s to different folders.<br />
This is done on the apache conf file. (httpd.conf file situated in apache\conf\ directory).<br />
Note that if you are using XAMPP, the virtual hosts file is at apache\conf\extra\httpd-vhosts.conf</p>
<p>Scroll all the way down the httpd.conf file until you reach about Virtual Hosts.<br />
Add for each domain (or subdomain)</p>
<p>NameVirtualHost &lt;sitename&gt;:80</p>
<p>&lt;virtualhost &lt;sitename&gt;:80&gt;<br />
ServerName &lt;sitename&gt;<br />
DocumentRoot DocumentRoot-see example<br />
DirectoryIndex index.php index.html index.html index.htm index.shtml<br />
&lt;/VirtualHost&gt;<br />
You can also any valid extra parameters also (like ServerAdmin, ServerAlias etc.)</p>
<p><span style="font-weight: bold;">eg:</span></p>
<p>NameVirtualHost saiprasad.com:80<br />
&lt;virtualhost saiprasad.com:80&gt;<br />
ServerAdmin webmaster@localhost<br />
DocumentRoot &#8220;C:/xampp/htdocs/www&#8221;<br />
ServerName saiprasad.com<br />
ServerAlias www.saiprasad.com<br />
&lt;/virtualhost&gt;</p>
<p>NameVirtualHost test.saiprasad.com:80<br />
&lt;virtualhost test.saiprasad.com:80&gt;<br />
ServerAdmin webmaster@myjoomlasite.com<br />
DocumentRoot &#8220;C:/xampp/htdocs/test&#8221;<br />
ServerName test.saiprasad.com<br />
&lt;/virtualhost&gt;</p>
<p>NOTE : All the DocumentRoots must be under the DocumentRoot (i.e; must be a sub-directory) specified in httpd.confd.<br />
For example, in XAMPP, the default DocumentRoot is &#8220;C:/xampp/htdocs&#8221;. Therefore, the DocumentRoot of any virtual host cannot be given as : &#8220;C:/xampp/test&#8221;. The folder must be under &#8220;C:/xampp/htdocs&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.saionline.co.in/2008/09/subdomains-on-localhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

