2011-12-01 72 views
1

我在redbuntu/lighttpd安装下有一个奇怪的问题,在Ubuntu 11.10下。我已经安装并配置了redmine,它的工作原理应该是这样的:除非找不到/ javascripts下的所有JavaScript文件,否则一切正常!?但是,“/ stylesheets”或“/ themes”下的所有内容都已正确加载。Redmine + Lighttpd:无法加载javascripts(404)

奇怪的是,当我打电话给“myserver.com/javascripts/”时,它返回404.如果我将javascripts目录复制到“js”并调用“myserver.com/js/”,我会从目录列表中lighttpd的!

这是我lighttpd.conf我的管理平台安装:

$HTTP["host"] == "myserver.com" { 
    server.document-root = "/var/www/redmine/public/" 
    server.indexfiles = ("dispatch.fcgi") 
    server.error-handler-404 = "/dispatch.fcgi" 
    server.errorlog = "/var/log/lighttpd/redmine/error.log" 
    accesslog.filename = "/var/log/lighttpd/redmine/access.log" 
    fastcgi.server = (".fcgi" => 
     ((
      "bin-path" => "/var/www/redmine/public/dispatch.fcgi", 
      "socket" => "/tmp/ruby-rails.socket", 
      "max-procs" => 5, 
      "idle-timeout" => 20, 
      "bin-environment" => (
       "RAILS_ENV" => "production", 
       "RAILS_ROOT" => "/var/www/redmine" 
      ), 
     )) 
    ) 
} 

任何想法?

编辑:

我已经把一个的debug.log请求装卸= “启用” 在我lighttpd.conf。

我得到这个调用 “/样式”:

2011-12-01 11:25:58: (response.c.300) -- splitting Request-URI 
2011-12-01 11:25:58: (response.c.301) Request-URI : /stylesheets/ 
2011-12-01 11:25:58: (response.c.302) URI-scheme : http 
2011-12-01 11:25:58: (response.c.303) URI-authority: redmine.musik-sammler.de 
2011-12-01 11:25:58: (response.c.304) URI-path  : /stylesheets/ 
2011-12-01 11:25:58: (response.c.305) URI-query : 
2011-12-01 11:25:58: (response.c.349) -- sanatising URI 
2011-12-01 11:25:58: (response.c.350) URI-path  : /stylesheets/ 
2011-12-01 11:25:58: (response.c.470) -- before doc_root 
2011-12-01 11:25:58: (response.c.471) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:25:58: (response.c.472) Rel-Path  : /stylesheets/ 
2011-12-01 11:25:58: (response.c.473) Path   : 
2011-12-01 11:25:58: (response.c.521) -- after doc_root 
2011-12-01 11:25:58: (response.c.522) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:25:58: (response.c.523) Rel-Path  : /stylesheets/ 
2011-12-01 11:25:58: (response.c.524) Path   : /var/www/redmine/public/stylesheets/ 
2011-12-01 11:25:58: (response.c.541) -- logical -> physical 
2011-12-01 11:25:58: (response.c.542) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:25:58: (response.c.543) Rel-Path  : /stylesheets/ 
2011-12-01 11:25:58: (response.c.544) Path   : /var/www/redmine/public/stylesheets/ 
2011-12-01 11:25:58: (response.c.561) -- handling physical path 
2011-12-01 11:25:58: (response.c.562) Path   : /var/www/redmine/public/stylesheets/ 
2011-12-01 11:25:58: (response.c.569) -- file found 
2011-12-01 11:25:58: (response.c.570) Path   : /var/www/redmine/public/stylesheets/ 
2011-12-01 11:25:58: (response.c.719) -- handling subrequest 
2011-12-01 11:25:58: (response.c.720) Path   : /var/www/redmine/public/stylesheets/ 
2011-12-01 11:25:58: (mod_indexfile.c.150) -- handling the request as Indexfile 
2011-12-01 11:25:58: (mod_indexfile.c.151) URI   : /stylesheets/ 
2011-12-01 11:25:58: (mod_compress.c.683) -- handling file as static file 
2011-12-01 11:25:58: (mod_dirlisting.c.922) -- handling the request as Dir-Listing 
2011-12-01 11:25:58: (mod_dirlisting.c.923) URI   : /stylesheets/ 
2011-12-01 11:25:58: (response.c.731) -- subrequest finished 

这调用 “/ JavaScript的”:

