日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

在lighttpd上使用fastcgi方式部署hg server

發布時間:2025/3/8 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 在lighttpd上使用fastcgi方式部署hg server 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
lighttpd配置: #加載fastcgi模塊
server.modules?? += ( "mod_fastcgi" ) #定義一個新的web服務在81端口
$SERVER["socket"] == "0.0.0.0:81"{
??? server.document-root = "/home/hg/hgserver/"
#下面是認證的配置
??? #auth.debug = 2
??? auth.backend = "plain"
??? auth.backend.plain.userfile = "/etc/lighttpd/lighttpd_plain.user"
??? #auth.backend = "htdigest"
??? #auth.backend.htdigest.userfile = "/etc/lighttpd/lighttpd.user"
??? auth.require = ("/" => (
??? "method" => "digest",
??? "realm" => "Mercurial Repository",
??? "require" => "valid-user"
??? #"require" => "user=see|user=test"
??? )) #fastcgi配置
??? fastcgi.server=(
??????? "/hg_fastcgi.fcgi" =>(
??????????? "hg" => (
??????????????? "bin-path" => "/usr/bin/python /home/hg/hgserver/hg_fastcgi.py socket=/tmp/hg.socket-0",
??????????????? "socket" => "/tmp/hg.socket",
??????????????? "min-procs" => 1,
??????????????? "max-procs" => 1,
??????????????? "idle-timeout" => 120,
??????????????? "check-local" => "disable",
????????? )
??????? ),
??? ) ## error-handler for status 404
??? ##server.error-handler-404? = "/app.fcgi" url.rewrite-once = (
??? "^(/.*)$" => "/hg_fastcgi.fcgi$1",
??? )
} 注意事項: 1.剛開始加認證部分時,出現個怪異情況:lighttpd啟動正常,ie或firefox鏈接那需要認證的url時,很久沒反應,一直在讀取狀態;用sniffer查看網絡包,發現lighttpd返回了需要認證并在header中有connection close信息,但連接一直不斷開。后來,將認證配置移到fastcgi配置之前,將認證模塊加載也放在部分模塊之前,這怪異問題就解決了。 2.lighttpd也可以象apache那樣,由lighttpd動態啟動、管理fcgi程序。這個方法google了很多文章都沒有講,一般都是fcgi程序需要獨立運行。配置如上,bin-path是設置啟動命令,這里傳了個socket參數給fcgi程序。這里需要注意:fastcgi配置的socket參數是"/tmp/hg.socket",而fcgi程序的socket=socket=/tmp/hg.socket-0,多了-0。由于lighttpd可以啟動多個fcgi程序(上面配置max-procs=1,最多只啟動一個fcgi),那多個fcgi程序需要使用多個unix socket與lighttpd通訊。lighttpd默認會依次加入-0~-N。不過這個對socket的修改好像并沒有通知給fcgi,不知道某個fcgi中如何知道使用的是socket-幾? 3.具體lighttpd的fastcgi配置參考:http://redmine.lighttpd.net/projects/1/wiki/Docs:ModFastCGI hg server配置與運行腳本:(看附件)
附件中包含:google得來的文檔、配置文件、腳本

轉載于:https://blog.51cto.com/seewind/162857

總結

以上是生活随笔為你收集整理的在lighttpd上使用fastcgi方式部署hg server的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。