<?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>Likesalmon Design &#187; Virtual Hosts</title>
	<atom:link href="http://www.likesalmondesign.com/category/virtual-hosts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.likesalmondesign.com</link>
	<description>Open Source Web Design and Development from Scratch</description>
	<lastBuildDate>Fri, 03 Sep 2010 15:59:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>How to configure Apache virtual hosting in Ubuntu Karmic 9.10</title>
		<link>http://www.likesalmondesign.com/how-to-configure-apache-virtual-hosting-in-ubuntu-karmic-9-10/</link>
		<comments>http://www.likesalmondesign.com/how-to-configure-apache-virtual-hosting-in-ubuntu-karmic-9-10/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 03:38:56 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Virtual Hosts]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=283</guid>
		<description><![CDATA[Before you do anything, back up your original config files. I used to just create a copy of the files with the suffix &#8220;.bak&#8221; (sudo cp example.conf example.conf.bak), which works, but creates a lot of clutter. Now I use a great little utility called etckeeper which automatically places all files in /etc under version control [...]]]></description>
			<content:encoded><![CDATA[<p>Before you do anything, back up your original config files.  I used to just create a copy of the files with the suffix &#8220;.bak&#8221; (<code>sudo cp example.conf example.conf.bak</code>), which works, but creates a lot of clutter.  Now I use a great little utility called <em>etckeeper</em> which automatically places all files in /etc under version control using Bazaar.  It also automatically performs a commit each day if you forget to.  You can get etckeeper by typing this in the terminal: <code>sudo apt-get install etckeeper</code>.</p>
<h3>Update, 3/29/10</h3>
<p>I just had to do this from scratch after a computer disaster, and I found an omission.  Before you get started on this business you need to do what this post says:</p>
<p>http://www.likesalmondesign.com/use-your-users-public_html-directory-to-serve-webpages/</p>
<h3>And we&#8217;re off</h3>
<p>Now on to virtual hosts.  The first thing you need to do is edit /etc/hosts so your computer knows where to look for your website:</p>
<ol>
<li>In the terminal, enter: <code>$ sudo gedit /etc/hosts</code></li>
<li>In gedit, add the following line to the hosts file: <code>127.0.0.1 mysite.dev</code>
<ul>
<li>Note: you can use whatever name you want for your virtual hosted site.  I like to use the suffix <em>.dev</em> because it won&#8217;t conflict with sites on the actual internet.</li>
<li>Note: 127.0.0.1 is the same ip address that is assigned to localhost in that file.  If yours is different, use that one.</li>
</ul>
</li>
</ol>
<p>Next add your site to /etc/apache2/sites-available/ and then link to that file in /etc/apache2/sites-enabled/:</p>
<ol>
<li>In the terminal, cd to <code>/etc/apache2/sites-available/</code></li>
<li>Create a new file with: <code>$ sudo touch mysite.dev</code></li>
<li>Open that file in gedit: <code>$ sudo gedit mysite.dev</code></li>
<li>Add following to that file:<br />
&lt;VirtualHost *:80&gt;<br />
ServerName 	mysite.dev<br />
ServerAlias 	mysite.dev<br />
ServerAdmin 	myaddress@email.com<br />
DocumentRoot /home/<em>yourusername</em>/public_html/mysite/<br />
&lt;/VirtualHost&gt;</li>
</ol>
<p>Add a pseudo link to that file in /etc/apache2/sites-enabled/:</p>
<ol>
<li>cd over to <code>/etc/apache2/sites-enabled/</code></li>
<li>In the terminal, enter: <code>$ sudo ln -s /etc/apache2/sites-enabled/mysite.dev mysite.dev</code>
<ul>
<li>Note: <code>$ ln -s <em>target</em> <em>linkname</em></code></li>
</ul>
</li>
</ol>
<p>Finally, restart Apache:</p>
<ol>
<li>$ sudo service apache2 restart</li>
<li>You&#8217;re done!</li>
</ol>
<p>See!  Not so bad&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/how-to-configure-apache-virtual-hosting-in-ubuntu-karmic-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
