<p>So while I was redesigning my site, I needed somewhere to develop the new design. I didn’t want to have to setup a sub-domain on the live site because that would be a pain to have to FTP files up everytime I changed something. So I installed <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> on my computer.</p>

<p>Basically, XAMPP is a all in one Apache web server. It installs Apache, PHP, MySQL…everything I needed.</p>



<p>Once you install it, you get a web directory here <strong>C:Program Filesxampphtdocs</strong> (or whichever directory you install XAMPP to). That’s great, everything works fine when you put things in that directory and browse to <strong>localhost</strong>. But what about if you want to setup multiple sites? That is where I really had to do some digging.</p>

<h2 class="replaceHeadline">Setting Up Multiple Sites</h2>
<p>I found this really good article that walks you through <a href="http://www.campbellssource.com/multiple-website-on-xampp/">setting up multiple sites on XAMPP</a>. The article was a little longer than I thought it had to be, so I thought I would clarify some things.</p>

<ol><li>Find this file: <strong>C:Program Filesxamppapacheconfextrahttpd-vhosts.conf</strong>, and open it in notepad.</li>
<li>Find a line that says something like <strong>NameVirtualHost *:80</strong>. Remove the <strong>#</strong> sign that you see in front of it; this turns it from being a comment to code that is actually executed. (This was not in any instructions I could find)</li>
<li><p>Next, scroll to the bottom, and you can add multiple domains. Here is what mine looks like:</p>
<div class="codeblock"><code>
&lt;VirtualHost *:80&gt;<br />ServerAdmin webmaster@localhost.trevordavis.dev<br />DocumentRoot "C:/sites/trevordavis.dev/webpages"<br />ServerName localhost.trevordavis.dev<br />&lt;/VirtualHost&gt;<br /><br />&lt;VirtualHost *:80&gt;<br />ServerAdmin webmaster@localhost.trevordavis.redesign<br />DocumentRoot "C:/sites/trevordavis.redesign/webpages"<br />ServerName localhost.trevordavis.redesign<br />&lt;/VirtualHost&gt; 

</code></div></li>
<li><p>Finally, find this file: <strong>C:WINDOWSsystem32driversetchosts</strong> and open it in notepad. You need to add an entry for each site you setup in the <strong>httpd-vhosts.conf</strong> file. My file looks like this:</p>
<div class="codeblock"><code>
127.0.0.1 localhost<br />127.0.0.1 localhost.trevordavis.dev<br />127.0.0.1 localhost.trevordavis.redesign 

</code></div></li>
</ol><h3 class="replaceHeadline">That’s It</h3>
<p>Once you have done this you can browse to <strong>http://localhost.trevordavis.dev</strong> and <strong>http://localhost.trevordavis.redesign</strong> on your computer when you have your web server running. This means that you can view PHP files and execute SQL locally.</p>

<p>It’s great.</p>

<p>Let me know if you have any questions.</p>