Please help: How do I set the default URL path with multiple

I just installed the mental branch on textdrive. It seems to run
pretty well. The Assets Manager I wrote has a few problems, because
it is based on acts_as_attachment, which uses RMagick. I had to shut
that off, as it would kill Radiant due to memory usage. There are a
few fixes for that, I have to look and see what would be best. I am
leaning toward something with MiniMagick, it does more than enough
and might be a better solution. I have something running on
Textdrive with MiniMagick without TOO many problems…

Keith B.
[email protected]

Bodhi,

Thanks for your reply. I’m a bit confused with what you suggest. I’ve
already changed the root url to myapp1 but that doesn’t correct the
links.

Consider I have a symbolic link from /home/myapp1/public to
/public_html/myapp1.

That way, when I go to DOMAIN FOR SALE I’m going into the
public/dispatch.fcgi of my app, which works, but doesn’t correct the
links, because they are still rendered as /link not /myapp1/link.

So, if I do what you suggest, it simply moves www.domain.org/myapp1 to
www.domain.org/myapp1/myapp1. And still, it doesn’t correct the links.

My question is, if I use myaap1 as the slug for the root page as you
suggest, what else do I need to do? Do I have to set that up in the
apache
config?

I’ll paste here what Dave T. suggests so you can have a clearer idea
of what I have.

"If you don’t like dedicating an entire virtual host, perhaps because
you
want the Rails application to be part of a larger site, that’s possible
too. All you need to do is make a symbolic link to your public directory
from wherever you want the application to live.

Imagine that you have community site that needs a forum and you fancy
the
URL http://www.example.com/community/forum, which is just a symbolic
link
to the application directory /var/application/railsforum/public. Voila!

The symbolic link approach will automatically be picked up by Rails and
all the links created by the view helpers, such as image_tar og link_to,
will be rewritten to fit under the proper path."

But it really doesn’t correct anything!

Jose

Bodhi,

What I’ve finally done is the following.

In my apache httpd.conf

I’ve set

Listen 3000
Listen 3001

And I’ve created virtual hosts for each of my radiant sites using those
ports.

<VirtualHost *:3000>
ServerName myserver
DocumentRoot /pathtomyapp/myapp1/public/
<Directory /pathtomyapp/myapp1/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny

<VirtualHost *:3001>
ServerName myserver
DocumentRoot /pathtomyapp/myapp2/public/
<Directory /pathtomyapp/myapp2/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny

And this at the bottom for fcgi

AddHandler fcgid-script .fcgi IPCCommTimeout 40 IPCConnectTimeout 10 DefaultInitEnv RAILS_ENV production SocketPath /tmp/fcgidsock

All my site’s images go into their public/images directory to maintain
the
relative urls in my pages.

This is the best I can do for now. Both sites run from their own
directory
on different ports and I don’t have to fiddle with radiant.

Please tell me what you think.

Jose.

Jose, I’ve replied to both your emails here…

On 15/11/2006, at 10:01 AM, [email protected] wrote:

Bodhi,

What I’ve finally done is the following.

In my apache httpd.conf

I’ve set

All my site’s images go into their public/images directory to
maintain the
relative urls in my pages.

This is the best I can do for now. Both sites run from their own
directory
on different ports and I don’t have to fiddle with radiant.

Please tell me what you think.

If you are using 2 ports, why dont you just use / as the base-url for
radiant? Or are you doing this already?

You could try using different names (change ServerName in httpd.conf)
instead of ports:

http://example.com:3000/myapphttp://myapp1.example.com
http://example.com:3001/myapp2http://myapp2.example.com

What I meant by my previous email was:

If you have /myapp1 symlinked to rails/app/public then if you access
http://example.com/myapp1/ you will get the right page, but all the
links to other child pages will be rendered as eg. http://example.com/
child/page instead of http://example.com/myapp1/child/page (this is
how I understood the problem you were having…?)

If you add a page in radiant below (I think I mistakenly said
‘above’ in a previous mail) the home-page for your app (and dont
change the rails-base-path or whatever the configuration option is),
going from:

/
±- child/
±- page/

to:

/
±- myapp1/ ← new page in radiant
±- child/
±- page/

(remember, this change is made only in radiant) Then links to child
pages will be rendered as http://example.com/myapp1/child/page

I’m not 100% sure that this will work using apache-fcgi (we are a
lighty+fcgi shop here), as it might strip off the myapp1/ part of the
url. Also, when using this method, you have to be careful about
linking to static content in the public directory, and its not
completely DRY…

But if you have it working satisfactorily now, don’t worry about
changing it :slight_smile:

Bodhi

Bodhi,

You asked

If you are using 2 ports, why dont you just use / as the base-url for
radiant? Or are you doing this already?

I’m using / as the base url already.

You could try using different names (change ServerName in httpd.conf)
instead of ports:

