Deploying Radiant on Debian with Apache 2 and fastcgi


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

I modified the file public/.htaccess, adding:

AddHandler fcgid-script .fcgi

and created a virtual host like this:

[code]<VirtualHost *>
ServerAdmin webmaster@localhost
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


It is working, when I go to, 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 :wink:

In public/.htaccess, you also need to replace:
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

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

That is, “.cgi” becomes “.fcgi”.

I have the same configuration and have it working.



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

Thanks a lot.

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.


Check your apache error log and see where it is looking to get load your
stylesheets from.


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


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


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


So it goes to for the images and 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 in /var/www/test/public/ , isn’t it? Is
there another option that I should add?


Ok it works by redirecting to fcgi only files that doesn’t exist on the

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]