Forum: Radiant CMS Deploying Radiant on Debian with Apache 2 and fastcgi

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ouroz O. (Guest)
on 2007-07-05 19:33
Hi,

I tried to deploy my Radiant application using Apache 2 and fastcgi on
Debian.

I modified the file public/.htaccess, adding:

[code]AddHandler fcgid-script .fcgi[/code]

and created a virtual host like this:

[code]<VirtualHost *>
    ServerAdmin webmaster@localhost
    ServerName ruby.cms01.uperto.int
    DocumentRoot /var/www/test/public/
    ErrorLog /var/www/test/log/apache.log

    <Directory /var/www/test/public/>
        Options Indexes FollowSymLinks MultiViews ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>[/code]

It is working, when I go to ruby.cms01.uperto.int, it goes to the real
path, which is /var/www/test/public/ and the login page appears, but my
problem is that I don't have any images, stylesheets or javascript.
I tried with aliases, but it doesn't work...

I really don't find answers anymore, and a little help would be great!

Thanks in advance, and tell me if you need more information ;)
Joe Lapp (Guest)
on 2007-07-05 19:52
(Received via mailing list)
In public/.htaccess, you also need to replace:
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

with:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

That is, ".cgi" becomes ".fcgi".

I have the same configuration and have it working.

HTH,
~joe
Ouroz O. (Guest)
on 2007-07-05 20:23
Hi,

Thanks for answering.

I actually did what you say before, but forgot to mention it. So I guess
it is not this which cause my problem. I really don't know what it could
be.

Thanks a lot.
Joe Lapp (Guest)
on 2007-07-05 21:36
(Received via mailing list)
I had another problem as well, where textile wouldn't function and the
pages/snippets/layouts tabs didn't appear, etc.  I'm not sure how that
got fixed, except that I had restarted my browser meantime.  A session
management issue?  Your symptoms didn't seem the same, though.

~joe
Daniel S. (Guest)
on 2007-07-06 05:54
(Received via mailing list)
Check your apache error log and see where it is looking to get load your
stylesheets from.
Ouroz O. (Guest)
on 2007-07-06 12:29
Hi,

I checked the log, here is where it takes the stylesheets and images:

[...]

Processing SiteController#show_page (for 192.168.30.63 at 2007-07-06
10:14:42) [GET]
  Parameters: {"1183563136"=>nil, "action"=>"show_page",
"url"=>["stylesheets", "admin", "main.css"], "controller"=>"site"}
Redirected to http://ruby.cms01.uperto.int/admin/welcome
Completed in 0.00555 (180 reqs/sec) | DB: 0.00288 (51%) | 302 Found
[http://ruby.cms01.uperto.int/stylesheets/admin/mai...]

[...]

Processing SiteController#show_page (for 192.168.30.63 at 2007-07-06
10:14:45) [GET]
  Parameters: {"1183563136"=>nil, "action"=>"show_page",
"url"=>["images", "admin", "view-site.gif"], "controller"=>"site"}
Redirected to http://ruby.cms01.uperto.int/admin/welcome
Completed in 0.00538 (185 reqs/sec) | DB: 0.00283 (52%) | 302 Found
[http://ruby.cms01.uperto.int/images/admin/view-sit...]

[...]



So it goes to http://ruby.cms01.uperto.int/images for the images and
http://ruby.cms01.uperto.int/stylesheets for the stylesheets. Images and
stylesheets are actually in /var/www/test/public/images (or
.../stylesheets). But with the settings of the virtual host, it should
transform ruby.cms01.uperto.int in /var/www/test/public/ , isn't it? Is
there another option that I should add?

Thanks
Ouroz O. (Guest)
on 2007-07-06 15:07
Ok it works by redirecting to fcgi only files that doesn't exist on the
server:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]


And with these two more rules it manages the static cache:

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
This topic is locked and can not be replied to.