http://example.com:3000/myapphttp://myapp1.example.com
http://example.com:3001/myapp2http://myapp2.example.com

This would be good. But since we haven’t pointed our domain to our
hosting
plan yet, I think it’s not possible.

If you have /myapp1 symlinked to rails/app/public then if you access
http://example.com/myapp1/ you will get the right page, but all the
links to other child pages will be rendered as eg. http://example.com/
child/page instead of http://example.com/myapp1/child/page (this is
how I understood the problem you were having…?)

Thats exactly the problem I was having.

to:

/
±- myapp1/ ← new page in radiant
±- child/
±- page/

Oooh ok, it didn’t work for me before because I was just changing my
home
slug from / to /subdir/

Now I see what you meant. But I’ve already created a bunch of pages
under
one main section of the site and using your method now would mean
starting
over again and I can’t afford it. However, I’ll have it in mind : )

I’m not 100% sure that this will work using apache-fcgi (we are a
lighty+fcgi shop here),

I’ve tried to set up lighthttpd but I get the following error on make

mod_webdav.c: In function webdav_delete_file': mod_webdav.c:536: warning: unused parameter p’
mod_webdav.c: In function webdav_copy_file': mod_webdav.c:664: warning: unused parameter p’
mod_webdav.c: In function webdav_has_lock': mod_webdav.c:1155: parse error before int’
mod_webdav.c:1198: has_lock' undeclared (first use in this function) mod_webdav.c:1198: (Each undeclared identifier is reported only once mod_webdav.c:1198: for each function it appears in.) mod_webdav.c:1153: warning: unused parameter con’
mod_webdav.c:1153: warning: unused parameter p' mod_webdav.c:1153: warning: unused parameter uri’
mod_webdav.c:1199: warning: control reaches end of non-void function
make[2]: *** [mod_webdav_la-mod_webdav.lo] Error 1
make[2]: Leaving directory /usr/home/src/lighttpd-1.4.13/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /usr/home/src/lighttpd-1.4.13’
make: *** [all] Error 2

Thanks for your attention Bodhi I really appreciate it.

jose.

Hey Loren-

Thanks for this info, I was wondering if you could give more
blow-by-blow on how you did it? Or even put up a wiki page?

This is all I found:
http://dev.radiantcms.org/radiant/wiki/RPS2
and would love to have more to go on.

Thanks-
Michael

Also, the more people that can jump on board and start using the code in
the mental branch the better. This is a major upgrade and your comments
and feedback are vital.

I want to jump on this but I’m unable to get my extensions to work.
I’m a radiant noob but have been doing rails for a while now.

Is there some how-to-get-mental info out there? I looked through the
list but didn’t see it.

What I have done is:

  1. Checked out the mental branch
  2. Ran ruby script/generate extension
  3. Ran the 12 migrations
  4. Created my album table.
  5. Dumped my album controller/model/views in the appropriate extension
    dirs
  6. Uncommented the activate/deactive tabs, uncommented the routes in
    the album_extension.rb
  7. See the Album tab, when I click it I get: uninitialized constant
    Admin::AssetController

Any help or pointers would be greatly appreciated. I have a few
projects I want to use Radiant on so I anticipate using it quite a bit
in the near future.

Thanks-
Michael

Michael J. wrote:

  1. See the Album tab, when I click it I get: uninitialized constant

Is your controller called AssetController?


John L.
http://wiseheartdesign.com

We are using Radiant for our January 1 website launch and I intend to
write a “How To” very soon for the weblog that will demonstrate
converting a behavior over to the extensions system.

Sean C.
seancribbs.com

And I get a page rendered however no content is showing on it.

Sweet, I have content. Oh man this new extension stuff is going to ROCK!

Thanks-
Michael

Hi,

I’m just starting out with Radiant and plan to launch a Radiant based
site in
January. I’m starting to gather that I should be using extensions and
the
mental branch rather than writing behaviors for functionality the site
will
need. Any thoughts?

Todd

Quoting Sean C. [email protected]:

Is your controller called AssetController?

No that was just the default route that was generated:
map.connect ‘admin/album/:action’, :controller => ‘admin/asset’

Sorry, I was assuming it generated that route for a reason.

I changed it to:
map.connect ‘admin/album/:action’, :controller => ‘albums’

And I get a page rendered however no content is showing on it.

Todd,

Tentatively, yes. The extensions API is in great flux right now, as
John
and the core team hammer it out. However, it is mostly functional and
you
can start using it today. However, I don’t see that it will be too much
trouble if you create your behaviors now, and then migrate them over to
Page
types later on when the API is solidified.

Sean C.
seancribbs.com

Fellow Radiant-nites,
I’m trying to set a Radiant powered website on eApps and I’m running
into the same problem Jose was running into (see post below). Mainly
that my Radiant site is under a virtualhost for which I don’t seem to
have much control and my RoR apps are in subdirectories.
This is how my website is configured in eApps (from the web control
panel):

