Redmine 2.0.1 - 缺少CSS?

时间:2012-06-23 14:37:13

标签: ruby-on-rails ruby passenger redmine

我正在使用的版本:

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

奇怪的是,在按下 Ctrl + F5 几次之后,我会得到这样的结果:

enter image description here

我在production.log

中找不到任何有趣的内容
Started GET "/admin/info" for 192.168.3.40 at Sat Jun 23 21:14:50 +0700 2012 
Processing by AdminController#info as HTML 
  Rendered admin/info.html.erb within layouts/admin (2.2ms) 
  Rendered admin/_menu.html.erb (7.8ms) 
  Rendered layouts/base.html.erb (72.9ms) 
Completed 200 OK in 93ms (Views: 79.1ms | ActiveRecord: 8.3ms) 

/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

/etc/httpd/conf.d/vhost.conf

<VirtualHost *:80>
    ServerName  redmine.domain.vn
    ServerAdmin quanta@domain.vn
    DocumentRoot /var/www/html/redmine/public/
    RailsBaseURI /  
    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>

.htaccess文件夹中没有可能导致乘客出现问题的public个文件:

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

-rw-rw-r--  1 apache apache  485 May 28 14:25 404.html
-rw-rw-r--  1 apache apache  674 May 28 14:25 500.html
-rwxr-xr-x  1 apache apache  473 Jun  2 11:34 dispatch.fcgi
-rwxrwxr-x  1 apache apache  473 May 28 14:25 dispatch.fcgi.example
-rw-rw-r--  1 apache apache 7886 May 28 14:25 favicon.ico
drwxrwxr-x  2 apache apache 4096 May 28 14:25 help
-rw-rw-r--  1 apache apache 1441 May 28 14:25 htaccess.fcgi.example
drwxrwxr-x  4 apache apache 4096 May 28 14:25 images
-rw-r--r--  1 apache apache   20 Jun 23 18:59 info.php
drwxrwxr-x  4 apache apache 4096 May 28 14:25 javascripts
drwxrwxr-x  2 apache apache 4096 May 28 14:25 stylesheets
drwxrwxr-x  4 apache apache 4096 May 28 14:25 themes

有什么想法吗?


更新周六6月23日22:50:44 ICT 2012

缺少CSS时的来源:

<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>

这显示了包含CSS的页面:

<link href="/themes/classic/stylesheets/application.css?1338189946" media="all" rel="stylesheet" type="text/css"/>

<script src="/javascripts/prototype.js?1338189946" type="text/javascript"></script>
<script src="/javascripts/effects.js?1338189946" type="text/javascript"></script>
<script src="/javascripts/dragdrop.js?1338189946" type="text/javascript"></script>
<script src="/javascripts/controls.js?1338189946" type="text/javascript"></script>
<script src="/javascripts/rails.js?1338189946" type="text/javascript"></script>
<script src="/javascripts/application.js?1338189946" type="text/javascript"></script>

导致错误hrefsrc路径的这些奇怪字符来自哪里?

1 个答案:

答案 0 :(得分:1)

罪魁祸首似乎是...... mod_pagespeed。打开Firebug时我看到以下错误:

"NetworkError: 500 Internal Server Error - http://redmine.domain.vn/javascripts/prototype.js,q1338189946.pagespeed.jm.ix8Kb1Gh8H.js"

禁用它,现在Redmine工作正常:

<VirtualHost *:80>
    ServerName  redmine.domain.vn
    ServerAdmin quanta@domain.vn
    DocumentRoot /var/www/html/redmine/public/
    RailsBaseURI /  
    ErrorLog logs/redmine.error_log

    ModPagespeed off

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