Hi,

I found this by John Long on the ruby archive
http://www.ruby-forum.com/topic/82446

He wrote:
"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 inthe .htaccess file (or equivalent for your Web server).
What exactly are you trying to do? and why?"

What I'm trying to do is to set two different websites like this:

mydomain.org/app1
mydomain.org/app2

mydomain.org is an institution comprised of two departments. Each
department wants to have their own database and their cms to administer
their websites.

I'll explain what I've done so far:

In my httpd.conf I've included

<IfModule mod_fcgid.c>
    AddHandler fcgid-script .fcgi
    IPCCommTimeout 40
    IPCConnectTimeout 10
    DefaultInitEnv RAILS_ENV production
    SocketPath /tmp/fcgidsock
</IfModule>

And,

I've made a ln -s from home/myapp/public/ to /var/www/html/myapp

That way when I go to mydomain.org/myapp I get the main page of my website.
>From there on, all the autogenerated links (ex. sitemap snippet) direct me
to mydomain.org/link instead of to mydomain.org/myapp/link

The thing is that I've tried a bunch of different combinations and nothing
seems to make a difference.

1) I've created a virtual host for myapp

2) I've included in my environment.rb
ActionController::AbstractRequest.relative_url_root = "/myapp"

3) In .htaccess I've uncommented RewriteBase /myapp

4) And I've followed the following articles in configuration combinations
I can't even remember

http://www.hostingrails.com/forums/wiki_thread/6
http://creativi.st/blog/articles/read/17
http://wiki.rubyonrails.org/rails/pages/HowtoDeployMoreThanOneRailsAppOnOneMachine
http://blog.duncandavidson.com/2005/12/real_lessons_fo.html

Is this a Radiant problem then? I got the idea of multiple Radiant's in
sbdirectories form Dave Thomas' Agile Web Development with Rails.

Jose.


