# Still problems with Radiant in a Subdirectory

**URL:** <https://www.ruby-forum.com/t/still-problems-with-radiant-in-a-subdirectory/69864>\
**Category:** Radiant CMS\
**Created:** [September 25, 2006, 4:13am UTC](https://www.ruby-forum.com/t/still-problems-with-radiant-in-a-subdirectory/69864 "2006-09-25T04:13:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 25, 2006, 4:13am UTC](https://www.ruby-forum.com/t/still-problems-with-radiant-in-a-subdirectory/69864/1 "2006-09-25T04:13:01Z")

</div>

I’m still having problems trying to get Radiant to work in a  
subdirectory. I’ve tried most of the suggestions but am still getting  
all sorts of errors.

I tried adding the behavior that was suggested, but that generated an  
error in the Apache log and an Application error is generated:

/var/www/radiant/public/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:140:in  
`load': /var/www/radiant/public/../config/../app/behaviors/root_behavior.rb:12: parse error, unexpected kEND, expecting $ (SyntaxError) from /var/www/radiant/public/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:140:in`load’

I tried adding the line to the environment.rb file:

ActionController::AbstractRequest.relative\_url\_root =’/radiant/’

but that doesn’t help.

It sorts of work but the stylesheet doesn’t load, as it’s trying to  
load it from the root of my web server. I changed the layout to not do  
/style.css but just style.css and that loads fine. However all of the  
links for the articles are based off the root of the server, not the  
subdirectory.

In the Admin interface (which works in the subdirectory), when I try  
to click the ‘+’ to expand an item, it takes quite a while for a  
response, and then the HTML headers are displayed on the page:

Set-Cookie: \_session\_id=98a0068fd3ae9f53b6cc850ec7500577; path=/  
Keep-Alive: timeout=15, max=97 Connection: Keep-Alive  
Transfer-Encoding: chunked Content-Type: text/html;charset=utf-8 0

Any more hints to get this working would really be appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 25, 2006, 6:13am UTC](https://www.ruby-forum.com/t/still-problems-with-radiant-in-a-subdirectory/69864/2 "2006-09-25T06:13:20Z")

</div>

John T. wrote:

> I’m still having problems trying to get Radiant to work in a  
> subdirectory. I’ve tried most of the suggestions but am still getting  
> all sorts of errors.

I wouldn’t recommend running Radiant in a sub-directory. It isn’t  
designed with this in mind.

If you’d like to just have Radiant serve files from a specific  
directory, the simplest thing would be to change the rewrite rules in  
the .htaccess file (or equivalent for your Web server). However, because  
Rails apps are designed to only serve files when a file in the public  
directory doesn’t exist, it’s generally pretty easy to make a Rails app  
coexist peacefully with other kinds of applications. For instance, on  
the Ruby site we run a cgi app in addition to Radiant all from the same  
directory structure (the public dir).

What exactly are you trying to do? and why?

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 25, 2006, 4:55am UTC](https://www.ruby-forum.com/t/still-problems-with-radiant-in-a-subdirectory/69864/3 "2006-09-25T04:55:12Z")

</div>

On 9/24/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> from /var/www/radiant/public/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:140:in
> 
> ```
> 
> `load’

Ok, I got past this error, some syntax problems in the posted code.

However, setting the root behavior to the code now just produces a  
page not found error from Radiant, trying to find the URL ‘/radiant/’

Still having the error in the admin pages however. I’d hate to give up  
on Radiant, but it’s not looking good.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 25, 2006, 8:03am UTC](https://www.ruby-forum.com/t/still-problems-with-radiant-in-a-subdirectory/69864/4 "2006-09-25T08:03:29Z")

</div>

On 9/25/06, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> directory structure (the public dir).
> 
> What exactly are you trying to do? and why?

I’m just trying to get Radiant to run on a local linux server  
(10.1.1.x) which is also served up using the Dyndns free service - so  
I get [xyz.homelinux.com](http://xyz.homelinux.com). I don’t think a virtual host will work with  
that - and I think it would be easier to access it from my home  
machines just by using a subdirectory (10.1.1.x/radiant) without  
having to set up hosts entries on every machine. Maybe I’m way off  
base, and there’s a way to do it, but I’m stumped. (I’m having a  
similar problem testing out Mephisto - it assumes that it’s at the  
root of the website, so is looking for style sheets and image  
directories off the root.)

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [January 15, 2007, 10:27pm UTC](https://www.ruby-forum.com/t/still-problems-with-radiant-in-a-subdirectory/69864/5 "2007-01-15T22:27:14Z")

</div>

Here is how did.

I start Radiant with mongrel server at port 3000 with prefix /radiant

> mongrel\_rails start -p 3001 --prefix=/radiant

I then config my apache at port 80 to route all request x.x.x.x/radiant  
to the mongrel server.

\<\>\>

ProxyPass /radiant [http://localhost:3001/radiant](http://localhost:3001/radiant)  
ProxyPassReverse /radiant [http://localhost:3001/radiant](http://localhost:3001/radiant)  
ProxyHTMLURLMap [http://localhost:3001/radiant](http://localhost:3001/radiant) /radiant

\<Location /radiant\>  
ProxyPassReverse /  
ProxyHTMLURLMap / /radiant/  
ProxyHTMLURLMap /radiant /radiant  
RequestHeader unset Accept-Encoding  
ProxyPassReverseCookiePath / /radiant
