Project

General

Profile

Missing stylesheets

Added by Martin Aarhof almost 14 years ago

Can somebody help me...

Upgraded from 1.0.1-stable to 1.1.0
and now it cant find any javascript or stylesheet.
All the HTML is rendered as normal

What have I missed?

(It worked perfect before I started the upgrade...)


Replies (7)

RE: Missing stylesheets - Added by Martin Aarhof almost 14 years ago

When I go direct to my stylesheet
DOMAIN/stylesheets/application.css

I get this

Routing Error
No route matches "/stylesheets/application.css" with {:method=>:get}

and the same with javascripts

apache rewrite mod is enabled

RE: Missing stylesheets - Added by Felix Schäfer almost 14 years ago

How is your redmine served? Mongrel, thin, passenger, …?

RE: Missing stylesheets - Added by Martin Aarhof almost 14 years ago

Apache2 mod-passenger

Apache/2.2.8 (Ubuntu) mod_fastcgi/2.4.6 mod_python/3.3.1 Python/2.5.2 Phusion_Passenger/3.0.1 PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.6(2007-09-24) (internal dummy connection)

RE: Missing stylesheets - Added by Felix Schäfer almost 14 years ago

See if you have a .htaccess in your redmine_dir/public (or wherever apache serves the static files from), the .htaccess defaults to (f)cgi and might cause problems with passenger, it should be safe to remove it.

RE: Missing stylesheets - Added by Martin Aarhof almost 14 years ago

1 # General Apache options
2 <IfModule mod_fastcgi.c>
3 AddHandler fastcgi-script .fcgi
4 </IfModule>
5 <IfModule mod_fcgid.c>
6 AddHandler fcgid-script .fcgi
7 </IfModule>
8 <IfModule mod_cgi.c>
9 AddHandler cgi-script .cgi
10 </IfModule>
11 Options FollowSymLinks +ExecCGI
27 RewriteEngine On
36 RewriteRule $ index.html [QSA]
37 RewriteRule ^([
.]
)$ $1.html [QSA]
38 RewriteCond %{REQUEST_FILENAME} !-f
39 <IfModule mod_fastcgi.c>
40 RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
41 </IfModule>
42 <IfModule mod_fcgid.c>
43 RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
44 </IfModule>
45 <IfModule mod_cgi.c>
46 RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
47 </IfModule>
55 ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"

Which lines do you want me to remove?

RE: Missing stylesheets - Added by Martin Aarhof almost 14 years ago

oh dear...

I removed line
2-7
and
39-44

So only mod_cgi.c
should run...

Now it works ! :D

AND
I have NEVER seen it been SO fast, even with all cache turned off - Nice! :D
(im very happy now - 4 hours of messing around yikes...)

RE: Missing stylesheets - Added by Quan Tong Anh over 12 years ago

Felix Schäfer wrote:

See if you have a .htaccess in your redmine_dir/public (or wherever apache serves the static files from), the .htaccess defaults to (f)cgi and might cause problems with passenger, it should be safe to remove it.

I don't have any .htaccess file in the public folder:

ls -la /var/www/html/redmine/public/

total 108
drwxrwxr-x  7 1000 1000 4096 Jun  2 11:35 .
drwxr-xr-x 17 root root 4096 Jun 23 18:30 ..
-rw-rw-r--  1 1000 1000  485 May 28 14:25 404.html
-rw-rw-r--  1 1000 1000  674 May 28 14:25 500.html
-rwxr-xr-x  1 root root  473 Jun  2 11:34 dispatch.fcgi
-rwxrwxr-x  1 1000 1000  473 May 28 14:25 dispatch.fcgi.example
-rw-rw-r--  1 1000 1000 7886 May 28 14:25 favicon.ico
drwxrwxr-x  2 1000 1000 4096 May 28 14:25 help
-rw-rw-r--  1 1000 1000 1441 May 28 14:25 htaccess.fcgi.example
drwxrwxr-x  4 1000 1000 4096 May 28 14:25 images
drwxrwxr-x  4 1000 1000 4096 May 28 14:25 javascripts
drwxrwxr-x  2 1000 1000 4096 May 28 14:25 stylesheets
drwxrwxr-x  4 1000 1000 4096 May 28 14:25 themes

/etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12
PassengerRuby /usr/bin/ruby


Apache configuration:

<VirtualHost *:80>
    ServerName    redmine.domain.vn
    ServerAdmin    x
    DocumentRoot /var/www/html/redmine/public/
    RailsBaseURI /  
    #SetEnvIf Request_URI "(.*)/sysadmin/*" dontlog
    #CustomLog logs/redmine.access_log combined
    ErrorLog logs/redmine.error_log

    <Directory "/var/www/html/redmine/public/">
        Options -MultiViews
        Order allow,deny
        Allow from all
        AllowOverride none
        Satisfy Any

    </Directory>
</VirtualHost>

Redmine versions:
  Environment:
  Redmine version                          2.0.1.stable
  Ruby version                             1.8.7 (i386-linux)
  Rails version                            3.2.3
  Environment                              production
  Database adapter                         MySQL

There's no special in the production.log:
Started GET "/admin/info" for 192.168.3.40 at Sat Jun 23 18:37:24 +0700 2012
Processing by AdminController#info as HTML
  Rendered admin/info.html.erb within layouts/admin (6.2ms)
  Rendered admin/_menu.html.erb (7.5ms)
  Rendered layouts/base.html.erb (245.7ms)
Completed 200 OK in 273ms (Views: 257.8ms | ActiveRecord: 7.9ms)

Is there anything else that can cause this?

UPDATE

It shows the wrong href and src path when viewing the source code:

<link href="/themes/classic/stylesheets/I.application.css,q1338189946.pagespeed.cf.0ULULhmylO.css" media="all" rel="stylesheet" type="text/css"/>

<script src="/javascripts/prototype.js,q1338189946.pagespeed.jm.ix8Kb1Gh8H.js" type="text/javascript"></script>
<script src="/javascripts/effects.js,q1338189946.pagespeed.jm.2gOWX1ohLv.js" type="text/javascript"></script>
<script src="/javascripts/dragdrop.js,q1338189946.pagespeed.jm.vpl0THRgUC.js" type="text/javascript"></script>
<script src="/javascripts/controls.js,q1338189946.pagespeed.jm.-zBskbSR2S.js" type="text/javascript"></script>
<script src="/javascripts/rails.js,q1338189946.pagespeed.jm.unwctb3Jeq.js" type="text/javascript"></script>
<script src="/javascripts/application.js,q1338189946.pagespeed.jm.Su1eFnevwF.js" type="text/javascript"></script>

    (1-7/7)