> Jose,
>
> It is a common task.  The disconnect happens between Radiant and the
> generated page.  Radiant will know to add the URL prefix, but any manual
> links won't be automatically updated/parsed on the way out.
>
> If you are using Apache, make sure to put this line in your .htaccess:
>
> RewriteBase /subdir
>
> Cheers,
> Sean
>
> On 11/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> Ruben,
>>
>> I also found this
>> http://www.hostingrails.com/forums/rails_coding_thread/37
>>
>> I think this is what I need. It says that
>> ActionController::AbstractRequest.relative_url_root "Essentially tells
>> Rails to tack on an extra '/subdir' to every URL it writes."
>>
>> I've already used ActionController::AbstractRequest.relative_url_root >
>> "/subdir" at the bottom of environment.rb and nothing happens.
>>
>> I'm really confused. Shouldn't hosting different rails applications on
>> different subfolders be a common task?
>>
>> jose.
>>
>> > Jose,
>> >
>> > That Rails ticket is exactly what I was talking about. I tried and it
>> > worked
>> > very well. The only problem I see if the URL requests collide with
>> some
>> > controller/setting of Radiant....if you have a development environment
>> > tried
>> > there first before deploying.
>> >
>> >
>> >
>> > On 11/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Ruben,
>> >>
>> >> Thanks for your help.
>> >>
>> >> I've changed routes.rb and nothing happens : ( Perhaps I'm not sure
>> of
>> >> what I'm doing.
>> >>
>> >> I've also found this ticket http://dev.rubyonrails.org/ticket/5420
>> >>
>> >> It says  to add "ActionController::AbstractRequest.relative_url_root
>> > >> '/subdir'" to both routes.rb and environment.rb
>> >>
>> >> Has anybody used this method?
>> >>
>> >> Jose.
>> >>
>> >> > Jose,
>> >> >
>> >> > I'd fiddle with the lines below (which correspond to lines > 56 in
>> >> > routes.rb
>> >> > ):
>> >> >
>> >> >  # Site URLs
>> >> >>   map.with_options(:controller => 'site') do |site|
>> >> >>     site.homepage          '',
>> >> :action
>> >> >> => 'show_page', :url => '/'
>> >> >>
>> >> >>
>> >> >>     site.not_found
>> >> 'error/404',                          :action
>> >> >> => 'not_found'
>> >> >>     site.error
>> >> 'error/500',                          :action
>> >> >> => 'error'
>> >> >>
>> >> >>     # Everything else
>> >> >>     site.connect           '*url',
>> >> :action
>> >> >> => 'show_page'
>> >> >>   end
>> >> >>
>> >> >
>> >> >
>> >> > On 11/13/06, Ruben D. Orduz <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >> I think what you describe should be fairly easy to solve with
>> >> >> routes.rbhacks. Else your COULD create an url filter in the front
>> >> >> controller to add
>> >> >> "/myApp/" in front of all incoming URLS. Sorry I can't be more
>> >> specific
>> >> >> at
>> >> >> the moment...I'm at work and am supposed to be debugging some 2K
>> >> lines
>> >> >> of
>> >> >> .Net code :(
>> >> >>
>> >> >>
>> >> >> On 11/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> >> >> >
>> >> >> > Ok, let me exaplin this as easily as I can.
>> >> >> >
>> >> >> > Radiant generates an html page with the following div
>> >> >> >
>> >> >> > <div id="top_nav">
>> >> >> >       <a href="/recursos/">Recursos para la investigación</a>
>> >> >> >
>> >> >> > What I want to do is to force, in <a href=>, "/myapp/"
>> >> >> >
>> >> >> > So I would get /myapp/recursos/
>> >> >> >
>> >> >> > and eveything will work fine : )
>> >> >> >
>> >> >> > Any ideas?
>> >> >> >
>> >> >> > > Thanks for the reply.
>> >> >> > >
>> >> >> > > Do you know where exactly do I have to make the changes?
>> >> >> > >
>> >> >> > > Perhaps   # Site URLs ?
>> >> >> > >
>> >> >> > > Jose.
>> >> >> > >
>> >> >> > >
>> >> >> > >> The easiest way is to set your DNS to point to your radiant
>> sub
>> >> >> dir.
>> >> >> > >> Else
>> >> >> > >> you could fiddle with the routes.rb file to fit your needs.
>> >> >> > >>
>> >> >> > >>
>> >> >> > >> On 11/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> >> >> > >>>
>> >> >> > >>> Hi,
>> >> >> > >>>
>> >> >> > >>> I've managed to set two radiant sites using apache 1.3 and
>> >> fcgi.
>> >> >> Now
>> >> >> > I
>> >> >> > >>> can
>> >> >> > >>> access them site at http://www.mydomain.org/radiant1 and
>> >> >> > >>> http://www.mydomain.org/radiant2
>> >> >> > >>>
>> >> >> > >>> However, I can't navigate the sites because all the links
>> are
>> >> >> > generated
>> >> >> > >>> using the default path /
>> >> >> > >>>
>> >> >> > >>> So if I click the News section for example, the site refers
>> me
>> >> to
>> >> >> > >>> http://www.mydomain.org/news instead of
>> >> >> > >>> http://www.mydomain.org/radiant1/news.
>> >> >> > >>>
>> >> >> > >>> Where do I set the default url path for each of my radiant
>> >> sites?
>> >> >> > >>>
>> >> >> > >>> Jose.
>> >> >> > >>> _______________________________________________
>> >> >> > >>> Radiant mailing list
>> >> >> > >>> Post:   [email protected]
>> >> >> > >>> Search: http://radiantcms.org/mailing-list/search/
>> >> >> > >>> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>> >> >> > >>>
>> >> >> > >> _______________________________________________
>> >> >> > >> Radiant mailing list
>> >> >> > >> Post:   [email protected]
>> >> >> > >> Search: http://radiantcms.org/mailing-list/search/
>> >> >> > >> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>> >> >> > >
>> >> >> > > _______________________________________________
>> >> >> > > Radiant mailing list
>> >> >> > > Post:   [email protected]
>> >> >> > > Search: http://radiantcms.org/mailing-list/search/
>> >> >> > > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>> >> >> > >
>> >> >> >
>> >> >> > _______________________________________________
>> >> >> > Radiant mailing list
>> >> >> > Post:   [email protected]
>> >> >> > Search: http://radiantcms.org/mailing-list/search/
>> >> >> > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>> >> >> >
>> >> >>
>> >> >>
>> >> > _______________________________________________
>> >> > Radiant mailing list
>> >> > Post:   [email protected]
>> >> > Search: http://radiantcms.org/mailing-list/search/
>> >> > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>> >>
>> >> _______________________________________________
>> >> Radiant mailing list
>> >> Post:   [email protected]
>> >> Search: http://radiantcms.org/mailing-list/search/
>> >> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>> >>
>> > _______________________________________________
>> > Radiant mailing list
>> > Post:   [email protected]
>> > Search: http://radiantcms.org/mailing-list/search/
>> > Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>>
>> _______________________________________________
>> Radiant mailing list
>> Post:   [email protected]
>> Search: http://radiantcms.org/mailing-list/search/
>> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>>
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to