我試圖設置一個lighttpd服務器,它將運行用haskell編寫的fastCGI程序。 到目前爲止,我得到這個哈斯克爾程序:haskell fastcGI on lighttpd,需要配置幫助
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文件是錯誤的或不完整的,但在查看文檔後,我找不到它有什麼問題。
./test.cgi輸出一個有效的html文件。 當我修改lighttpd.conf到CGI我剛剛得到404 - 未找到 -------------------------------- ------------------------- 這是lighttpd.conf的修改部分:------------- ------------------------- cgi.server =(「/ test」=> (「test」=> (「 socket「=>」/tmp/test.sock「, 」bin-path「=>」/home/userwww/www/test.cgi「, 」check-local「=>」disable「 ) ) – lostincomputers 2009-12-30 18:34:56
有關配置lighttpd的幫助,請訪問serverfault.com。stackoverflow.com用於編程問題,而不是配置n個問題。 – dave4420 2009-12-30 19:01:23