<?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>remidian.com &#187; Joomla!</title>
	<atom:link href="http://remidian.com/category/misc-2/joomla/feed" rel="self" type="application/rss+xml" />
	<link>http://remidian.com</link>
	<description>Braindumps of Remi Visser, freelance Oracle DBA.</description>
	<lastBuildDate>Mon, 10 May 2010 12:33:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Make Joomla! multi sites enabled.</title>
		<link>http://remidian.com/misc-2/joomla/make-joomla-multi-sites-enabled.html</link>
		<comments>http://remidian.com/misc-2/joomla/make-joomla-multi-sites-enabled.html#comments</comments>
		<pubDate>Thu, 23 Aug 2007 17:34:07 +0000</pubDate>
		<dc:creator>remivisser</dc:creator>
				<category><![CDATA[Joomla!]]></category>

		<guid isPermaLink="false">http://remidian.com/uncategorized/make-joomla-multi-sites-enabled.html</guid>
		<description><![CDATA[Replace $JOOMLA_HOME/configuration.php with the file below and &#8216;off you go&#8217;, the Joomla! codebase can now serve multiple websites. readme On my Joomla! development site (my PC) I have created a configuration.php to make my Joomla! codebase multi sites enabled, that is several website aliases (configured in my httpd.conf) point to the same Joomla! directory. (Needless [...]]]></description>
			<content:encoded><![CDATA[<p>
Replace $JOOMLA_HOME/configuration.php with the file below and &#8216;off you go&#8217;, the Joomla! codebase can now serve multiple websites.<span id="more-54"></span>
</p>
<h3>readme</h3>
<p>
On my Joomla! development site (my PC) I have created a configuration.php to make my Joomla! codebase multi sites enabled, that is several website aliases (configured in my httpd.conf) point to the same Joomla! directory. (Needless to say, use it at your own risk.)
</p>
<p>
Of course there are some limitations (implications):
</p>
<ul>
<li>
All configured websites share the same $JOOMLA_HOME/administrator/components, $JOOMLA_HOME/components, $JOOMLA_HOME/mambots and $JOOMLA_HOME/modules files thus de-installing a component, module or mambot from one website makes the component unavailable for all websites. The Joomla! installer removes the file from the operating system. But since the &#8216;de-install&#8217; wasn&#8217;t run against the database on another website alias the component (module or mambot) may <strong>seem</strong>available in the administrator panel. </p>
<p><em>Solution:</em> I keep a keen eye on the components, modules and mambots I install and save (create) SQL files for manual (MySQL) installation and de-installation.</p>
</li>
<li>
Since the $JOOMLA_HOME/configuration.php file is overwritten the use of the configuration panel in the Joomla! administrator sections can only be used for &#8216;read only&#8217; access.
</li>
<li>
The images from $JOOMLA_HOME/images/stories are available to all websites. (I always create $JOOMLA_HOME/images/stories/&lt;site-alias&gt;) (If someone nows of a apache Rewrite trick to solve this please let met know!)
</li>
</ul>
<h3>Step 1. configure apache httpd.conf file</h3>
<p>
My httpd.conf file looks like below, the ServerAlias	*.joomla.remidian.localhost makes sure I can add as much aliasses as I want.
</p>
<h6>httpd.conf</h6>
<pre>
&lt;VirtualHost 127.0.0.1&gt;
 ServerName&nbsp;&nbsp;joomla.remidian.localhost
 ServerAlias&nbsp;&nbsp;*.joomla.remidian.localhost
 DocumentRoot&nbsp;&nbsp;&quot;C:/app/apache/Apache1/Apache/htdocs/Roomla_1.0.12&quot;
&lt;/VirtualHost&gt;
</pre>
<h3>Step 2. configure hosts file</h3>
<p>
Next you need to adjust your <a href="http://en.wikipedia.org/wiki/Hosts_file">&#8216;hosts&#8217; file</a>. You need to tell that your defined aliases will point to 127.0.0.1, your machine (localhost), otherwise your computer will look on the internet for these server names and well, won&#8217;t find it. (Yes, you can also use this &#8216;technique&#8217; for &#8216;Ad blocking&#8217;, what you simply do is redirect every known add server to your pc. See an excellent file here, <a href="http://someonewhocares.org/hosts/">http://someonewhocares.org/hosts/</a>)</p>
<h6>C:\WINDOWS\system32\drivers\etc\hosts</h6>
<pre>
# Joomla development!
127.0.0.1&nbsp;&nbsp;joomla.remidian.localhost
&nbsp;
127.0.0.1&nbsp;&nbsp;christenenvoorisrael.joomla.remidian.localhost
127.0.0.1&nbsp;&nbsp;isreality.joomla.remidian.localhost
127.0.0.1&nbsp;&nbsp;tovclub.joomla.remidian.localhost
127.0.0.1&nbsp;&nbsp;dragopecenica.joomla.remidian.localhost
127.0.0.1&nbsp;&nbsp;neverbesilent.joomla.remidian.localhost
127.0.0.1&nbsp;&nbsp;yadlami.joomla.remidian.localhost
127.0.0.1&nbsp;&nbsp;ermelo.joomla.remidian.localhost
</pre>
<h3>Step 3. Replace your $JOOMLA_HOME/configuration.php</h3>
<p>
Copy your existing configuration.php to $JOOMLA_HOME/_instance/&lt;whatever-you-want&gt;.php and replace the $JOOMLA_HOME/configuration.php by the file listed below.
</p>
<pre>
&lt;?php
/* $Id: configuration.php, v0.1 - 4/13/2005 18:06, 30c8981ef5b0c0d85be9695c19c184ee, http://remidian.com Exp $ */
&nbsp;
$INSTANCE[&#039;christenenvoorisrael.joomla.remidian.localhost&#039;]&nbsp;&nbsp;&nbsp;&nbsp; = &quot;_instance/christenenvoorisrael.nl.php&quot;;
$INSTANCE[&#039;isreality.joomla.remidian.localhost&#039;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;_instance/isreality.nl.php&quot;;
$INSTANCE[&#039;neverbesilent.joomla.remidian.localhost&#039;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;_instance/neverbesilent.org.php&quot;;
$INSTANCE[&#039;tovclub.joomla.remidian.localhost&#039;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;_instance/tovclub.nl.php&quot;;
$INSTANCE[&#039;yadlami.joomla.remidian.localhost&#039;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;_instance/yadlami.org.php&quot;;
$INSTANCE[&#039;ermelo.joomla.remidian.localhost&#039;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &quot;_instance/ermelo.org.php&quot;;
$INSTANCE[&#039;dragopecenica.joomla.remidian.localhost&#039;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &quot;_instance/dragopecenica.com.php&quot;;
&nbsp;
// No trailing slash
$JOOMLA_HOME = &quot;C:/app/apache/Apache1/Apache/htdocs/Roomla_1.0.12&quot;;
&nbsp;
/**********************************************************
 * REV, 4/13/2005 18:06, NO MORE EDITTING PAST THIS POINT *
 *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
 **********************************************************/
&nbsp;
$s_http_request&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = $_SERVER[&#039;HTTP_HOST&#039;] . $_SERVER[&#039;REQUEST_URI&#039;];
&nbsp;
$s_http_request_walk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= rtrim( $s_http_request, &#039;/&#039;);
&nbsp;
while ( $s_http_request_walk != &#039;.&#039;){
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// I will return the FIRST match ( from right to left )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( array_key_exists( $s_http_request_walk, $INSTANCE)){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( file_exists( $JOOMLA_HOME . &#039;/&#039; . $INSTANCE[$s_http_request_walk])){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include( $INSTANCE[$s_http_request_walk]);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die( &#039;INS-001: Unable to retieve config file for know host \\&#039;&#039; . $s_http_request_walk . &#039;\\&#039;&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$s_http_request_walk = dirname ( $s_http_request_walk);
}
&nbsp;
if ( !isset( $mosConfig_live_site))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die( &#039;INS-002: Unable to pass you a configuration file for unknow host \\&#039;&#039; . $s_http_request . &#039;\\&#039;&#039;);
&nbsp;
?&gt;
&nbsp;
</pre>
<h3>chmod configuration.php</h3>
<p>
Make the $JOOMLA_HOME/configuration.php file read only. Otherwise one sorry update of one of your sites configuration in the administrator section will overwrite your &#8216;beautiful multisite enabling&#8217; configuration.php, which, in fact, happened to me more than once, and, yes, that&#8217;s why I wrote this post serving as my own repository :).
</p>
<p>
Have fun with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://remidian.com/misc-2/joomla/make-joomla-multi-sites-enabled.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
