Still problems with Radiant in a Subdirectory

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:inload’

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.

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

On 9/24/06, John T. [email protected] 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.

On 9/25/06, John W. Long [email protected] 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. 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.)

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
ProxyPassReverse /radiant http://localhost:3001/radiant
ProxyHTMLURLMap http://localhost:3001/radiant /radiant

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