gpt4 book ai didi

javascript - Redmine + Lighttpd : fails to load javascripts (404)

转载 作者:行者123 更新时间:2023-11-30 13:26:17 24 4
gpt4 key购买 nike

我在 ubuntu 11.10 下安装 redmine/lighttpd 时遇到一个奇怪的问题。我已经安装并配置了 redmine,它工作正常但是:除了找不到/javascripts 下的所有 javascript 文件外,一切正常!?但是“/stylesheets”或“/themes”下的所有内容都已正确加载。

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

这是我的 redmine 安装的 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"
),
))
)
}

有什么想法吗???

编辑:

我在我的 lighttpd.conf 中设置了 debug.log-request-handling = "enable"。

我通过调用“/stylesheets”得到这个:

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

这用于调用“/javascripts”:

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/www/redmine 到/usr/share 的跳转?????

最佳答案

有同样的问题并最终解决了它:你可能启用了包含

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

就这样

sudo lighty-disable-mod javascript-alias

我追踪到 javascript-common包。

感谢您发布调试信息,它帮助我确定 mod_alias 是问题的原因。

关于javascript - Redmine + Lighttpd : fails to load javascripts (404),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8339075/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com