<?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>Riding The Breeze &#187; apache</title>
	<atom:link href="http://www.iliveinperego.com/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iliveinperego.com</link>
	<description>Yes !</description>
	<lastBuildDate>Fri, 12 Feb 2010 09:46:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automatic vHost with Apache</title>
		<link>http://www.iliveinperego.com/2008/05/automatic-vhost-with-apache/</link>
		<comments>http://www.iliveinperego.com/2008/05/automatic-vhost-with-apache/#comments</comments>
		<pubDate>Mon, 19 May 2008 20:41:48 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/automatic-vhost-with-apache</guid>
		<description><![CDATA[In my development machine i wanted to have a specific vHost for each project. Something that would allow me to type URL like:

 http://wordpress-test1.lan/
 http://phpmyadmin.lan/
 http://project1.lan/

I started to set for each one a vHost in Apache but after a while I&#039;ve found myself with too many vHost files.
So I started to search for a more [...]]]></description>
			<content:encoded><![CDATA[<p>In my development machine i wanted to have a specific vHost for each project. Something that would allow me to type URL like:</p>
<ul>
<li> http://wordpress-test1.lan/</li>
<li> http://phpmyadmin.lan/</li>
<li> http://project1.lan/</li>
</ul>
<p>I started to set for each one a vHost in Apache but after a while I&#039;ve found myself with too many vHost files.</p>
<p>So I started to search for a more easy and fast way, and here it is:</p>
<p><strong>Note:</strong> you need to install Apache mod_rewrite to make things work.</p>
<p>Preamble:</p>
<ol>
<li>You have Apache installed, and your DocumentRoot is <em>/var/www/</em></li>
<li>You have mod_rewrite installed and enabled</li>
<li>You can modify the <em>/etc/hosts</em> file</li>
</ol>
<p>Let&#039;s say we want to install a test/demo version of Wordpress and access it from the URL http://wp-test.lan/</p>
<ol>
<li>We download and untar Wordpress in <em>/var/www/wp-test/</em></li>
<li>We tell our machine to resolve the domain wp-test.lan with the IP 127.0.0.1. To make this we add a line to our hosts file.<code>hpatoio@namazu:~$ sudo su -<br />
[sudo] password for hpatoio:<br />
root@namazu:~#echo "127.0.0.1 wp-test.lan" &gt;&gt; /etc/hosts<br />
root@namazu:~#exit<br />
hpatoio@namazu:~$</code></li>
<li>Now we have to change Apache config. Open <em>/etc/apache2/sites-anabled/000-default</em> with your favorite editor and add these lines inside the <em>&lt;VirtualHost *&gt;</em> directive:<code>RewriteEngine on<br />
RewriteCond %{HTTP_HOST} ^([^.]+)\.lan$<br />
RewriteRule    ^(.+)$ /%1$1</code> Basically :</p>
<ul>
<li>The first line turns the mod_rewrite on</li>
<li>The second one tells Apache to keep in the host part of the URL (HTTP_HOST) everything that stands before &#034;.lan&#034;</li>
<li>Finally the third line insert the string matched before (%1) between the host and the resource part (directory + file + query string) of the requested URL</li>
</ul>
<li>Restart Apache</li>
<p><code>hpatoio@namazu:~$sudo /etc/init.d/apache2 restart</code><br />
Now if open your browser and you point it to the URL <em>http://wp-test.lan/</em> you should see the WP installation page. Right ?
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2008/05/automatic-vhost-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Override default directory index</title>
		<link>http://www.iliveinperego.com/2006/11/override-default-directory-index/</link>
		<comments>http://www.iliveinperego.com/2006/11/override-default-directory-index/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 09:45:18 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/override-default-directory-index</guid>
		<description><![CDATA[Override default directory index in Apache.
Open .htaccess
DirectoryIndex home.php index.php
]]></description>
			<content:encoded><![CDATA[<p>Override default directory index in Apache.</p>
<p>Open <em>.htaccess</em></p>
<blockquote><p>DirectoryIndex home.php index.php</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2006/11/override-default-directory-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
