我正在尝试设置一个 lighttpd 服务器,它将运行用 haskell 编写的 fastCGI 程序。到目前为止,我得到了这个 haskell 程序:
import Network.CGI
import Text.XHtml
page :: Html
page = body << h1 << "Hello World!"
cgiMain :: CGI CGIResult
cgiMain = output $ renderHtml page
main :: IO ()
main = runCGI $ handleErrors cgiMain
和这个 lighttpd 配置:
server.document-root = "/home/userwww/www/"
server.port = 80
server.username = "userwww"
server.groupname = "userwww"
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
static-file.exclude-extensions = (".php", ".rb", "~", ".inc" )
index-file.names = ( "index.html" )
server.event-handler = "poll"
server.modules = (
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_rewrite",
"mod_cgi",
"mod_auth"
)
fastcgi.server = ("/test" =>
("test" =>
("socket" => "/tmp/test.sock",
"bin-path" => "/home/userwww/www/test.fcgi",
"check-local" => "disable"
)
)
)
Lighttpd 很好地启动并且在我打开 index.html 时可以正常工作,但是当我尝试打开http://127.0.0.1/test时它只是开始加载网页并无限期地继续加载它而不显示任何内容。
我怀疑我的 lighttpd.conf 文件是错误的或不完整的,但在查看文档后我找不到它有什么问题。