0

我正在使用的版本:

  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几次后,我会得到这样的东西:

在此处输入图像描述

我在以下内容中找不到任何有趣的内容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

有什么想法吗?


更新 2012 年 6 月 23 日星期六 22:50:44 ICT

缺少 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路径的奇怪字符来自哪里?

4

1 回答 1

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>
于 2012-06-24T10:52:21.083 回答