<?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>MH2 &#187; Apache</title>
	<atom:link href="http://www.horesh-studios.com/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.horesh-studios.com</link>
	<description>Everything web development</description>
	<lastBuildDate>Wed, 24 Aug 2011 14:46:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Setting up virtual hosts on Linux</title>
		<link>http://www.horesh-studios.com/linux/setting-up-virtual-hosts-on-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-virtual-hosts-on-linux</link>
		<comments>http://www.horesh-studios.com/linux/setting-up-virtual-hosts-on-linux/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 14:02:58 +0000</pubDate>
		<dc:creator>Motti Horesh</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vhosts]]></category>

		<guid isPermaLink="false">http://horesh-studios.com/?p=19</guid>
		<description><![CDATA[Today we will be setting a virtual host on Ubuntu.  Virtual host is the practice of hosting more than one server on a single machine.  In our case our server will not be live on the Internet, but we do want to have the ability to create local domain names...]]></description>
			<content:encoded><![CDATA[<p>Today we will be setting a virtual host on Ubuntu.  Virtual host is the practice of hosting more than one server on a single machine.  In our case our server will not be live on the Internet, but we do want to have the ability to create local domain names such as:</p>
<p>http://my.domain/</p>
<p>http://test.site/</p>
<p>http://mottis.site/</p>
<p>http://example/</p>
<p>or anything else you have in your mind that could make your organization easier.</p>
<p>In this tutorial I will be using Ubuntu 11, with Apache 2.2.17</p>
<p>The first thing that you would want to do is to open Terminal, and navigate to the apache2 sites folder</p>
<pre class="brush: plain; title: ; notranslate">cd /etc/apache2/sites-available </pre>
<p>next, we will create a new config file, with the following code:</p>
<pre class="brush: plain; title: ; notranslate">sudo gedit test.site.conf</pre>
<p>and insert the following lines of code in it</p>
<pre class="brush: plain; title: ; notranslate">
&lt;VirtualHost test.site&gt;
ServerAdmin webmaster@localhost

ServerAlias test.site
DocumentRoot /home/motti/sites/test.site

#we want specific log file for this server
CustomLog /var/log/apache2/test.site-access.log combined
&lt;/VirtualHost&gt;
</pre>
<p>The next step would be to add test.site to our local hosts file, ensuring it will look for this domain locally, to do that, edit the hosts file and add test.site to it.</p>
<pre class="brush: plain; title: ; notranslate">sudo gedit /etc/hosts </pre>
<pre class="brush: plain; title: ; notranslate">127.0.0.1    localhost test.site</pre>
<p>Now we want to enable to site, we do that by typing the following line.</p>
<pre class="brush: plain; title: ; notranslate">sudo a2ensite test.site.conf</pre>
<p>All we have left to do now is to reload the server, and we should be all set.</p>
<pre class="brush: plain; title: ; notranslate">sudo /etc/init.d/apache2 reload</pre>
<p><img class="size-full wp-image-26 alignnone" style="border: 1px solid black;" title="Setting up Virtual Host" src="http://horesh-studios.com/wp-content/uploads/2011/07/Screenshot.png" alt="" width="580" height="212" /></p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.horesh-studios.com/linux/setting-up-virtual-hosts-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