Website: integrallis.virtual.vps-host.net
Type: Name-based
Document Root: /home/webadmin/integrallis.virtual.vps-host.net/html
Scripts: /home/webadmin/integrallis.virtual.vps-host.net/cgi-bin/

As you can see the Document Root is the /html directory under my virtual
host

I have a few Rails apps under the /html directory, one of them being
Radiant.

/html
±-+

  • integrallis <== radiant install
  • timetracker
  • courses

My site structure looks like:

Root ← Language Redirect
±- en (english home - js redirect to home below)
±- home
±- about
±- es (spanish home - js redirect to home below)
±- home
±- about

On my machine running under Locomotive things work like a charm.
I have no problem running Radiant at the root but I just don’t seem to
be able to configure things to work that way. Just like Jose mentioned
in his post my Radiant Admin interface works just fine, the problem is
with all of the links inside of my Radiant website. They’re all absolute
with respect to the ServerRoot e.g.
http://integrallis.virtual.vps-host.net

For example my home page under en is at:

http://integrallis.virtual.vps-host.net/integrallis/public/en/home

yet all the links in those pages are relative to the DocRoot (and hence
don’t work)

The first stupid thing that I tried was to create a snippet called
baseurl and set it to /integrallis/public/ so that I could prepend that
to my urls. By adding that <r:snippet name=“baseurl” /> I naively
thought, hey I can just do that in my layout and possibly in some of my
other snippets and I should be good to go. Well, that at least worked to
get the CSS and JS files loaded correctly in the main layout but things
quickly got ugly when I realized that I couldn’t pass that value to
other radius tags. So I quickly abandoned that route.

Before I venture any further I was wondering what the definitive answer
is as to how to run Radiant is a subdirectory. I wouldn’t mind making my
DocRoot point to

/home/webadmin/integrallis.virtual.vps-host.net/html/integrallis/public

As long as I can still run the other apps in a subdir (which they seem
to have no problem). But I can even find where to do that in this
webadmin console. I see the value for the DocRoot but it doesn’t look
like you can change it. But I really need the ability to run multiple
Rails apps (which I’m already doing successfully). I have a few apps for
timetracking, course catalogue, etc.

Thanks,
Brian

Jose Jose wrote:

Bodhi,

You asked

If you are using 2 ports, why dont you just use / as the base-url for
radiant? Or are you doing this already?

I’m using / as the base url already.

You could try using different names (change ServerName in httpd.conf)
instead of ports:

http://example.com:3000/myapphttp://myapp1.example.com
http://example.com:3001/myapp2http://myapp2.example.com

This would be good. But since we haven’t pointed our domain to our
hosting
plan yet, I think it’s not possible.

If you have /myapp1 symlinked to rails/app/public then if you access
http://example.com/myapp1/ you will get the right page, but all the
links to other child pages will be rendered as eg. http://example.com/
child/page instead of http://example.com/myapp1/child/page (this is
how I understood the problem you were having…?)

Thats exactly the problem I was having.

to:

/
±- myapp1/ ← new page in radiant
±- child/
±- page/

Oooh ok, it didn’t work for me before because I was just changing my
home
slug from / to /subdir/

Now I see what you meant. But I’ve already created a bunch of pages
under
one main section of the site and using your method now would mean
starting
over again and I can’t afford it. However, I’ll have it in mind : )

I’m not 100% sure that this will work using apache-fcgi (we are a
lighty+fcgi shop here),

I’ve tried to set up lighthttpd but I get the following error on make

mod_webdav.c: In function webdav_delete_file': mod_webdav.c:536: warning: unused parameter p’
mod_webdav.c: In function webdav_copy_file': mod_webdav.c:664: warning: unused parameter p’
mod_webdav.c: In function webdav_has_lock': mod_webdav.c:1155: parse error before int’
mod_webdav.c:1198: has_lock' undeclared (first use in this function) mod_webdav.c:1198: (Each undeclared identifier is reported only once mod_webdav.c:1198: for each function it appears in.) mod_webdav.c:1153: warning: unused parameter con’
mod_webdav.c:1153: warning: unused parameter p' mod_webdav.c:1153: warning: unused parameter uri’
mod_webdav.c:1199: warning: control reaches end of non-void function
make[2]: *** [mod_webdav_la-mod_webdav.lo] Error 1
make[2]: Leaving directory /usr/home/src/lighttpd-1.4.13/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /usr/home/src/lighttpd-1.4.13’
make: *** [all] Error 2

Thanks for your attention Bodhi I really appreciate it.

jose.

Hi,

I’m not sure if I understand the issue entirely, but I’m running a few
sites at
eApps. In eApps control panel, website settings, custom settings tab,
how
about something like this:

