Problem setting up Radiant

I’m looking for some hints on how to set up Radiant (and by extension
any rails app) under a subdirectory. (running Ubuntu with Apache2)

IE. I want to set it up as: http://mysite.com/radiant (not as a
virtual directory such as radiant.mysite.com - as I’ll be accessing
for now via my internal IP 10.1.1.*, and my external URL is through
dyndns, so I don’t have much control there).

I have a site set up in /etc/apache2/sites-available:

DocumentRoot /var/www/radiant/public/

ErrorLog /var/log/apache2/error.log
Alias /radiant /var/www/radiant/public/

<Directory /var/www/radiant/public/>
  Options ExecCGI FollowSymLinks
  AddHandler cgi-script .cgi
  AddHandler fcgid-script .fcgi
  AllowOverride all
  Order allow,deny
  Allow from all

</Directory>

and the proper RewriteBase line added to the .htaccess file in the
public directory.

Now, when I go to http://mysite.com/radiant , the main page comes up,
but the links don’t include the subdirectory (mysite.com/about,
instead of mysite.com/radiant/about)

I had to modify the layout to let it find the stylesheet, by removing
the initial / .

And in the admin side, when I click the ‘+’ to expand a section, it is
displaying the HTTP headers:

Set-Cookie: _session_id=faa1dbd5cf25b0b70243262c11414317; path=/
Keep-Alive: timeout=15, max=98 Connection: Keep-Alive
Transfer-Encoding: chunked Content-Type: text/html;charset=utf-8 0

And it takes several seconds to expand the section (that text is below
the expanded items)

I’m sure there’s some apache voodoo that I’m just missing - I’m having
similar problems with other rails apps I’m trying to use!

I’d appreciate any help.

Thanks.

john

On 9/19/06, John T. [email protected] wrote:

I’m looking for some hints on how to set up Radiant (and by extension
any rails app) under a subdirectory. (running Ubuntu with Apache2)

Figures, as soon as I post, I see the recent messages about just
exactly this. My question is then, where do I “set
AbstractRequest.relative_url_root” as described on the wiki page?

Thanks.

On 9/19/06, John T. [email protected] wrote:

On 9/19/06, John T. [email protected] wrote:

I’m looking for some hints on how to set up Radiant (and by extension
any rails app) under a subdirectory. (running Ubuntu with Apache2)

Figures, as soon as I post, I see the recent messages about just
exactly this. My question is then, where do I “set
AbstractRequest.relative_url_root” as described on the wiki page?

Thanks.

Sigh.

I just can’t get it working. I tried added the behavior that John
suggested -

behaviors/root_behavior.rb

class RootBehavior < Behavior::Base

 register "Root"

 def page_url
   if parent_behavior?
     clean_url(parent_behavior.child_url(@page))
   else
     clean_url("/subfolder/#{@page.slug}")
   end
 end

end

But now the app doesn’t start at all. I get an error:

/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)

I like Rails, but I have soo many problems just getting apps to run,
it’s getting to be more trouble than it’s worth!

John,

There really wasn’t a need to spawn a separate thread about this. I’m
having
the same issue (as you’ve already read) and I’m working on it to fix.
The
behavior suggested is rough and the code isn’t tested, it’s just a
proposed
solution. I’m going to post updates when I reach a solution solid enough
to
share with the community.

On 9/20/06, Mislav Marohniæ [email protected] wrote:

John,

There really wasn’t a need to spawn a separate thread about this. I’m having
the same issue (as you’ve already read) and I’m working on it to fix. The
behavior suggested is rough and the code isn’t tested, it’s just a proposed
solution. I’m going to post updates when I reach a solution solid enough to
share with the community.

Yes, I now know there’s an existing thread. When I originally checked
the archive there wasn’t, and by the time I got to joining the list
and posting, it had appeared.

The behavior doesn’t seem to work, it generates an error for me. And I
don’t know where to “setAbstractRequest.relative_url_root” -
environment.rb? and set it to my root folder?

thanks and sorry