<?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>Random Things &#187; apache</title>
	<atom:link href="http://www.edna.narrabilis.com/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edna.narrabilis.com</link>
	<description></description>
	<lastBuildDate>Sat, 18 Jul 2009 15:07:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Drupal subsites and apache conf files</title>
		<link>http://www.edna.narrabilis.com/2009/01/16/drupal-subsites-and-apache-conf-files/</link>
		<comments>http://www.edna.narrabilis.com/2009/01/16/drupal-subsites-and-apache-conf-files/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 20:16:00 +0000</pubDate>
		<dc:creator>ednawig</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.edna.narrabilis.com/?p=50</guid>
		<description><![CDATA[We wanted 1 drupal installation (on a RedHat server, installed under /var/www/html/drupal) with a few
subsites. In the past we achieved this with many symbolic links which
gets hard to manage after a while.
Another possibility is creating CNAMES for the different subsites but
that also has its set of issues (updating dns, getting certificates&#8230;)
The solution was to create [...]]]></description>
			<content:encoded><![CDATA[<p>We wanted 1 drupal installation (on a RedHat server, installed under <code>/var/www/html/drupal</code>) with a few<br />
subsites. In the past we achieved this with many symbolic links which<br />
gets hard to manage after a while.</p>
<p>Another possibility is creating CNAMES for the different subsites but<br />
that also has its set of issues (updating dns, getting certificates&#8230;)</p>
<p>The solution was to create a special configuration file (in<br />
<code>/etc/httpd/conf.d</code>), as follows:</p>
<p><code><br />
&lt;Directory /var/www/html/drupal&gt;<br />
&nbsp;&nbsp; Options FollowSymLinks<br />
&nbsp;&nbsp; RewriteEngine on<br />
&nbsp;<br />
&nbsp;&nbsp; RewriteCond %{REQUEST_FILENAME} !-f<br />
&nbsp;&nbsp; RewriteCond %{REQUEST_FILENAME} !-d<br />
&nbsp;&nbsp; RewriteCond %{THE_REQUEST} /subsite1/<br />
&nbsp;&nbsp; RewriteRule ^(.*)$ /drupal6/subsite1/?q=$1&nbsp;&nbsp;[L]<br />
&nbsp;<br />
&nbsp;&nbsp; RewriteCond %{REQUEST_FILENAME} !-f<br />
&nbsp;&nbsp; RewriteCond %{REQUEST_FILENAME} !-d<br />
&nbsp;&nbsp; RewriteCond %{THE_REQUEST} /subsite2/<br />
&nbsp;&nbsp; RewriteRule ^(.*)$ /drupal6/subsite2/?q=$1&nbsp;&nbsp;[L]<br />
&nbsp;<br />
&nbsp;&nbsp; RewriteCond %{REQUEST_FILENAME} !-f<br />
&nbsp;&nbsp; RewriteCond %{REQUEST_FILENAME} !-d<br />
&nbsp;&nbsp; RewriteCond %{THE_REQUEST} /<br />
&nbsp;&nbsp; RewriteRule ^(.*)$ /drupal/?q=$1&nbsp;&nbsp;[L]<br />
&lt;/Directory&gt;<br />
&nbsp;<br />
Alias /drupal/subsite1 &quot;/var/www/html/drupal&quot;<br />
Alias /drupal/subsite2 &quot;/var/www/html/drupal&quot;<br />
&nbsp;<br />
</code></p>
<p>The idea is that in each of the 4 line blocks take a url which does not<br />
correspond to a physical file or directory, and if it matches a<br />
particular string (say &#8217;subsite1&#8242;) it rewrites the url in a way which is<br />
understandable by drupal (all of this happens in a <directory> block<br />
which refers to <code>/var/www/html/drupal</code> so everything is relative to<br />
<code>/drupal</code> )</p>
<p>The Alias lines at the end of the file are needed to point urls which<br />
start with /drupal to the correct directory.</p>
<p>So any new site necessitates the addition of a new 4 line block and a<br />
new Alias line, and then restarting apache. Definitely easier than the<br />
other solutions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edna.narrabilis.com/2009/01/16/drupal-subsites-and-apache-conf-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