2011-12-01 11:24:38: (response.c.300) -- splitting Request-URI 
2011-12-01 11:24:38: (response.c.301) Request-URI : /javascripts/ 
2011-12-01 11:24:38: (response.c.302) URI-scheme : http 
2011-12-01 11:24:38: (response.c.303) URI-authority: redmine.musik-sammler.de 
2011-12-01 11:24:38: (response.c.304) URI-path  : /javascripts/ 
2011-12-01 11:24:38: (response.c.305) URI-query : 
2011-12-01 11:24:38: (response.c.349) -- sanatising URI 
2011-12-01 11:24:38: (response.c.350) URI-path  : /javascripts/ 
2011-12-01 11:24:38: (response.c.470) -- before doc_root 
2011-12-01 11:24:38: (response.c.471) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:24:38: (response.c.472) Rel-Path  : /javascripts/ 
2011-12-01 11:24:38: (response.c.473) Path   : 
2011-12-01 11:24:38: (response.c.521) -- after doc_root 
2011-12-01 11:24:38: (response.c.522) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:24:38: (response.c.523) Rel-Path  : /javascripts/ 
2011-12-01 11:24:38: (response.c.524) Path   : /var/www/redmine/public/javascripts/ 
2011-12-01 11:24:38: (response.c.541) -- logical -> physical 
2011-12-01 11:24:38: (response.c.542) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:24:38: (response.c.543) Rel-Path  : /javascripts/ 
2011-12-01 11:24:38: (response.c.544) Path   : /usr/share/javascripts/ 
2011-12-01 11:24:38: (response.c.561) -- handling physical path 
2011-12-01 11:24:38: (response.c.562) Path   : /usr/share/javascripts/ 
2011-12-01 11:24:38: (response.c.618) -- file not found 
2011-12-01 11:24:38: (response.c.619) Path   : /usr/share/javascripts/ 
2011-12-01 11:24:38: (response.c.300) -- splitting Request-URI 
2011-12-01 11:24:38: (response.c.301) Request-URI : /dispatch.fcgi 
2011-12-01 11:24:38: (response.c.302) URI-scheme : http 
2011-12-01 11:24:38: (response.c.303) URI-authority: redmine.musik-sammler.de 
2011-12-01 11:24:38: (response.c.304) URI-path  : /dispatch.fcgi 
2011-12-01 11:24:38: (response.c.305) URI-query : 
2011-12-01 11:24:38: (response.c.349) -- sanatising URI 
2011-12-01 11:24:38: (response.c.350) URI-path  : /dispatch.fcgi 
2011-12-01 11:24:38: (response.c.470) -- before doc_root 
2011-12-01 11:24:38: (response.c.471) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:24:38: (response.c.472) Rel-Path  : /dispatch.fcgi 
2011-12-01 11:24:38: (response.c.473) Path   : 
2011-12-01 11:24:38: (response.c.521) -- after doc_root 
2011-12-01 11:24:38: (response.c.522) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:24:38: (response.c.523) Rel-Path  : /dispatch.fcgi 
2011-12-01 11:24:38: (response.c.524) Path   : /var/www/redmine/public/dispatch.fcgi 
2011-12-01 11:24:38: (response.c.541) -- logical -> physical 
2011-12-01 11:24:38: (response.c.542) Doc-Root  : /var/www/redmine/public/ 
2011-12-01 11:24:38: (response.c.543) Rel-Path  : /dispatch.fcgi 
2011-12-01 11:24:38: (response.c.544) Path   : /var/www/redmine/public/dispatch.fcgi 
2011-12-01 11:24:38: (response.c.561) -- handling physical path 
2011-12-01 11:24:38: (response.c.562) Path   : /var/www/redmine/public/dispatch.fcgi 
2011-12-01 11:24:38: (response.c.569) -- file found 
2011-12-01 11:24:38: (response.c.570) Path   : /var/www/redmine/public/dispatch.fcgi 
2011-12-01 11:24:38: (response.c.719) -- handling subrequest 
2011-12-01 11:24:38: (response.c.720) Path   : /var/www/redmine/public/dispatch.fcgi 
2011-12-01 11:24:38: (mod_compress.c.683) -- handling file as static file 
2011-12-01 11:24:38: (mod_fastcgi.c.3703) handling it in mod_fastcgi 

为什么会出现在/ var /网络/技术管理平台这一跳的/ usr /股?????

回答

0

从你提供的信息来看,javascript文件夹是一个引用/ usr/share/javascripts的符号链接。

+0

不,它不是符号链接。我会看到的。 –

3

有同样的问题,终于解决了这个问题:你可能已启用JavaScript的别名MOD包含

alias.url += ("/javascript" => "/usr/share/javascript") 

只是做

sudo lighty-disable-mod javascript-alias 

我跟踪下来的javascript-common包。

感谢您发布调试信息,它帮助我很大程度上将mod_alias识别为问题的原因。

+0

谢谢,这是一个鬼鬼祟祟的!在我的一个旧应用程序中也有这个问题。 – Julik

相关问题