DocumentRoot /home/webadmin/integrallis.virtual.vps-host.net/html/public
Alias /timetracker
/home/webadmin/integrallis.virtual.vps-host.net/html/timetracker

or in my case, I went like this, to try to keep things organized:

DocumentRoot
/home/webadmin/integrallis.virtual.vps-host.net/html/radiant/public
Alias
/timetracker/home/webadmin/integrallis.virtual.vps-host.net/html/timetracker

Again, I’m not sure if I understand your scope entirely, but the above
examples
are how I configured a site at eApps to use Radiant off the root and a
PHP
based app from an alias.

Maybe/Hopefully this will help you

-Todd M

Quoting Brian Sam-Bodden [email protected]:

Todd,
Another quick question? How do you get to the Radiant Admin pages with
this setup? Since http://integrallis.virtual.vps-host.net/admin/ brings
me to the Tomcat admin page? and anything like
http://integrallis.virtual.vps-host.net/integrallis/admin results in
Radiant showing me the FileNotFound page.

Thanks again,
Brian

Brian Sam-Bodden wrote:

Todd,
Thanks a million! It’s obvious to me now, must be the side-effect of
this sleep deprivation experiment I’m conducting on myself ;-). That did
it! Man I feel like kicking myself in the rear. Well, if we ever cross
paths at a Ruby conf beers are on me.
I’ve just posted about my eApps configuration too. I was wondering if
our DB setups are also the same?

Thanks again,
Brian

Todd McGrath wrote:

Hi,

I’m not sure if I understand the issue entirely, but I’m running a few
sites at
eApps. In eApps control panel, website settings, custom settings tab,
how
about something like this:

DocumentRoot /home/webadmin/integrallis.virtual.vps-host.net/html/public
Alias /timetracker
/home/webadmin/integrallis.virtual.vps-host.net/html/timetracker

or in my case, I went like this, to try to keep things organized:

DocumentRoot
/home/webadmin/integrallis.virtual.vps-host.net/html/radiant/public
Alias
/timetracker/home/webadmin/integrallis.virtual.vps-host.net/html/timetracker

Again, I’m not sure if I understand your scope entirely, but the above
examples
are how I configured a site at eApps to use Radiant off the root and a
PHP
based app from an alias.

Maybe/Hopefully this will help you

-Todd M

Quoting Brian Sam-Bodden [email protected]:

Todd,
Thanks a million! It’s obvious to me now, must be the side-effect of
this sleep deprivation experiment I’m conducting on myself ;-). That did
it! Man I feel like kicking myself in the rear. Well, if we ever cross
paths at a Ruby conf beers are on me.
I’ve just posted about my eApps configuration too. I was wondering if
our DB setups are also the same?

Thanks again,
Brian

Todd McGrath wrote:

Hi,

I’m not sure if I understand the issue entirely, but I’m running a few
sites at
eApps. In eApps control panel, website settings, custom settings tab,
how
about something like this:

DocumentRoot /home/webadmin/integrallis.virtual.vps-host.net/html/public
Alias /timetracker
/home/webadmin/integrallis.virtual.vps-host.net/html/timetracker

or in my case, I went like this, to try to keep things organized:

DocumentRoot
/home/webadmin/integrallis.virtual.vps-host.net/html/radiant/public
Alias
/timetracker/home/webadmin/integrallis.virtual.vps-host.net/html/timetracker

Again, I’m not sure if I understand your scope entirely, but the above
examples
are how I configured a site at eApps to use Radiant off the root and a
PHP
based app from an alias.

Maybe/Hopefully this will help you

-Todd M

Quoting Brian Sam-Bodden [email protected]:

Todd,
The weird thing is that the tomcat root is
http://integrallis.virtual.vps-host.net:8080/ so the admin should be
http://integrallis.virtual.vps-host.net:8080/admin but somehow the
server is also redirecting http://integrallis.virtual.vps-host.net/admin
to the tomcat admin. I’ll try to disable it or change it. Tomcat I’m
familiar with so it should be a quicker fix on my side. I’ll post the
solution soon.

Brian

Todd McGrath wrote:

Brian,

I know what you mean - they offer a plan with Ruby and Tomcat combined.

How about asking eApps support to change the Tomcat /admin to
/tomcatadmin? or
disabling Tomcat admin?

Todd

Quoting Brian Sam-Bodden [email protected]:

Brian,

I know what you mean - they offer a plan with Ruby and Tomcat combined.

How about asking eApps support to change the Tomcat /admin to
/tomcatadmin? or
disabling Tomcat admin?

Todd

Quoting Brian Sam-Bodden [email protected]:

Or…

And I can’t verify if this will work or not-

Change all references of “admin/” in the config/routes.rb file to
something
like
“radiantadmin/”

Quoting Todd McGrath [email protected]: