# One Radiant to serve them all

**URL:** <https://www.ruby-forum.com/t/one-radiant-to-serve-them-all/103809>\
**Category:** Radiant CMS\
**Created:** [May 10, 2007, 3:26pm UTC](https://www.ruby-forum.com/t/one-radiant-to-serve-them-all/103809 "2007-05-10T15:26:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [May 10, 2007, 3:26pm UTC](https://www.ruby-forum.com/t/one-radiant-to-serve-them-all/103809/1 "2007-05-10T15:26:16Z")

</div>

Hi again,

I would like to have only one install of Radiant and its extensions,  
but have multiple virtual hosts using it. But not as the Virtual Host  
extension does: I want each website to use a different database so  
each clients do not share the same admin! How should I do that? An  
extension selecting the appropriate database according to the domain  
name?

Sean told me that’s “partly the point of ‘instance mode’. You can  
install the gem system-wide, and only check out the minimum of files  
when you need a new site. Extensions currently have to be installed in  
every instance you create, however.”

So is there a way to have the extensions installed one time in one  
place? Like replacing the extensions directory with a symlink to a  
unique place?

And I like the “minimum files checkout” idea but I’d love a no  
checkout solution, then I could point my web server to only one place  
and any domain pointing to the machine will use the main virtual host  
configuration. The way I don’t even have to configure each domain  
individually from the web server.

But maybe it will raise some issues like page caching? I have this  
problem with a Rails application that is available as one unique  
instance for hundreds of websites. And the content change for each  
domain, so I can’t use page caching because pages would overlap each  
others in the public/ folder, and I’m forced to use fragment caching.

Thanks!  
Jonathan

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [May 10, 2007, 4:21pm UTC](https://www.ruby-forum.com/t/one-radiant-to-serve-them-all/103809/2 "2007-05-10T16:21:24Z")

</div>

On May 10, 2007, at 9:25 AM, Jonathan Métillon wrote:

> Sean told me that’s “partly the point of ‘instance mode’. You can  
> install the gem system-wide, and only check out the minimum of files  
> when you need a new site. Extensions currently have to be installed in  
> every instance you create, however.”
> 
> So is there a way to have the extensions installed one time in one  
> place? Like replacing the extensions directory with a symlink to a  
> unique place?

I think you could hack something to work, or create a patch ;\_

Though I don’t know that would be necessary…

Check out extension\_loader.rb, in particular the method  
discover\_extensions. Notice that configuration.extension\_paths is  
used to find places to look for extensions. Then, jump over to  
initializer.rb - the Radiant one, not the Rails one. Here you will find:

* * *

class Configuration \< Rails::Configuration  
attr\_accessor :view\_paths  
attr\_accessor :extension\_paths

```
 def initialize
   self.view_paths = default_view_paths
   self.extension_paths = default_extension_paths
   super
 end

 def default_view_paths
   [view_path].compact
 end

 def default_extension_paths
   [RADIANT_ROOT + '/vendor/extensions', RAILS_ROOT + '/vendor/

```

extensions’].uniq  
end

```
 def admin
   AdminUI.instance
 end

```

## end

See that the default\_extension\_paths indicate that extensions may be  
loaded from two places, by default. Perhaps you could simply place  
your extensions in RAILS\_ROOT + ‘/vendor/extensions’, which, if you  
are running in instance mode using the Radiant GEM, would be the one  
extension location to rule them all.

I love test driven design…

```
--- config/environments/test.rb - 8 ---
config.extension_paths << File.join(File.expand_path

```

(RADIANT\_ROOT), ‘test’, ‘fixtures’, ‘extensions’)

aiwilliams

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [May 10, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/one-radiant-to-serve-them-all/103809/3 "2007-05-10T16:30:25Z")

</div>

Thanks you Adam, that’s what I needed to know. If I can’t get a solution  
to  
really use only one radiant install, then I’ll use this solution.

Jonathan
