代码之家  ›  专栏  ›  技术社区  ›  d2kagw

Lighttpd/FastCGI将路由视为静态内容

  •  0
  • d2kagw  · 技术社区  · 16 年前

    如果我点击根路径,我会得到rails应用程序,但是一旦我点击了具有URL结构的内容,甚至是匹配默认路径:controller/:action route的内容,我就会从lighttpd得到404,rails应用程序甚至都不会被查询。

    server.modules = ( "mod_rewrite", "mod_redirect", "mod_access", "mod_status", "mod_fastcgi", "mod_accesslog" )
    
    server.document-root = "/myapp/application/public"
    index-file.names = ( "index.html", "dispatch.fcgi" )
    server.error-handler-404 = "/myapp/application/public/404.html"
    
    url.access-deny = ( "~", ".inc" )
    server.pid-file = "/var/run/lighttpd.pid"
    server.username = "lighttpd"
    server.groupname = "lighttpd"
    
    server.errorlog = "/var/log/lighttpd/error.log"
    accesslog.filename = "/var/log/lighttpd/access.log"
    
    #### fastcgi module
    fastcgi.server = (
        ".fcgi" => (
            "myapp" => (
                "socket" => "/tmp/myapp.socket",
                "bin-path" => "/myapp/application/public/dispatch.fcgi",
                "check-local" => "disable",
                "fix-root-scriptname" => "true",
                "docroot"=>"/"
            )
        )
    )
    
    # mimetype mapping
    mimetype.assign = (...)
    

    至于错误,我一点也不明白。

    2010-01-18 23:11:18: (response.c.261) URI-path     :  /tracking/index 
    2010-01-18 23:11:18: (response.c.375) -- before doc_root 
    2010-01-18 23:11:18: (response.c.376) Doc-Root     : /myapp/application/tracking/public 
    2010-01-18 23:11:18: (response.c.377) Rel-Path     : /tracking/index 
    2010-01-18 23:11:18: (response.c.378) Path         :  
    2010-01-18 23:11:18: (response.c.426) -- after doc_root 
    2010-01-18 23:11:18: (response.c.427) Doc-Root     : /myapp/application/tracking/public 
    2010-01-18 23:11:18: (response.c.428) Rel-Path     : /tracking/index 
    2010-01-18 23:11:18: (response.c.429) Path         : /myapp/application/tracking/public/tracking/index 
    2010-01-18 23:11:18: (response.c.446) -- logical -> physical 
    2010-01-18 23:11:18: (response.c.447) Doc-Root     : /myapp/application/tracking/public 
    2010-01-18 23:11:18: (response.c.448) Rel-Path     : /tracking/index 
    2010-01-18 23:11:18: (response.c.449) Path         : /myapp/application/tracking/public/tracking/index 
    2010-01-18 23:11:18: (response.c.466) -- handling physical path 
    2010-01-18 23:11:18: (response.c.467) Path         : /myapp/application/tracking/public/tracking/index 
    2010-01-18 23:11:18: (response.c.523) -- file not found 
    2010-01-18 23:11:18: (response.c.524) Path         : /myapp/application/tracking/public/tracking/index 
    2010-01-18 23:11:18: (response.c.205) -- splitting Request-URI 
    2010-01-18 23:11:18: (response.c.206) Request-URI  :  /myapp/application/tracking/public/404.html 
    

    有什么问题吗?

    1 回复  |  直到 16 年前
        1
  •  0
  •   d2kagw    16 年前

    尽管文档并没有真正解释服务器错误-处理程序设置。

    server.error-handler-404 = "/dispatch.fcgi"
    

    现在都修好了。