国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

在Lighttpd服務器中運行Django應用的方法

2019-11-25 17:08:58
字體:
來源:轉載
供稿:網友

lighttpd (http://www.djangoproject.com/r/lighttpd/) 是一個輕量級的Web服務器,通常被用來提供靜態頁面的訪問。 它天生支持FastCGI,因此除非你的站點需要一些Apache特有的特性,否則,lighttpd對于靜態和動態頁面來說都是理想的選擇。

確保 mod_fastcgi 在模塊列表中,它需要出現在 mod_rewrite 和 mod_access ,但是要在 mod_accesslog 之前。

將下面的內容添加到你的lighttpd的配置文件中:

server.document-root = "/home/user/public_html"fastcgi.server = ( "/mysite.fcgi" => (  "main" => (   # Use host / port instead of socket for TCP fastcgi   # "host" => "127.0.0.1",   # "port" => 3033,   "socket" => "/home/user/mysite.sock",   "check-local" => "disable",  ) ),)alias.url = ( "/media/" => "/home/user/django/contrib/admin/media/",)url.rewrite-once = ( "^(/media.*)$" => "$1", "^/favicon/.ico$" => "/media/favicon.ico", "^(/.*)$" => "/mysite.fcgi$1",)

在一個lighttpd進程中運行多個Django站點

lighttpd允許你使用條件配置來為每個站點分別提供設置。 為了支持FastCGI的多站點,只需要在FastCGI的配置文件中,為每個站點分別建立條件配置項:

# If the hostname is 'www.example1.com'...$HTTP["host"] == "www.example1.com" { server.document-root = "/foo/site1" fastcgi.server = (  ... ) ...}# If the hostname is 'www.example2.com'...$HTTP["host"] == "www.example2.com" { server.document-root = "/foo/site2" fastcgi.server = (  ... ) ...}

你也可以通過 fastcgi.server 中指定多個入口,在同一個站點上實現多個Django安裝。 請為每一個安裝指定一個FastCGI主機。

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 维西| 大丰市| 烟台市| 冷水江市| 汶川县| 兴隆县| 韶山市| 突泉县| 华池县| 巴青县| 两当县| 合肥市| 夏河县| 旅游| 东丰县| 安康市| 息烽县| 桃江县| 沅陵县| 白朗县| 佛冈县| 邯郸市| 聂拉木县| 康乐县| 城市| 齐齐哈尔市| 阳江市| 百色市| 乐亭县| 秦安县| 樟树市| 和顺县| 徐汇区| 且末县| 綦江县| 镇康县| 深泽县| 柳林县| 个旧市| 海宁市| 神农架林区|